-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Opencv 3 compatibility #564
Opencv 3 compatibility #564
Conversation
It is no longer used at all in image_view. Signed-off-by: Chris Lalancette <[email protected]>
While Foxy only supports Ubuntu 20.04 (and hence OpenCV 4), we still strive to maintain Ubuntu 18.04 (which has OpenCV 3). In this case, it is trivial to keep keep image_pipeline working with OpenCV 3, so reintroduce compatibility with it. Signed-off-by: Chris Lalancette <[email protected]>
image_proc/src/crop_decimate.cpp
Outdated
@@ -46,7 +46,13 @@ void debayer2x2toBGR( | |||
int R, int G1, int G2, int B) | |||
{ | |||
typedef cv::Vec<T, 3> DstPixel; // 8- or 16-bit BGR | |||
dst.create(src.rows / 2, src.cols / 2, cv::traits::Type<DstPixel>::value); | |||
#if CV_VERSION_MAJOR >= 3 && CV_VERSION_MINOR >= 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition looks wrong. Version 4.0 / 4.1 would evaluate to FALSE
and 4.2 would evaluate to TRUE
.
Since on a CMake level we already assert 3.2 or higher I would swap the blocks and just check for CV_VERSION_MAJOR >= 4
.
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build failure on the Jenkins builds is the same as already present on the target branch.
CI failed because camera_calibration test failed. It looks like a fix for that is here: ros-perception/vision_opencv#342 . But its not released yet. I'll see about getting a release done for it. Suffice it to say, this PR didn't cause that particular failure, so I think this is good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM too.
Thanks everyone! |
* Remove GTK from image_view. It is no longer used at all in image_view. Signed-off-by: Chris Lalancette <[email protected]> * Reinstate OpenCV 3 compatibility. While Foxy only supports Ubuntu 20.04 (and hence OpenCV 4), we still strive to maintain Ubuntu 18.04 (which has OpenCV 3). In this case, it is trivial to keep keep image_pipeline working with OpenCV 3, so reintroduce compatibility with it. Signed-off-by: Chris Lalancette <[email protected]> * Fixes from review. Signed-off-by: Chris Lalancette <[email protected]> * One more fix. Signed-off-by: Chris Lalancette <[email protected]>
* Remove GTK from image_view. It is no longer used at all in image_view. Signed-off-by: Chris Lalancette <[email protected]> * Reinstate OpenCV 3 compatibility. While Foxy only supports Ubuntu 20.04 (and hence OpenCV 4), we still strive to maintain Ubuntu 18.04 (which has OpenCV 3). In this case, it is trivial to keep keep image_pipeline working with OpenCV 3, so reintroduce compatibility with it. Signed-off-by: Chris Lalancette <[email protected]> * Fixes from review. Signed-off-by: Chris Lalancette <[email protected]> * One more fix. Signed-off-by: Chris Lalancette <[email protected]> Co-authored-by: Chris Lalancette <[email protected]>
@clalancette Are you doing the new release with this change or do you want me to? Edit: Same question for Dashing. |
It would be great if you could. Thanks. |
Foxy: ros/rosdistro#25958 |
Thank you! |
This PR reinstates OpenCV 3 compatibility.
While Foxy only supports Ubuntu 20.04 (and hence OpenCV 4), we still strive to maintain Ubuntu 18.04 (which has OpenCV 3). In this case, it is trivial to keep keep image_pipeline working with OpenCV 3, so reintroduce compatibility with it.
Along with this, remove the dependency on GTK3. It fails on Ubuntu 18.04, but it actually doesn't matter since there is no usage of the GTK API anywhere in the code.