def get_obj_fps2d(self, idx): # FPS2D ARE IN CAMERA COORDINATES (IN ORDER TO EVALUATE THE ACCURACY OF THE 2D KEYPOINT ESTIMATES)! fps3d = self.get_obj_fps3d_trans(idx) intr = self.get_camintr(idx) fps2d_hom = utils.transform(fps3d, intr) fps2d = fps2d_hom[:, :2] / fps2d_hom[:, 2:] return np.array(fps2d).astype(np.float32)
def get_joints3d(self, idx): sample = self.get_dataidx(idx) coords3d = sample['coords_3d'] # shape: (n, 3) trans_coords3d = utils.transform(coords3d, self.get_camextr(idx), convert_to_homogeneous=True) return np.array(trans_coords3d).astype(np.float32)
def get_obj_verts_trans(self, idx): # Get object 3d vertices (n,3) in the camera coordinate frame verts = self.get_obj_verts(idx) # shape: (n, 3) trans_verts = utils.transform(verts, self.get_obj_pose(idx), convert_to_homogeneous=True) return np.array(trans_verts).astype(np.float32)
def get_objcorners2d(self, idx): corners_3d = self.get_obj_corners3d(idx) intr = self.get_camintr(idx) corners_2d_hom = utils.transform(corners_3d, intr) corners_2d = corners_2d_hom[:, :2] / corners_2d_hom[:, 2:] return np.array(corners_2d).astype(np.float32)
def get_obj_fps3d_trans(self, idx): fps3d = self.get_obj_fps3d(idx) pose = self.get_obj_pose(idx) # Transform points from tool coordinate frame to camera coordinate frame fps3d = utils.transform(fps3d, pose, convert_to_homogeneous=True) return np.array(fps3d).astype(np.float32)