-
Notifications
You must be signed in to change notification settings - Fork 5.8k
ccalib/omnidir undistortPoints result differs from undistortImage. #1612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To conclude, if anyone with better understanding of the model can clarify the note I made in 3) or any other remark concerning fisheye calibration with the omnidir module, it would be great! @ftaralle here is the working version of your code with xi=1 . Maybe you can update K,D based on the calibration data
|
Hi @whplh. Thanks for your helping comment. Using Thus, I investigated more closely Line 327, undistorted projection point is projected from Unit-Sphere to Unit-Plan (Z=1): Vec3d ppu = Vec3d(
Xs[0]/(Xs[2]+_xi),
Xs[1]/(Xs[2]+_xi),
1.0
); I wonder why Vec3d ppu = Vec3d(
Xs[0]/Xs[2],
Xs[1]/Xs[2],
1.0 // <= Xs[2]/Xs[2]
); I tested with this modified omnidir code. It seems to work fine now: no more discrepency between image back-projection and points back-projection. So, is this a bug in omnidir or a misunderstanding of me ? |
Well it would be helpful to understand why your version works. It would be the same as xi=0. Bear in mind that according to the unified projection model you are not exactly just projecting from a sphere to a plane. During the projection from the sphere to the plane there is a shift of the reference frame (See Mei's paper). Your suggestion would omit this shift, which doesn't quite fit to the given model. |
Hi, |
I had a problem. System information (version) Detailed description |
The relevant bug was reported in opencv#1612 The _xi was erroneously applied at points re-projection to camera plane. _xi parameter was already taken in use while projection of points to unit sphere.
@ftaralle the fix now in master. Do you think you need to try it before closing PR? |
Hi, i am looking for a function to convert back a point in undistorted image back to the original distorted points. I know a function for fisheye camera like cv.fisheye.distortPoints, But i cannot find one for omnicamera. Please anyone here know the function? |
I have thoroughly examined the omnidir source code and the documentation corresponding to the |
System information (version)
Detailed description
We are using omnidir module to correct wide angle fisheye effect on image data.
We first used cv::omnidir::calibrate to get a valid camera model.
We then used this model to undistort both images and points.
We found that applying undistortion methods with exact same parameters on images and points gives different results.
After investigation we think a bug exists in the undistortPoints method.
Steps to reproduce
Code to reproduce (fixed to be working, thanks to @whplh).
The text was updated successfully, but these errors were encountered: