Ask Your Question

Revision history [back]

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?