-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
Fix wrong clamping of pixels for fisheye::undistortPoints #27199
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
base: 4.x
Are you sure you want to change the base?
Conversation
Test failures:
Most probably regression data update is required. |
@asmorkalov thanks for the feedback. I'll take a look |
@asmorkalov The test case: opencv/modules/calib3d/test/test_fisheye.cpp Line 1153 in 09a85e9
is degenerate. The intrinsics + image shape do not produce a valid (reversible) fisheye projection. ![]() There are pixels which are mapped beyond 180 degree FOV, which is currently unsupported. I will adjust it accordingly later this week. |
@asmorkalov Also one more note I also want to make. Currently 'invalid' pixels are mapped to [-1000000.0, -1000000.0]]. Since there are also valid pixels that can get mapped to that. Why does one not switch to Nan? opencv/modules/calib3d/src/fisheye.cpp Lines 501 to 502 in 09a85e9
|
I do not know unfortunately. Feel free propose alternative alternative solution with nans. |
Looks like you need too tune related java test in modules/calib3d/misc/java/test/Calib3dTest.java too. (see the last test case in the file). |
I think there are some more issues with fisheye in general. I am currently also taking a deeper look but it might take some time. |
Update: fisheyeTest.CalibrationWithDifferentPointsNumber fails because of 1) numerical instability and/or 2) because we produce invalid points at the beginning (points with FOV > 180). Also we have some issues with calibration (because the old + wrong version rarely produces invalid points). I am not 100% sure how this could be fixed. Currently invalid points will be mapped to -> -10000,-10000
tldr: we should check how points with >180 deg can be handled for undistortPoints (because gradients are used in calibration) and then adjust the calibration accordingly. |
|
Pull Request Readiness Checklist
Fixes: #26174
Feel free to adjust if required.
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.