Skip to content

Commit 032627d

Browse files
committed
CvtColorForDisplay is not supported until 1.11.9 (hydro)
1 parent 6e7c361 commit 032627d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ endif()
1515
if(cv_bridge_VERSION VERSION_LESS "1.11.9")
1616
add_definitions("-DCV_BRIDGE_COMPRESSED_IMAGE_IS_NOT_SUPPORTED")
1717
endif()
18+
# Supporting CvtColorForDisplay in cv_bridge has been started from 1.11.9 (2015-11-29)
19+
if(cv_bridge_VERSION VERSION_LESS "1.11.9")
20+
add_definitions("-DCV_BRIDGE_CVT_COLOR_FOR_DISPLAY_IS_NOT_SUPPORTED")
21+
endif()
1822
# Supporting CvtColorForDisplayOptions in cv_bridge has been started from 1.11.13 (2016-07-11)
1923
if(cv_bridge_VERSION VERSION_LESS "1.11.13")
2024
add_definitions("-DCV_BRIDGE_CVT_COLOR_FOR_DISPLAY_OPTION_IS_NOT_SUPPORTED")

src/nodelet/adding_images_nodelet.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ namespace adding_images {
188188
result_image).toImageMsg();
189189
if (debug_view_) {
190190
cv::namedWindow(window_name_, cv::WINDOW_AUTOSIZE);
191+
#ifdef CV_BRIDGE_CVT_COLOR_FOR_DISPLAY_IS_NOT_SUPPORTED
192+
cv::imshow(window_name_, result_image);
193+
#else
191194
#ifdef CV_BRIDGE_CVT_COLOR_FOR_DISPLAY_OPTION_IS_NOT_SUPPORTED
192195
cv::imshow(window_name_, cv_bridge::cvtColorForDisplay(cv_bridge::toCvShare(image_msg3, image_msg3->encoding))->image);
193196
#else
@@ -198,6 +201,7 @@ namespace adding_images {
198201
options.do_dynamic_scaling = true;
199202
}
200203
cv::imshow(window_name_, cv_bridge::cvtColorForDisplay(cv_bridge::toCvShare(image_msg3), "", options)->image);
204+
#endif
201205
#endif
202206
int c = cv::waitKey(1);
203207
}

0 commit comments

Comments
 (0)