luxonis / depthai-experiments

Experimental projects we've done with DepthAI.
MIT License
799 stars 356 forks source link

Camera extrinsic parameter #517

Closed SahilJain8 closed 4 months ago

SahilJain8 commented 5 months ago

I'm currently working on message generation using Open3D. For this I require access to the camera's extrinsic parameters.

volume = o3d.pipelines.integration.ScalableTSDFVolume( voxel_length=4.0 / 512.0, sdf_trunc=0.04, color_type=o3d.pipelines.integration.TSDFVolumeColorType.RGB8)

for i in range(len(camera_poses)): print("Integrate {:d}-th image into the volume.".format(i)) color = o3d.io.read_image("../../test_data/RGBD/color/{:05d}.jpg".format(i)) depth = o3d.io.read_image("../../test_data/RGBD/depth/{:05d}.png".format(i)) rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth( color, depth, depth_trunc=4.0, convert_rgb_to_intensity=False) volume.integrate( rgbd, o3d.camera.PinholeCameraIntrinsic( o3d.camera.PinholeCameraIntrinsicParameters.PrimeSenseDefault), camera_extrinsic parameter)

Erol444 commented 4 months ago

Hi @SahilJain8 , we apologize for the delay. You can get camera extrinsics by reading calibration, example here: https://docs.luxonis.com/projects/api/en/latest/samples/calibration/calibration_reader/#calibration-reader