Skip to content

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

Open
nechami795 wants to merge 15 commits intoopencv:4.xfrom
nechami795:omnidir-k3
Open

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

Conversation

@nechami795
Copy link
Copy Markdown

@nechami795 nechami795 commented Feb 8, 2026

Summary

Add k3 support to the omnidirectional distortion model in ccalib.

Related issue
Fixes #3952

Details

  • Support both 4- and 5-parameter distortion vectors in omnidir APIs.
  • Preserve backward compatibility when k3 = 0.
  • Update the relevant mono and stereo omnidir code paths to support k3.

Tests

  • Added real-data and synthetic tests for mono and stereo omnidir calibration.
  • Added backward-compatibility tests verifying equivalence between the legacy 4-parameter model and the 5-parameter model with k3 = 0.
  • Added real-data sanity tests for the 5-parameter model and golden-regression tests for the legacy 4-parameter model.
  • Added synthetic tests showing that enabling free k3 improves reprojection fit and recovers non-zero k3 when present in the ground truth.
  • Added validation for undistortion, rectification, and map generation, including k3 = 0 equivalence checks.

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
Copy Markdown
Contributor

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

Comment thread modules/ccalib/src/omnidir.cpp Outdated
Comment thread modules/ccalib/src/omnidir.cpp Outdated
Comment thread modules/ccalib/src/omnidir.cpp Outdated
Comment thread modules/ccalib/src/omnidir.cpp Outdated
Comment thread modules/ccalib/src/omnidir.cpp Outdated
Comment thread modules/ccalib/src/omnidir.cpp Outdated
Comment thread modules/ccalib/src/omnidir.cpp Outdated
Comment thread modules/ccalib/src/omnidir.cpp
Comment thread modules/ccalib/src/omnidir.cpp
Comment thread modules/ccalib/src/omnidir.cpp
Comment thread modules/ccalib/include/opencv2/ccalib/omnidir.hpp Outdated
@nechami795
Copy link
Copy Markdown
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.

Comment thread modules/ccalib/test/test_omnidir_k3.cpp
Comment thread modules/ccalib/test/test_omnidir_k3.cpp Outdated
Comment thread modules/ccalib/test/test_omnidir_k3.cpp Outdated
Comment thread modules/ccalib/test/test_omnidir_k3.cpp Outdated
Comment thread modules/ccalib/test/test_omnidir_k3.cpp Outdated
Comment thread modules/ccalib/include/opencv2/ccalib/omnidir.hpp
@nechami795 nechami795 marked this pull request as ready for review March 9, 2026 14:05
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.

Add k3 support for onmidir

3 participants