Bad zero disparities in StereoBM (Bug #395)
Description
One of our users had problems using stereo_image_proc with min_disparity set to some positive value - the point cloud produced would intermittently include all the points filtered during stereo correspondence.
It looks like findStereoCorrespondenceBM_SSE2 will sometimes incorrectly assign a zero disparity. With positive min_disparity, this gets interpreted by reprojectImageTo3D as the bad value, and disparities set to FILTERED are kept. I found a simple tweak to stereobm.cpp that seems to fix the problem:
493c493 < if( 0 < mind && mind < ndisp - 1 ) --- > if( 0 < mind && mind < ndisp )
All the bad points had mind == ndisp - 1
. But I don't know the code well enough to be sure that's correct. Vadim can you look at this? Thanks.
Associated revisions
fixed the output disparity at the extreme cases (minDisparity or minDisparity + numOfDisp - 1). Thanks to Patrick Mihelich for the report (trac #395)
Merge pull request #395 from LeonidBeynenson:fix_ml_large_data_bug__2.4
History
Updated by Vadim Pisarevsky over 14 years ago
The problem is fixed in r3271
- Status changed from Open to Done
- (deleted custom field) set to fixed