diff --git a/components/rgbd-sources/src/sources/stereovideo/opencv.cpp b/components/rgbd-sources/src/sources/stereovideo/opencv.cpp index df3a9999d8113bdd45dacd203b9ffa1d290290fa..aefae673e1cc320308e47da6cb65b08faae0e070 100644 --- a/components/rgbd-sources/src/sources/stereovideo/opencv.cpp +++ b/components/rgbd-sources/src/sources/stereovideo/opencv.cpp @@ -138,7 +138,8 @@ OpenCVDevice::OpenCVDevice(nlohmann::json &config, bool stereo) height_ = frame.rows; dwidth_ = value("depth_width", width_); - dheight_ = value("depth_height", height_); + float aspect = float(height_) / float(width_); + dheight_ = value("depth_height", std::min(uint32_t(aspect*float(dwidth_)), height_)) & 0xFFFe; // Allocate page locked host memory for fast GPU transfer left_hm_ = cv::cuda::HostMem(dheight_, dwidth_, CV_8UC4);