Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accessing both intrinsics and extrinsics for a capture #2944

Closed
monajalal opened this issue Dec 4, 2023 · 1 comment
Closed

accessing both intrinsics and extrinsics for a capture #2944

monajalal opened this issue Dec 4, 2023 · 1 comment
Labels

Comments

@monajalal
Copy link

monajalal commented Dec 4, 2023

For a piece of code I need access to all these items. I want to know if the followings sound correct and how to access camera intrinsics using ros realsense topics?

The code is: https://github.com/PyramidHe/PVNet/blob/master/3dome_data_generator/mask_gen.py

and in the method read_camera_configuration it needs extrinsics, intrinsics, and distortion.

  • camera extrinsics --> not sure how to acquire this from ros-realsense?
  • camera intrinsics --> I believe this is intrinsics?? K: [616.056884765625, 0.0, 321.5348815917969, 0.0, 616.2793579101562, 235.87950134277344, 0.0, 0.0, 1.0]
  • camera distortion --> D: [0.0, 0.0, 0.0, 0.0, 0.0]

^^ is this camera extrinsics? or am I getting it from the wrong topic?

rotation: [0.9999707341194153, 0.002675577299669385, -0.007163900416344404, -0.0026810914278030396, 0.9999961256980896, -0.0007602194091305137, 0.0071618384681642056, 0.0007794042467139661, 0.9999740719795227]
translation: [0.014838425442576408, 7.110021397238597e-05, 0.00028845336055383086]

Screenshot from 2023-12-04 09-09-46

I get these:

root@186eb653e767:/workspace# rostopic echo /camera/color/camera_info 
header: 
  seq: 308
  stamp: 
    secs: 1701698575
    nsecs: 864586115
  frame_id: "camera_color_optical_frame"
height: 480
width: 640
distortion_model: "plumb_bob"
D: [0.0, 0.0, 0.0, 0.0, 0.0]
K: [616.056884765625, 0.0, 321.5348815917969, 0.0, 616.2793579101562, 235.87950134277344, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [616.056884765625, 0.0, 321.5348815917969, 0.0, 0.0, 616.2793579101562, 235.87950134277344, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 0
binning_y: 0
roi: 
  x_offset: 0
  y_offset: 0
  height: 0
  width: 0
  do_rectify: False
---

root@186eb653e767:/workspace# rostopic echo /camera/depth/camera_info 
header: 
  seq: 308
  stamp: 
    secs: 1701698342
    nsecs: 963487148
  frame_id: "camera_depth_optical_frame"
height: 480
width: 640
distortion_model: "plumb_bob"
D: [0.0, 0.0, 0.0, 0.0, 0.0]
K: [385.240478515625, 0.0, 319.2182922363281, 0.0, 385.240478515625, 236.77352905273438, 0.0, 0.0, 1.0]
R: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
P: [385.240478515625, 0.0, 319.2182922363281, 0.0, 0.0, 385.240478515625, 236.77352905273438, 0.0, 0.0, 0.0, 1.0, 0.0]
binning_x: 0
binning_y: 0
roi: 
  x_offset: 0
  y_offset: 0
  height: 0
  width: 0
  do_rectify: False
---

I also have access to this topic but I am not sure if it is fully related to what I need:

root@186eb653e767:/workspace# rostopic echo /camera/extrinsics/depth_to_color
header: 
  seq: 0
  stamp: 
    secs: 0
    nsecs:         0
  frame_id: "depth_to_color_extrinsics"
rotation: [0.9999707341194153, 0.002675577299669385, -0.007163900416344404, -0.0026810914278030396, 0.9999961256980896, -0.0007602194091305137, 0.0071618384681642056, 0.0007794042467139661, 0.9999740719795227]
translation: [0.014838425442576408, 7.110021397238597e-05, 0.00028845336055383086]
---

@MartyG-RealSense
Copy link
Collaborator

Hi @monajalal As you described above, you can list intrinsics from the camera_info topics (camera/depth/camera_info and /camera/color/camera_info) and extrinsics from /extrinsics/color_to_depth

For the D415 and D435-type camera models, all of the distortion parameters are set to zero, as described at IntelRealSense/librealsense#1430 (comment)

On some of the other RealSense models such as D455, the color stream's distortion coefficients are non-zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants