fisheye image to equirectangular

asked 2015-12-15 19:17:14 -0600

arpu gravatar image

Hello

for stitching images i want transform a fisheye image to a equirectangular image like nona (hugin) in hugin i can do this

my fisheye has 80 degree HFov

pto_gen --fov=80 -p 2 test22_r.jpeg

http://lpaste.net/147153 hugin pro file

nona -o test22_r_equirectangular.jpg test22_r.pto

is this possible with opencv ? i look at detail::SphericalWarper but no idea how i can set the destination matrix for equirectangular

here is the input and output http://snag.gy/bmE15.jpg http://snag.gy/RLaSI.jpg

edit retag flag offensive close merge delete

Comments

Forget the SphericalWarper. There are OpenCV functions for this in the Calib3D module.

Check this!

:)

kbarni gravatar imagekbarni ( 2015-12-16 10:18:00 -0600 )edit

Hello i think this does not help me because the output image is not an undisort image https://github.com/Itseez/opencv/blob...

arpu gravatar imagearpu ( 2015-12-16 10:44:08 -0600 )edit

Yes, it is an undisorted image. Did you try it???

Check this description: http://ninghang.blogspot.fr/2012/08/f...

And an image

kbarni gravatar imagekbarni ( 2015-12-16 11:46:44 -0600 )edit

Hallo

calib3d camera calibration i get this undisort image after calibration input http://snag.gy/9W9gj.jpg out http://snag.gy/7YB4Z.jpg

arpu gravatar imagearpu ( 2015-12-17 06:50:07 -0600 )edit

You are probably using wrong parameters. To correct barrel distortion, k1,k2, k3 should be positive.

kbarni gravatar imagekbarni ( 2015-12-17 08:42:21 -0600 )edit

i think it have nothing to do because the output image should be equirectangular not?

arpu gravatar imagearpu ( 2015-12-17 09:01:34 -0600 )edit

http://lpaste.net/1929295611396358144 this is the calibration file from calib3d

arpu gravatar imagearpu ( 2015-12-17 09:02:38 -0600 )edit

here is the code i use to test http://lpaste.net/147286

arpu gravatar imagearpu ( 2015-12-17 11:21:39 -0600 )edit

I have some problem with the code, it always crashes my computer and I have no idea why (total blackout) so sorry, but I can't test it.

Anyway, I still think the problem is with the distortion coefficients. Please note, that the calibrateCamera gives distCoeffs={k1,k2,p1,p2,k3}, but the fisheye::undistort functions need the coefficients D={k1,k2,k3,k4}, which are not the same!!!

kbarni gravatar imagekbarni ( 2015-12-18 05:11:07 -0600 )edit

any idea how i can calculate the coefficients D for the fisheye::undistort?

arpu gravatar imagearpu ( 2015-12-18 05:21:00 -0600 )edit