tu-darmstadt-ros-pkg / image_projection

image_projection is a ROS package to create various projections from multiple calibrated cameras.
MIT License
174 stars 34 forks source link

Pinhole for 2 monocular cameras IP #8

Open rmunoz6323 opened 2 years ago

rmunoz6323 commented 2 years ago

Hi, I need help to solve a issue with pinhole projection. I am using image_projection package to create pinhole projection from two calibrated cameras, I do not know much about them, simply that they are monocular cameras IP.

I set up my own projection in this way: 1.- I calibrated the two monocular cameras IP. 2.- I developed a driver (from http://wiki.ros.org/video_stream_opencv) to launch the two cameras. 3.- The calibration files (.yaml) were loaded by the driver, and it seems to work correctly. One example of calibration file is below: image_width: 1280 image_height: 720 camera_name: cameraProbot_front camera_matrix: rows: 3 cols: 3 data: [783.72954, 0. , 616.94934,

  1. , 776.53814, 418.06712,
  2. , 0. , 1. ] distortion_model: plumb_bob distortion_coefficients: rows: 1 cols: 5 data: [-0.430972, 0.308801, -0.011165, -0.000338, 0.000000] rectification_matrix: rows: 3 cols: 3 data: [1., 0., 0., 0., 1., 0., 0., 0., 1.] projection_matrix: rows: 3 cols: 4 data: [711.72192, 0. , 619.78121, 0. ,
  3. , 719.64154, 414.22166, 0. ,
  4. , 0. , 1. , 0. ]

First question I have. If the cameras were fisheye, Would they need to be calibrated with Kalibr? Another doubt for me is about xacro files: now, I am using a generic template (macro) to describe my robot and I am not sure if the template selection to create .xacro could depend on the cameras model used. Would it be a error source for pinhole?

I updated topics and adapted my projections.launch. Also, I was modifying projections parameters in projections.yaml (basically “horizontal_fov” and “focal_length”) and when run projections.launch none errors appear but pinhole is shown incorrectly.

Can anybody give me any suggestion for this issue? If anybody needs further information, please let me know.

Thanks in advance. Raúl

Martin-Oehler commented 2 years ago

Hello Raúl,

First question I have. If the cameras were fisheye, Would they need to be calibrated with Kalibr?

Yes, the standard calibration packages of ROS only support pinhole. You could use other tools that implement the same projection models as Kalibr though.

Another doubt for me is about xacro files: now, I am using a generic template (macro) to describe my robot and I am not sure if the template selection to create .xacro could depend on the cameras model used. Would it be a error source for pinhole?

I do not understand your question. Your robot description (or more specifically your TF tree) needs to contain the optical frames of your cameras. The camera type or any camera parameters are not part of the URDF and would only be of concern for simulation purposes.

I updated topics and adapted my projections.launch. Also, I was modifying projections parameters in projections.yaml (basically “horizontal_fov” and “focal_length”) and when run projections.launch none errors appear but pinhole is shown incorrectly.

What does "incorrectly" mean? Can you share your camera setup (e.g. image of tf tree in rviz), projections.yaml and the result image?

Best regards, Martin

paridisankar commented 4 months ago

[Martin-Oehler] could you please share the code for the Boston Dynamics Spot 5 pinhole cameras image projection it will help for me to configure the pinhole camera thank you