|
|
@ -108,13 +108,14 @@ namespace |
|
|
|
void cv::gpu::StereoConstantSpaceBP::estimateRecopmmendedParams( int width, int height, int & ndisp, int & iters, int & levels, int &nr_plane) |
|
|
|
void cv::gpu::StereoConstantSpaceBP::estimateRecopmmendedParams( int width, int height, int & ndisp, int & iters, int & levels, int &nr_plane) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ndisp = (int) ((float) width / 3.14f); |
|
|
|
ndisp = (int) ((float) width / 3.14f); |
|
|
|
|
|
|
|
if (ndisp & 1 != 0) ndisp++; |
|
|
|
if ((ndisp & 1) != 0)
|
|
|
|
if ((ndisp & 1) != 0)
|
|
|
|
ndisp++; |
|
|
|
ndisp++; |
|
|
|
|
|
|
|
|
|
|
|
int mm = ::max(width, height); |
|
|
|
int mm = ::max(width, height); |
|
|
|
iters = mm / 100 + ((mm > 1200)? - 4 : 4); |
|
|
|
iters = mm / 100 + ((mm > 1200)? - 4 : 4); |
|
|
|
|
|
|
|
|
|
|
|
levels = cvRound(log((double)mm)) * 2 / 3; |
|
|
|
levels = (int)log(static_cast<double>(mm)) * 2 / 3; |
|
|
|
if (levels == 0) levels++; |
|
|
|
if (levels == 0) levels++; |
|
|
|
|
|
|
|
|
|
|
|
nr_plane = (int) ((float) ndisp / pow(2.0, levels + 1)); |
|
|
|
nr_plane = (int) ((float) ndisp / pow(2.0, levels + 1)); |
|
|
|