This is a forwarding of my question on V-HL 2021 discord channel https://discord.com/channels/462951096374132736/727240540273508473/826726775785783317
So, which virtual camera model should we use in webots to properly emulate wide-angle lenses on robot’s camera?
In robot’s PROTO we can set “spherical” property to TRUE. Using this, I expect the camera model to be well calibrated as an real-world fisheye/wideangle lenses (i.e. with moderate radial distortion). But currently from webots camera with “spherical=true” I will get this:
This is not an image which we can model with radial distortion. It looks like an image captured from camera with cylindrical imaging surface, not spherical. With proper radial distortion I expect something like this:
As the reminder, classic radial distortion model has a form of:
Xdistorted = Xideal (1 + k1r + k2r^2 + …)
Ydistorted = Yideal (1 + k1r + k2r^2 + …)
where r is the distance of the current pixel from the center of an image (i.e. radius of a pixel)
Note that the distortion modeling coefficients k1, k2, … are same for both X and Y image axes.
But webots simulated image looks like we need to do correction on Y image axis, but we don’t need to do the correction on X axis. To take this into account, we need to implement custom distortion model, which is possible but very undesirable. Or use undistorted image from webots camera (using spherical=false), which is unrealistic if we trying to model a real-life robot with wideangle lenses.