webots
webots copied to clipboard
Vertical effect in spherical camera image
A user asked for vertical effect in spherical image because currently only horizontal effect is applied:
It seems correct to also expect a vertical spherical effect. So we should maybe evaluate:
- if it is interesting to add a vertical effect
- if
spherical
is the best description for the image effect or if we could choose a better name (for exampleequirectangular
orcylindric
projection instead ofspherical
projection)
Fix this problem would help also Robocup competitors: see https://hl.forum.robocup.org/t/modeling-wideangle-lenses-in-webots/495
It seems this issue is not resolved, see https://hl.forum.robocup.org/t/modeling-wideangle-lenses-in-webots/495/7
Related to #3068
To get both vertical and horizontal effect we should use the stereographic projection instead of the equirectangular projection (currently implemented).
I'm not sure if this issue is still being worked on, or if there is some finished implementation on the develop already, but in case not, I made my own version of the shader which makes a distortion in both directions, but I'm currently not sure, if it is correctly scaled. (I used a reference implementation as basis and have to recheck the math).
Also it seems that replacing the merge_spherical shader is not trivial, as it is also used for the LIDAR projections. Therefore different handling of equirectangular and fisheye projections would be needed.
If you are interested in this fisheye shader, I can share it with you.
Thank you @TheMangalex. It looks very promizing. Could you please open a new PR with your contribution? It should target the develop branch. We will review it in depth in order to merge it in the develop branch as soon as possible.
Fixed in #5240 and #5266.