feat(autoware_image_distortion): correct camera image distortion#337
feat(autoware_image_distortion): correct camera image distortion#337sakunaka39 wants to merge 5 commits intoautowarefoundation:mainfrom
Conversation
Signed-off-by: sakunaka39 <shotaro.nakamura@tier4.jp>
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Signed-off-by: sakunaka39 <shotaro.nakamura@tier4.jp>
Signed-off-by: sakunaka39 <shotaro.nakamura@tier4.jp>
There was a problem hiding this comment.
@sakunaka39
Thank you for your contribution!
I left some comments that I noticed. I'd appreciate if if you could consider them.
Besides, from the perspective of the node behavior, I think autoware_image_"un"distortion is a more appropriate name for the node because this node performs undistortion (getting rid of lens distortion). Considering this point would also be appreciated!
| <arg name="sensor_model" default="aip_x2_gen2" description="sensor model name (e.g. aip_x2_gen2)"/> | ||
|
|
||
| <arg name="transport_type" default="compressed"/> | ||
| <arg name="interpolation_method" default="1"/> |
There was a problem hiding this comment.
Would it be possible to add description for the interpolation_method argument, like other launch files?
Judging from the PR description, I guess this file will be the entry point, which users mainly execute. If that is the case, the description would be helpful.
| sensor_msgs::msg::Image::SharedPtr out_img_msg = | ||
| cv_bridge::CvImage(image_msg->header, "bgr8", rect_image).toImageMsg(); | ||
|
|
||
| pub_rect_.publish(out_img_msg, info_msg); |
There was a problem hiding this comment.
| pub_rect_.publish(out_img_msg, info_msg); | |
| auto out_info_msg = sensor_msgs::build<sensor_msgs::msg::CameraInfo>() | |
| .header(info_msg->header) | |
| .height(model_.rectifiedRoi()height) | |
| .width(model_.rectifiedRoi()width) | |
| .distortion_model(model_.cameraInfo().distortion_model) | |
| .d(sensor_msg::msg::CameraInfo::_d_type(model_.cameraInfo().d.size(), 0.)) // zero distortion | |
| .k(model_.intrinsicMatrix()) | |
| .r(model_.rotationMatrix()) | |
| .p(model_.projectionMatrix()) | |
| .binning_x(model_.binningX()) | |
| .binning_y(model_.binningY()) | |
| .roi(model_.rectifiedRoi()); | |
| pub_rect_.publish(out_img_msg, out_info_msg); |
I think publishing the input camera info here is not appropriate, otherwise there will be two publishers that publish the same topic.
Besides, strictly speaking, camera info for the undistorted image would be slightly different from the original one.
My suggestion reflects this point. Since I haven't tested if it can be built, I would appreciate it if you test it in case you adopt it!
Description
This PR introduces a new package
autoware_image_distortionto rectify distorted images from cameras. This package subscribes to raw or compressed images and camera info, performs rectification usingimage_geometry, and publishes the rectified images.Changes
autoware_image_distortionpackage.ImageDistortionnode to rectify images usingimage_geometry::PinholeCameraModel.aip_x2_gen2).rawandcompressedimage transport.Results
Before (Distorted)
After (Rectified)
How was this PR tested?
ros2 launch autoware_image_distortion distortion.launch.xml sensor_model:=sample_sensor_kit/sensing/camera/camera*/image_rect.