webots icon indicating copy to clipboard operation
webots copied to clipboard

Vertical effect in spherical camera image

Open stefaniapedrazzi opened this issue 4 years ago • 6 comments

A user asked for vertical effect in spherical image because currently only horizontal effect is applied:

horizontal_effect vertical_effect

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 example equirectangular or cylindric projection instead of spherical projection)

stefaniapedrazzi avatar Oct 05 '20 14:10 stefaniapedrazzi

Fix this problem would help also Robocup competitors: see https://hl.forum.robocup.org/t/modeling-wideangle-lenses-in-webots/495

omichel avatar Apr 01 '21 09:04 omichel

It seems this issue is not resolved, see https://hl.forum.robocup.org/t/modeling-wideangle-lenses-in-webots/495/7

omichel avatar May 28 '21 09:05 omichel

Related to #3068

stefaniapedrazzi avatar May 31 '21 06:05 stefaniapedrazzi

To get both vertical and horizontal effect we should use the stereographic projection instead of the equirectangular projection (currently implemented).

stefaniapedrazzi avatar Jun 07 '21 06:06 stefaniapedrazzi

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). image

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.

TheMangalex avatar Sep 16 '22 14:09 TheMangalex

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.

omichel avatar Sep 16 '22 15:09 omichel

Fixed in #5240 and #5266.

stefaniapedrazzi avatar Oct 25 '22 07:10 stefaniapedrazzi