Esempio n. 1
0
def save_roi(camera_info, output_file):
    """Save roi

    save as [xmin, xmax, ymin, ymax] order
    cm.roi is [top, left, bottom, right]
    """

    cm = PinholeCameraModel.from_camera_info(camera_info)
    ymin, xmin, ymax, xmax = cm.roi
    clip_info = np.array([xmin, xmax, ymin, ymax])
    np.save(output_file, clip_info)
Esempio n. 2
0
 def load_camera_info(self):
     rospy.loginfo('loading camera model')
     self.camera_info = rospy.wait_for_message(
         self.camera_info_msg, CameraInfo)
     # self.camera_model.fromCameraInfo(self.camera_info)
     self.camera_model = PinholeCameraModel.from_camera_info(self.camera_info)
     # self.intrinsic = o3d.camera.PinholeCameraIntrinsic()
     # self.intrinsic.set_intrinsics(
     #     self.camera_model.width,
     #     self.camera_model.height,
     #     self.camera_model.fx(),
     #     self.camera_model.fy(),
     #     self.camera_model.cx(),
     #     self.camera_model.cy())
     #print(self.camera_model.width)
     print('load camera model')
Esempio n. 3
0
def save_camera_info(camera_info, output_file):
    cm = PinholeCameraModel.from_camera_info(camera_info)
    cm.dump(output_file)