Spherical remapping of fisheye

asked 2018-03-06 12:22:00 -0500

kulkx321 gravatar image

updated 2018-03-21 10:39:37 -0500

Hey guys,

after days and days of headaches trying to understand how the fisheye in OpenCV works, I finally gave up. The documentation is so poor and of bad quality and that's too bad... So you're my only hope to try answering some questions that have been bothering me.

My problem consists in remapping a fisheye image to a new one with (θ, φ) along its axes, according to a spherical model and respecting the distortion (the camera is placed at the center of the sphere). I've been trying so many methodes to achieve it but still can't, everytime something doesn't work. Something so simple should be done easily, apparently not with OpenCV...

Before asking you my questions I would like to read the source code for the fisheye module especially for how the projectPoints() function is programmed because the "detailed" description here is simply not the same as used in projectPoints...

I tried searching the files but I have no idea where to look for it.

Thanks in advance.

edit retag flag offensive close merge delete


do you want to undistort an iimage from a fisheye camera ? or an image that went through some "artificial" fisheye projection (like from some hugin plugin) ?

berak gravatar imageberak ( 2018-03-07 11:28:13 -0500 )edit

I don't need to undistort at all. What I want is very simple.

I take a picture with my 360° camera and then I want a function that takes 2 arguments (azimuth and elevation) and projects them on my image. Simple 2D stuff. No need to use any 3D algorithms like in OpenCV.

Here's a picture to understand.

Then I would like to be able to do the inverse which is give x and y pixels and get my corresponding azimuth/elevation. I could do a linear interpolation if it's complicated.

kulkx321 gravatar imagekulkx321 ( 2018-03-21 10:21:16 -0500 )edit