Merge pull request #4190 from sbokov:fixingStereoBMissue
This commit is contained in:
commit
0726c4d4ea
@ -1157,6 +1157,10 @@ void cv::validateDisparity( InputOutputArray _disp, InputArray _cost, int minDis
|
|||||||
for( x = minX1; x < maxX1; x++ )
|
for( x = minX1; x < maxX1; x++ )
|
||||||
{
|
{
|
||||||
int d = dptr[x], c = cptr[x];
|
int d = dptr[x], c = cptr[x];
|
||||||
|
|
||||||
|
if( d == INVALID_DISP_SCALED )
|
||||||
|
continue;
|
||||||
|
|
||||||
int x2 = x - ((d + DISP_SCALE/2) >> DISP_SHIFT);
|
int x2 = x - ((d + DISP_SCALE/2) >> DISP_SHIFT);
|
||||||
|
|
||||||
if( disp2cost[x2] > c )
|
if( disp2cost[x2] > c )
|
||||||
@ -1173,9 +1177,13 @@ void cv::validateDisparity( InputOutputArray _disp, InputArray _cost, int minDis
|
|||||||
for( x = minX1; x < maxX1; x++ )
|
for( x = minX1; x < maxX1; x++ )
|
||||||
{
|
{
|
||||||
int d = dptr[x], c = cptr[x];
|
int d = dptr[x], c = cptr[x];
|
||||||
|
|
||||||
|
if( d == INVALID_DISP_SCALED )
|
||||||
|
continue;
|
||||||
|
|
||||||
int x2 = x - ((d + DISP_SCALE/2) >> DISP_SHIFT);
|
int x2 = x - ((d + DISP_SCALE/2) >> DISP_SHIFT);
|
||||||
|
|
||||||
if( disp2cost[x2] < c )
|
if( disp2cost[x2] > c )
|
||||||
{
|
{
|
||||||
disp2cost[x2] = c;
|
disp2cost[x2] = c;
|
||||||
disp2buf[x2] = d;
|
disp2buf[x2] = d;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user