Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

what's the coordinate relations between disparity image and the original images(the left or right view).

what's the coordinate relations between disparity image and the rectified images(the left or right view)?

I use the following block-matching functions,and the parametes are as follow.

//computer stereo correspondence using the semi-global 
//block matching algorithm
Ptr<StereoSGBM> sgbm = StereoSGBM::create(0, 16, 3);
int numberOfDisparities = ((imageSize.width / 8) + 15) & -16;
sgbm->setPreFilterCap(63);
int sgbmWinSize = 9;
sgbm->setBlockSize(sgbmWinSize);
int cn = gviewLeft.channels();
sgbm->setP1(8 * cn*sgbmWinSize*sgbmWinSize);
sgbm->setP2(32 * cn*sgbmWinSize*sgbmWinSize);
sgbm->setMinDisparity(0);
sgbm->setNumDisparities(numberOfDisparities);
sgbm->setUniquenessRatio(10);
sgbm->setSpeckleWindowSize(100);
sgbm->setSpeckleRange(32);
sgbm->setDisp12MaxDiff(1);
sgbm->setMode(1);

And I get a diaparity image successfuly image description

And the stereo rectification result is as follow image description

I want to re-construction the 3d surface. But which pixel in the original images corresponds to the disparity values whose coordinates are (x,y)?

to express my question clearly, let me say something more about it. if I get a disparity value whose corrdinates are(x,y)(I uploaded a simple illustration to express this intuitively), how can I find the corresponding pixel in the stereo rectified images(the left or the right).

image description

what's the coordinate relations between disparity image and the original rectified images(the left or right view).

what's the coordinate relations between disparity image and the rectified images(the left or right view)?

I use the following block-matching functions,and the parametes are as follow.

//computer stereo correspondence using the semi-global 
//block matching algorithm
Ptr<StereoSGBM> sgbm = StereoSGBM::create(0, 16, 3);
int numberOfDisparities = ((imageSize.width / 8) + 15) & -16;
sgbm->setPreFilterCap(63);
int sgbmWinSize = 9;
sgbm->setBlockSize(sgbmWinSize);
int cn = gviewLeft.channels();
sgbm->setP1(8 * cn*sgbmWinSize*sgbmWinSize);
sgbm->setP2(32 * cn*sgbmWinSize*sgbmWinSize);
sgbm->setMinDisparity(0);
sgbm->setNumDisparities(numberOfDisparities);
sgbm->setUniquenessRatio(10);
sgbm->setSpeckleWindowSize(100);
sgbm->setSpeckleRange(32);
sgbm->setDisp12MaxDiff(1);
sgbm->setMode(1);

And I get a diaparity image successfuly image description

And the stereo rectification result is as follow image description

I want to re-construction the 3d surface. But which pixel in the original images corresponds to the disparity values whose coordinates are (x,y)?

to express my question clearly, let me say something more about it. if I get a disparity value whose corrdinates are(x,y)(I uploaded a simple illustration to express this intuitively), how can I find the corresponding pixel in the stereo rectified images(the left or the right).

image description

what's the coordinate relations between disparity image and the rectified images(the left or right view).

what's the coordinate relations between disparity image and the rectified images(the left or right view)?

I use the following block-matching functions,and the parametes are as follow.

//computer stereo correspondence using the semi-global 
//block matching algorithm
Ptr<StereoSGBM> sgbm = StereoSGBM::create(0, 16, 3);
int numberOfDisparities = ((imageSize.width / 8) + 15) & -16;
sgbm->setPreFilterCap(63);
int sgbmWinSize = 9;
sgbm->setBlockSize(sgbmWinSize);
int cn = gviewLeft.channels();
sgbm->setP1(8 * cn*sgbmWinSize*sgbmWinSize);
sgbm->setP2(32 * cn*sgbmWinSize*sgbmWinSize);
sgbm->setMinDisparity(0);
sgbm->setNumDisparities(numberOfDisparities);
sgbm->setUniquenessRatio(10);
sgbm->setSpeckleWindowSize(100);
sgbm->setSpeckleRange(32);
sgbm->setDisp12MaxDiff(1);
sgbm->setMode(1);

And I get a diaparity image successfuly image description

And the stereo rectification result is as follow image description

I want to re-construction the 3d surface. But which pixel in the original images corresponds to the disparity values whose coordinates are (x,y)?

to express my question clearly, let me say something more about it. if I get a disparity value whose corrdinates are(x,y)(I uploaded a simple illustration to express this intuitively), how can I find the corresponding pixel in the stereo rectified images(the left or the right).

image description