You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Users noticed that StereoSGBM would occasionally give non-deterministic results for .compute(imgL, imgR).
I and others traced the cause to out-of-bounds access that was not being caught when the input images were not wide enough for the input block size and number of disparities to StereoSGBM. The specific math and logic can be found in the above issue's discussion.
This PR adds a CV_Check to make sure images are wider than 1/2 of the block size + the max disparity the algorithm will search.
The check was only added to the regular compute method for StereoSGBM and not to the other modes, as I did not observe the non-deterministic behavior with the other compute modes like HH.
In addition, this PR adds a test case to Calib3d to make sure the check is being thrown in the problem case and that the results are deterministic in the good case.
I see in the build failure that test_videoio failed for precommit_linux64_no_opt. However, when I click "test summary" for test_videoio, I see:
Total tests: 216
Tests failed: 0
Tests passed: 216
Exception has been thrown. Please see stdio log.
In the stdio log, the exceptions I see are related to not being able to open files or devices, e.g.:
[ WARN:0@0.034] global cap.cpp:177 open VIDEOIO(OPENNI2): raised OpenCV exception:
OpenCV(4.12.0-dev) /build/precommit_linux64_no_opt/4.x/opencv/modules/videoio/src/cap_openni2.cpp:275: error: (-2:Unspecified error) in function 'CvCapture_OpenNI2'
> OpenCVKinect2: Failed to open device: DeviceOpen: Couldn't open device '/build/precommit_linux64_no_opt/4.x/opencv_extra/testdata/highgui/audio/test_audio.mp4'
This appears to be unrelated to my changes, which are only within calib3d.
The non-default failing checks from the previous run are:
Ubuntu2004-x64-CUDA / BuildAndTest: Merge opencv with add-check-sgbm-nondeterminism branch
Run cd /home/ci/opencv
fatal: unable to access 'https://github.com/chengolivia/opencv/': gnutls_handshake() failed: The TLS connection was non-properly terminated.
Error: Process completed with exit code 1.
Windows10-x64 / BuildAndTest: Accuracy:core
I do not see any tests failing in the job, but it is stuck on:
[ RUN ] Core_SubMixed/ArithmMixedTest.accuracy/0, where GetParam() = (16-byte object <20-93 2A-6A 02-02 00-00 70-34 2D-6A 02-02 00-00>, (CV_8U, CV_16U), 1)
Windows10-x64-Vulkan / BuildAndTest: Accuracy:dnn
I also do not see any tests failing in the job, but it is stuck on:
[ RUN ] Test_Model.Detection_normalized/0, where GetParam() = VKCOM/VULKAN
macOS-AARM64-Vulkan / BuildAndTest
[==========] 7770 tests from 90 test cases ran. (137910 ms total)
[ PASSED ] 7769 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] Test_Darknet_nets.YOLOv4x_mish/0, where GetParam() = VKCOM/VULKAN
None of these failures seem to be related to my change in StereoSGBM in calib3d.
@asmorkalov Would you be able to restart the failing jobs or approve the PR despite them? This is my first contribution, so apologies if I missed something.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #25828
Users noticed that StereoSGBM would occasionally give non-deterministic results for
.compute(imgL, imgR)
.I and others traced the cause to out-of-bounds access that was not being caught when the input images were not wide enough for the input block size and number of disparities to StereoSGBM. The specific math and logic can be found in the above issue's discussion.
This PR adds a CV_Check to make sure images are wider than 1/2 of the block size + the max disparity the algorithm will search.
The check was only added to the regular
compute
method for StereoSGBM and not to the other modes, as I did not observe the non-deterministic behavior with the other compute modes like HH.In addition, this PR adds a test case to Calib3d to make sure the check is being thrown in the problem case and that the results are deterministic in the good case.
Pull Request Readiness Checklist
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.