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

First try with the values from your calibration file: D={-0.3874,0.0953,-0.0121,0}.

If the values are still off, try D={K1,0,0,0} and give different values to K1 (eventually using a slider). This is the strongest correction coefficient, and it should give you good correction.

kbarni gravatar imagekbarni ( 2015-12-18 07:46:58 -0600 )edit

[611, 0, 611; 0, 611, 611; 0, 0, 1]

[3; 0; 0; 0] http://pasteboard.co/aPt3qps.png the output does not look like equirectangular, i used differnet D params to test :/

arpu gravatar imagearpu ( 2015-12-20 06:39:32 -0600 )edit