StereoSGBM will leave a black band in the right of disparity output too (Bug #4144)


Added by mathieu letombe about 10 years ago. Updated almost 10 years ago.


Status:Done Start date:2014-01-22
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:calibration, 3d
Target version:-
Affected version:2.4.9 (latest release) Operating System:Windows
Difficulty: HW Platform:x64
Pull request:https://github.com/Itseez/opencv/pull/1787

Description

This was for the left band:

_Seems output pixel in the black band always has value "0".

according to comments of "calcPixelCostBT":

max(-maxD, 0) <= minX <= x < maxX <= width - max(0, -minD)

but, in its implemention:

minX1 = std::max(maxD, 0)

So I makes "maxD" to "-maxD", and the black band disappeared.

There's the same problem for the right band,
so it should be:
int minX1 = max(-maxD, 0), maxX1 = width - max(minD, 0);
instead of
int minX1 = max(-maxD, 0), maxX1 = width + min(minD, 0);

Thank you for your work,
Mathieu.


History

Updated by mathieu letombe about 10 years ago

The left band bug report was in : (Bug #3378)

Updated by Philip L almost 10 years ago

PR was merged into opencv

  • Status changed from New to Done
  • % Done changed from 0 to 100

Also available in: Atom PDF