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

Top View Projection #7

Open
rabayjai112 opened this issue Nov 5, 2021 · 3 comments
Open

Top View Projection #7

rabayjai112 opened this issue Nov 5, 2021 · 3 comments

Comments

@rabayjai112
Copy link

Hi @Martin-Oehler thank you for sharing

I have a question about a top view projection

My project have 3 pinhole camera and already calibrated.

I try to make a Top View Projection By use plugin PinholeProjection and this is my setting parameters

pinhole_front:
update_rate: 10
always_recompute_mapping: false
base_frame: front_camera
pose: [0, 0, 0, 0, 0, 0]
virtual_sensor_frame: pinhole_front_camera_frame
virtual_sensor_optical_frame: pinhole_front_optical_frame
projection_type: image_projection_plugins::PinholeProjection
projection_parameters:
image_width: 1280
image_height: 720
horizontal_fov: 0 # degree
focal_length: 1

Low Right view pinhole projection

pinhole_low_right:
update_rate: 10
always_recompute_mapping: false
base_frame: low_right_camera
pose: [0, 0, 0, 0, 0, 0]
virtual_sensor_frame: pinhole_low_right_camera_frame
virtual_sensor_optical_frame: pinhole_low_right_optical_frame
projection_type: image_projection_plugins::PinholeProjection
projection_parameters:
image_width: 1280
image_height: 720
horizontal_fov: 0
focal_length: 1

Low Left view pinhole projection

pinhole_low_left:
update_rate: 10
always_recompute_mapping: false
base_frame: low_left_camera
pose: [0, 0, 0, 0, 0, 0]
virtual_sensor_frame: pinhole_low_left_camera_frame
virtual_sensor_optical_frame: pinhole_low_left_optical_frame
projection_type: image_projection_plugins::PinholeProjection
projection_parameters:
image_width: 1280
image_height: 720
horizontal_fov: 0
focal_length: 1

The question is Does PinholeProjection Plugin can do Top-View projection?
If yes do i set parameters correctly?

Thanks You in advance

Kinds regards,
Chin

@Martin-Oehler
Copy link
Member

Hello, thanks for your interest in my project.

Yes, as can be seen in my paper, the pinhole projection can be used as a top view. However, your configuration looks very strange. Why are you defining three projections? You should define one projection, that is above your robot and looks downwards. Also the horizontal_view parameter should not be zero. Otherwise, you won't see anything.

I think, you are mistakenly using the projection configuration to set up your cameras. This should be done in the camera configuration files, see here for example.

@rabayjai112
Copy link
Author

Nice to meet you here. @Martin-Oehler
Yes you were right I made a mistake and a great thank for your advice.

After I make a virtual camera frame above my robot and looks downwards.
This is my setting in projection.yaml
pinhole_topview:
update_rate: 10
always_recompute_mapping: false
base_frame: top_camera
pose: [0, 0, 1, 0, 0, 0]
virtual_sensor_frame: pinhole_top_camera_frame
virtual_sensor_optical_frame: pinhole_top_optical_frame
projection_type: image_projection_plugins::PinholeProjection
projection_parameters:
image_width: 2560 #1280
image_height: 1440 #720
horizontal_fov: 90 # degree
focal_length: 10

I create a virtual camera frame 10 m. above from base_link that is why I set 10 at focal_length.

This is my setting in camera.yaml and TF of robot.
cameras:
- '/front'
- '/low_left'
- '/low_right'
/front:
image_topic: image_raw
camera_info_topic: camera_info
extended_camera_info_topic: extended_camera_info_not_used
/low_left:
image_topic: image_raw
camera_info_topic: camera_info
extended_camera_info_topic: extended_camera_info_not_used
/low_right:
image_topic: image_raw
camera_info_topic: camera_info
extended_camera_info_topic: extended_camera_info_not_used

Screenshot from 2021-11-07 16-59-34

Screenshot from 2021-11-07 16-59-51

The result show like this picture.

Screenshot from 2021-11-07 17-01-09

Picture from front camera project correctly but another 2 cameras isn't.

Do you have any idea which is the reason and how to configure this.

Thanks You in advance

Kinds regards,
Chin

@Martin-Oehler
Copy link
Member

Sorry for the late reply, I somehow missed your update.

Your configuration looks fine so far. My first guess would be, that the urdf/tf or camera calibration for your two lower cameras is wrong. Can you verify, that they are correct?

You could also play around with the projection settings in rqt_reconfigure and see, if it changes anything.

If that doesn't help, I would ask you to upload a bag file with tf, camera images and calibration so I can check it out.

Best regards,
Martin

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

No branches or pull requests

2 participants