-
Notifications
You must be signed in to change notification settings - Fork 606
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
Add Fisheye model and Rename model class #306
Conversation
PinholeCameraModel is misleading now that fisheye model (KB) was introduced. Hence, rename the class and file to a more general name. The class CameraModel does use the distortion model specified in the camera_info, including pinhole, fisheye and rationa_polynomial
@DavidTorresOcana Thanks for the contribution for supporting fisheye camera! |
Thank you for your comment. I do not see where Pinhole model class would be used in the official stack but I added it back and a deprecated attribute to it. See f683d0a |
All references to That also removes the dependency on ros/common_msgs#151. |
Should this be ok? I tested this with ros-perception/image_pipeline#441 and works ok. Would be nice to merge into noetic and ROS2 too |
e14a464
to
e001749
Compare
Disclaimer: I'm not a maintainer of this repo, so my comments here are just my own personal opinion. First off, thanks for this PR! There are many incomplete PRs that attempt to implement the fisheye model (e.g., Intermodalics#1, #184, #299), and this one seems to be the best so far. I'm currently in the process of reducing this PR to its essentials and testing it. Some comments:
|
Ok, I've dug a bit deeper. I think it's crucial to differentiate between the camera model and the distortion model. For instance, this kalibr wiki page lists the camera and distortion models supported by kalibr (note: "radial-tangential (radtan)" = plumb_bob). The current CameraInfo message only supports the pinhole model, and only allows to change the distortion model. Therefore, what this PR should attempt to do is only adding the Next, I think the changes to the project3dToPixel function in this PR should be undone. That function should not take the distortion model into account at all; it's part of the camera model (here: pinhole). Here's the documentation: vision_opencv/image_geometry/include/image_geometry/pinhole_camera_model.h Lines 89 to 97 in 0a908b0
The important point is that the function should project the point to rectified pixel coordinates. I believe cv::fisheye::projectPoints also unrectifies the points, so it shouldn't be used here. I believe to fully implement a new distortion model, the following functions (and only those) should be modified: rectifyPoint, rectifyImage, unrectifyPoint, unrectifyImage. The last one is not implemented, so that leaves the first three. Here's an overview of the PRs that I could find that implement the
(1) implemented by modifying initRectificationMaps (2) Intermodalics#1 not only implements the The table above shows why I think this PR is still the most complete. I think I'll send a simplified PR once I'm done testing. Not that I have a lot of hopes that any PRs in this repo will be merged any time soon... :) |
Closing since #358 was finally merged |
This PR is motivated by ros-perception/image_pipeline#441
Introduces: