diff --git a/image_view/src/image_view_node.cpp b/image_view/src/image_view_node.cpp index 951eedd9..c3dc1a38 100644 --- a/image_view/src/image_view_node.cpp +++ b/image_view/src/image_view_node.cpp @@ -216,6 +216,11 @@ void ImageViewNode::imageCb(const sensor_msgs::msg::Image::ConstSharedPtr & msg) std::string encoding = msg->encoding.empty() ? "bgr8" : msg->encoding; + // May want to view raw bayer data + if (encoding.find("bayer") != std::string::npos) { + encoding = "mono8"; + } + queued_image_.set( cv_bridge::cvtColorForDisplay( cv_bridge::toCvShare(msg), encoding, options));