zed_cpu_ros
zed_cpu_ros copied to clipboard
opencv 4.2 roi error in ubuntu 20
Hi , i am not able run this package in ubuntu 20 with openCV 4.2.0 when i launch , it fails with cv::Exception displaying some roi error. like 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function Mat
I have the same problem. I find it is caused by
cv::Rect left_rect(0, 0,width_, height_); cv::Rect right_rect(width_ / 2, 0, width_ / 2, height_);
in bool getImages() func of zed_cpu_ros.cpp. I changed them to
cv::Rect left_rect(0, 0, raw.size().width/2, raw.size().height); cv::Rect right_rect(raw.size().width / 2, 0, raw.size().width / 2, raw.size().height);
and it's now working well for me.