Ask Your Question

Revision history [back]

This problem is a result of the way how the uniqueness filter is implemented. For a match to be unique in the sense of the uniqueness constraint, the cost of matching two pixels needs to be smaller by the uniqueness ratio (which is set as uniquenessRatio) than any other match.

However, due to the initialization of the minimum cost (to MAX) in stereoSGBM

` for( d = 0; d < D; d++ ) { if( Sp[d](100 - uniquenessRatio) < minS100 && std::abs(bestDisp - d) > 1 ) break; }

`

we may encounter the problem where no other matching cost is smaller by the required margin and thus the initially set disparity propagates and is eventually chosen as the winner.

Now, if we increase the block size, the individual block's cost do not differ by a lot (a block matcher basically applies some smoothing). Thus, we will more likely encounter this case, where no disparity value is significantly smaller than the others and thus the pixel is rendered far away in the scene.