def __init__(self, g_pool, world_camera_intrinsics , cal_ref_points_3d, cal_observed_points_3d, eye_camera_to_world_matrix0 , cal_gaze_points0_3d, eye_camera_to_world_matrix1 = np.eye(4) , cal_gaze_points1_3d = [], run_independently = False , name = "Calibration Visualizer" ):
super().__init__( g_pool,name, run_independently)
self.image_width = 640 # right values are assigned in update
self.focal_length = 620
self.image_height = 480
self.eye_camera_to_world_matrix0 = eye_camera_to_world_matrix0
self.eye_camera_to_world_matrix1 = eye_camera_to_world_matrix1
self.cal_ref_points_3d = cal_ref_points_3d
self.cal_observed_points_3d = cal_observed_points_3d
self.cal_gaze_points0_3d = cal_gaze_points0_3d
self.cal_gaze_points1_3d = cal_gaze_points1_3d
if world_camera_intrinsics:
self.world_camera_width = world_camera_intrinsics['resolution'][0]
self.world_camera_height = world_camera_intrinsics['resolution'][1]
self.world_camera_focal = (world_camera_intrinsics['camera_matrix'][0][0] + world_camera_intrinsics['camera_matrix'][1][1] ) / 2.0
else:
self.world_camera_width = 0
self.world_camera_height = 0
self.world_camera_focal = 0
camera_fov = math.degrees(2.0 * math.atan( self.window_size[0] / (2.0 * self.focal_length)))
self.trackball = Trackball(camera_fov)
self.trackball.distance = [0,0,-80.]
self.trackball.pitch = 210
self.trackball.roll = 0
########### Open, update, close #####################
评论列表
文章目录