Skip to content

ccalib: add k3 radial distortion support for omnidir model#4077

Draft
nechami795 wants to merge 10 commits intoopencv:4.xfrom
nechami795:omnidir-k3
Draft

ccalib: add k3 radial distortion support for omnidir model#4077
nechami795 wants to merge 10 commits intoopencv:4.xfrom
nechami795:omnidir-k3

Conversation

@nechami795
Copy link

Summary

Add support for an additional radial distortion coefficient (k3) to the omnidirectional camera model in ccalib.

Details

  • Extend omnidir distortion model to accept both 4- and 5-parameter distortion vectors.
  • Ensure full backward compatibility when k3 = 0.
  • Update projectPoints, undistortPoints, and initUndistortRectifyMap to handle k3.
  • Add comprehensive unit tests covering:
    • backward compatibility
    • functional impact of k3
    • calibration quality improvement when true k3 ≠ 0

Tests

  • Added new tests under modules/ccalib/test validating:
    • identical behavior for 4 coeffs vs 5 coeffs with k3 = 0
    • measurable change when k3 is non-zero
    • lower reprojection RMS when calibrating with 5 parameters on synthetic data

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@asmorkalov
Copy link
Contributor

The tests you added are very soft and check mostly nothing. Please enhance the tests with real coordinates / distortion coefficients check.

@nechami795
Copy link
Author

The tests you added are very soft and check mostly nothing. Please enhance the tests with real coordinates / distortion coefficients check.

Thank you for the comment.
I've run full process with real coordinates, but I did that from a separate standalone .cpp, not from tests.
Right now I am improving the code, will make additional test later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants