Commit 0726c4d4 authored by Maksim Shabunin's avatar Maksim Shabunin

Merge pull request #4190 from sbokov:fixingStereoBMissue

parents ae71f0c0 e0cea92f
......@@ -1157,6 +1157,10 @@ void cv::validateDisparity( InputOutputArray _disp, InputArray _cost, int minDis
for( x = minX1; x < maxX1; x++ )
{
int d = dptr[x], c = cptr[x];
if( d == INVALID_DISP_SCALED )
continue;
int x2 = x - ((d + DISP_SCALE/2) >> DISP_SHIFT);
if( disp2cost[x2] > c )
......@@ -1173,9 +1177,13 @@ void cv::validateDisparity( InputOutputArray _disp, InputArray _cost, int minDis
for( x = minX1; x < maxX1; x++ )
{
int d = dptr[x], c = cptr[x];
if( d == INVALID_DISP_SCALED )
continue;
int x2 = x - ((d + DISP_SCALE/2) >> DISP_SHIFT);
if( disp2cost[x2] < c )
if( disp2cost[x2] > c )
{
disp2cost[x2] = c;
disp2buf[x2] = d;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment