pyorbbecsdk icon indicating copy to clipboard operation
pyorbbecsdk copied to clipboard

(Regression) Camera Parameters All Zeros in v2 SDK

Open KySmith1 opened this issue 1 year ago • 4 comments

PyOrbbec SDK Version: 2.0.6 (Latest as of time of writing) OrbbecSDK Version: 2.1.1(Latest as of time of writing) Camera: Femto Bolt Camera FW Version: Both 1.1.2 (Latest as of time of writing) and 1.0.9 (The latest documented supported firmware)

Platform: Ubuntu 22.04 (Docker) running on Ubuntu 24.04 (Host)

When attempting to get the camera parameters (intrinsics), the return values for pipeline.get_camera_param() as seen in Orbbec's example here are all zeros:

Screenshot from 2024-12-24 15-49-26

This blocks our implementation of the v2 SDK in Python. Is there an undocumented new method for getting camera parameters?

More info: The Orbbec SDK via Orbbec Viewer appears to get intrinsics without an issue as seen below:

Screenshot from 2024-12-24 15-54-06

KySmith1 avatar Dec 24 '24 23:12 KySmith1

same here, did you figure it out?

TIMESTICKING avatar Feb 15 '25 01:02 TIMESTICKING

seems like in their example "save_pointcloud_by_o3d.py", the function works well

TIMESTICKING avatar Feb 15 '25 01:02 TIMESTICKING

This is the same issue as the one in the following link: https://github.com/orbbec/pyorbbecsdk/issues/56

Has anyone found a solution to this?

importnumpy avatar Mar 16 '25 10:03 importnumpy

@KySmith1 @TIMESTICKING @importnumpy The issue is that the Femto series does not support hardware D2C, and you have to switch to software D2C. Try using the code as follows:

config = Config()
config.set_align_mode(OBAlignMode.SW_MODE) # using software D2C
# pipeline.enable_frame_sync() # optional but suggest
pipeline.start(config)

YipKo avatar Apr 01 '25 06:04 YipKo

When using the v2-main branch, the recommended way to obtain intrinsic and extrinsic parameters is from the stream profile. You can refer to the sample coordinate_transform.py.

   color_frame = color_frame.as_video_frame()
   depth_frame = depth_frame.as_video_frame()

   color_profile = color_frame.get_stream_profile()
   depth_profile = depth_frame.get_stream_profile()
   print("video profile:", color_profile.as_video_stream_profile())
   color_intrinsics = color_profile.as_video_stream_profile().get_intrinsic()
   color_distortion = color_profile.as_video_stream_profile().get_distortion()
   depth_intrinsics = depth_profile.as_video_stream_profile().get_intrinsic()
   depth_distortion = depth_profile.as_video_stream_profile().get_distortion()

   extrinsic = depth_profile.get_extrinsic_to(color_profile)

zhonghong322 avatar May 22 '25 10:05 zhonghong322

In my case it had to do with at which point you are taking the reading in the script, because Python is interpreted each line plays a key role in adding context to the Pipeline class. A simple for loop placed after starting the stream solved the zeroing error for me: global stop_rendering start_streams(pipelines, configs) for i in range(len(pipelines)): camera_param = pipelines[i].get_camera_param() print(f"This is the color parameters of device {i}:\n {camera_param.rgb_intrinsic}") print(f"This is the depth parameters of device {i}:\n {camera_param.depth_intrinsic}")

Let me know if this doesn't fix the issue for you.

JohnSalvi avatar Aug 15 '25 23:08 JohnSalvi