Gazebo garden : Plugin for FOV distortion model
Hi! I see that gazebo garden is using the Brown Conrady radian distortion model. For my research however, I would need to use the FOV distortion model from "Devernay, F., Faugeras, O. Straight lines have to be straight. Machine Vision and Applications 13, 14–24 (2001). https://doi.org/10.1007/PL00013269".
How would I go about doing that? The implementation location seems fairly straightforward in gazebo-classic but I can't find it in gazebo garden's ImageBrownDistortionModel.cc and BrownDistortionModel.cc.
Help on how to implement this would be much appreciated!
Asked by tanguy on 2023-08-02 17:57:40 UTC
Answers
I only gave it a quick look, but at first sight it seems that you will have to:
- Create an ImageFOVDistortionModel.cc similar to ImageBrownDistortionModel.cc,
- Adapt DistortionFactory::NewDistortionModel() to support also your new FOV distortion model,
- Adapt CameraSensor.cc to support also your new distortion model.
EDIT:
Step 2. is rather "Adapt ImageDistortionFactory::NewDistortionModel()" instead.
This remark suggests that you could also define it as a 'custom' distortion model, but I find no references to SetCustomDistortionCallback
anywhere in the code, so I think this has not been implemented...
EDIT 2:
This issue #107 and pull request #192 suggest that changes to gz-rendering
might also be required. This is the corresponding gz-rendering
pull request: #502. E.g. the current implementation has 'radial' and 'tangential distortion coefficients' but maybe your FOV model needs others?
Asked by jrtg on 2023-08-03 03:48:56 UTC
Comments
Thank you for your answer! Will try this out and let you know how it goes :)
Asked by tanguy on 2023-08-08 09:35:17 UTC
Comments