This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
from scipy.optimize import least_squares | |
from head_pose_tracker.function import utils | |
np.set_printoptions(precision=4, suppress=True) | |
def get_camera_pose_gt(world, eye0, eye1): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import file_methods as fm | |
class Transformation: | |
def __init__(self): | |
self._all_extrinsic_eye1_world = fm.load_object( | |
"/cluster/users/Ching/datasets/camera_extrinsics_measurement/all_extrinsic/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import cv2 | |
import numpy as np | |
def calculate_matrix_diff_to_golden(scene_sn, rotation_matrix_scene): | |
golden_scene_sn = "p69tb" | |
if scene_sn in ("6tgbx", "rylzd", "vtukq"): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
paper_size = 2100, 2100 | |
cross_len = 20 | |
center = paper_size[0] // 2, paper_size[1] // 2 | |
marker = np.ones(paper_size) * 255 | |
cv2.circle(marker, center, 940, (180, 180, 180), thickness=2) | |
cv2.circle(marker, center, 600, (0, 0, 0), thickness=-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
def rvec_to_yawpitchroll(rvec): | |
""" | |
Convert rotation vector to yaw, pitch, roll | |
Args: | |
rvec: pose rotation vector (rvec can be obtained by | |
[rotation_x, rotation_y, rotation_z] in head_pose_tacker_poses.csv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
paper_size = 2100, 2100 | |
cross_len = 20 | |
center = paper_size[0] // 2, paper_size[1] // 2 | |
marker = np.ones(paper_size) * 255 | |
cv2.circle(marker, center, 940, (180, 180, 180), thickness=2) | |
cv2.circle(marker, center, 600, (0, 0, 0), thickness=-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PIL.Image as Image | |
import cv2 | |
import numpy as np | |
def main(data, image, n_bins, sigma_percentage): | |
height, width, *_ = ref_image.shape | |
if width > height: | |
n_bins_x = int(n_bins) | |
n_bins_y = int(n_bins * height / width) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from scipy.spatial.distance import cdist | |
import camera_models as cm | |
CORE = "Pupil Cam1 ID2" | |
PI = "PI world v1" | |
FHD = 1920, 1080 | |
HD = 1280, 720 |