Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

CUDA StereoBM setMinDisparity-Function

Hello,

is it possible to change the minDisparity-Parameter in the cuda::StereoBM function like in cv::StereoBM? I would like to change to Parameter with a trackbar, but it's not working.

My snippet:

Ptr<cuda::StereoBM> cuda_sbm = cuda::createStereoBM(ndisparities, SADWindowSize);
cuda_sbm->compute(image1_rectified_grayGPU, image2_rectified_grayGPU, image_disparityGPU);
....

createTrackbar("minDisparity", "Disparitaet", &minDisparity, 50, onTrackbar);
createTrackbar("ndisparities", "Disparitaet", &ndisparities, 100, onTrackbar);
createTrackbar("SADWindowSize", "Disparitaet", &SADWindowSize, 31, onTrackbar);
...

void onTrackbar(int bla, void* data){
    cuda_sbm->setMinDisparity(minDisparity);
    cuda_sbm->setNumDisparities(ndisparities);
    cuda_sbm->setBlockSize(SADWindowSize);
}

It is working with the cuda_sbm->setNumDisparities(ndisparities)
and cuda_sbm->setBlockSize(SADWindowSize) functions perfectly,
but it doesn't work with cuda_sbm->setMinDisparity(minDisparity)

CUDA StereoBM setMinDisparity-Function

Hello,

is it possible to change the minDisparity-Parameter in the cuda::StereoBM cuda::StereoBM function like in cv::StereoBM? cv::StereoBM?
I would like to change to that Parameter with a trackbar, but it's not working.

My minimal snippet:

Ptr<cuda::StereoBM> cuda_sbm = cuda::createStereoBM(ndisparities, SADWindowSize);
cuda_sbm->compute(image1_rectified_grayGPU, image2_rectified_grayGPU, image_disparityGPU);
....

createTrackbar("minDisparity", "Disparitaet", &minDisparity, 50, onTrackbar);
createTrackbar("ndisparities", "Disparitaet", &ndisparities, 100, onTrackbar);
createTrackbar("SADWindowSize", "Disparitaet", &SADWindowSize, 31, onTrackbar);
...

void onTrackbar(int bla, void* data){
    cuda_sbm->setMinDisparity(minDisparity);
    cuda_sbm->setNumDisparities(ndisparities);
    cuda_sbm->setBlockSize(SADWindowSize);
}

It is working with the cuda_sbm->setNumDisparities(ndisparities)
and cuda_sbm->setBlockSize(SADWindowSize) functions perfectly,
but it doesn't work with cuda_sbm->setMinDisparity(minDisparity)

CUDA StereoBM setMinDisparity-Function

Hello,

is it possible to change the minDisparity-Parameter in the cuda::StereoBM function like in cv::StereoBM?
I would like to change that Parameter with a trackbar, but it's not working.

My minimal snippet:

 void onTrackbar(int nothing, void* data){
 cuda_sbm->setMinDisparity(minDisparity);
 cuda_sbm->setNumDisparities(ndisparities);
 cuda_sbm->setBlockSize(SADWindowSize);
 }


//global
int minDisparity, ndisparities, SADWindowSize;
Ptr<cuda::StereoBM> cuda_sbm = cuda::createStereoBM(ndisparities, SADWindowSize);

//inside main
cuda_sbm->compute(image1_rectified_grayGPU, image2_rectified_grayGPU, image_disparityGPU);
....

createTrackbar("minDisparity", "Disparitaet", &minDisparity, 50, onTrackbar);
createTrackbar("ndisparities", "Disparitaet", &ndisparities, 100, onTrackbar);
createTrackbar("SADWindowSize", "Disparitaet", &SADWindowSize, 31, onTrackbar);
...

void onTrackbar(int bla, void* data){
    cuda_sbm->setMinDisparity(minDisparity);
    cuda_sbm->setNumDisparities(ndisparities);
    cuda_sbm->setBlockSize(SADWindowSize);
}

It is working with the cuda_sbm->setNumDisparities(ndisparities)
and cuda_sbm->setBlockSize(SADWindowSize) functions perfectly,
but it doesn't work with cuda_sbm->setMinDisparity(minDisparity)

CUDA StereoBM setMinDisparity-Function

Hello,

is it possible to change the minDisparity-Parameter in the cuda::StereoBM function like in cv::StereoBM?
I would like to change that Parameter with a trackbar, but it's not working.

My minimal snippet:

 void onTrackbar(int nothing, void* data){
  cuda_sbm->setMinDisparity(minDisparity);
  cuda_sbm->setNumDisparities(ndisparities);
  cuda_sbm->setBlockSize(SADWindowSize);
 }


//global
int minDisparity, ndisparities, SADWindowSize;
Ptr<cuda::StereoBM> cuda_sbm = cuda::createStereoBM(ndisparities, SADWindowSize);

//inside main
cuda_sbm->compute(image1_rectified_grayGPU, image2_rectified_grayGPU, image_disparityGPU);
....

createTrackbar("minDisparity", "Disparitaet", &minDisparity, 50, onTrackbar);
createTrackbar("ndisparities", "Disparitaet", &ndisparities, 100, onTrackbar);
createTrackbar("SADWindowSize", "Disparitaet", &SADWindowSize, 31, onTrackbar);
...

It is working with the cuda_sbm->setNumDisparities(ndisparities)
and cuda_sbm->setBlockSize(SADWindowSize) functions perfectly,
but it doesn't work with cuda_sbm->setMinDisparity(minDisparity)

CUDA StereoBM setMinDisparity-Function

Hello,

is it possible to change the minDisparity-Parameter in the cuda::StereoBM function like in cv::StereoBM?
I would like to change that Parameter with a trackbar, but it's not working.

My minimal snippet:

void onTrackbar(int nothing, void* data){
  cuda_sbm->setMinDisparity(minDisparity);
  cuda_sbm->setNumDisparities(ndisparities);
  cuda_sbm->setBlockSize(SADWindowSize);
}


//global
int minDisparity, ndisparities, SADWindowSize;
Ptr<cuda::StereoBM> cuda_sbm = cuda::createStereoBM(ndisparities, SADWindowSize);

//inside main
cuda_sbm->compute(image1_rectified_grayGPU, image2_rectified_grayGPU, image_disparityGPU);
....

createTrackbar("minDisparity", "Disparitaet", &minDisparity, 50, onTrackbar);
createTrackbar("ndisparities", "Disparitaet", &ndisparities, 100, onTrackbar);
createTrackbar("SADWindowSize", "Disparitaet", &SADWindowSize, 31, onTrackbar);
...

It is working with the cuda_sbm->setNumDisparities(ndisparities)
and cuda_sbm->setBlockSize(SADWindowSize) functions perfectly,
but it doesn't work with cuda_sbm->setMinDisparity(minDisparity)