Skip to content
Snippets Groups Projects
Commit 27eb2bd1 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Allow for missing depth height to maintain aspect

parent 6bef099e
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment