Possible bug in modules/calib3d/test/test_stereomatching.cpp?
Using an experimental new analysis technique, we (GrammaTech) identified what appears to be a bug in CV_StereoMatchingTest::processStereoMatchingResults, in modules/calib3d/test/test_stereomatching.cpp:
// get masks for unknown ground truth disparity values
Mat leftUnknMask, rightUnknMask;
DatasetParams params = datasetsParams[caseDatasets[caseIdx]];
absdiff( trueLeftDisp, Scalar(params.dispUnknVal), leftUnknMask );
leftUnknMask = leftUnknMask < numeric_limits<float>::epsilon();
assert(leftUnknMask.type() == CV_8UC1);
if( !trueRightDisp.empty() )
{
absdiff( trueRightDisp, Scalar(params.dispUnknVal), rightUnknMask );
rightUnknMask = rightUnknMask < numeric_limits<float>::epsilon();
assert(leftUnknMask.type() == CV_8UC1); // HERE! should be rightUnknMask?
}
The block in the "if" appears to be a copy of the block immediately before that "if", with "left" changed to "right", except on the line with the HERE! comment. Logically, it seems like this line should be applying the same test to rightUnknMask that the earlier line applied to leftUnknMask, rather than testing left again. Can someone knowledgeable take a look?
@MysteriousBugOracle will you submit a patch?
We don't actually use this code, so we're not in a position to create or test a fix. We just run our static analysis to detect problems. I can submit a bug through your bug system, or you could just make the one-line fix yourself without an official bug.
OK. i will submit a patch. thank you.