-
Notifications
You must be signed in to change notification settings - Fork 758
image_view:set CvtColorForDisplay encoding as bgr8 #1071
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
Conversation
Fix the issue that the input image encoding as yuv, error to show Signed-off-by: Zhaoyuan Cheng <[email protected]>
image_view/src/image_view_node.cpp
Outdated
@@ -214,7 +214,7 @@ void ImageViewNode::imageCb(const sensor_msgs::msg::Image::ConstSharedPtr & msg) | |||
} | |||
} | |||
|
|||
std::string encoding = msg->encoding.empty() ? "bgr8" : msg->encoding; | |||
std::string encoding = "bgr8"; |
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 isn't the right fix - it would likely break mono8 usage.
If a particular encoding doesn't work for display, we should add a special rule for it below (see line 220-222 where we override bayer to mono8 - you can add another rule there for your yuv format that doesn't currently work)
Signed-off-by: Zhaoyuan Cheng <[email protected]>
Hi @mikeferguson This change ensures that if the input image encoding is YUV, it will be converted to BGR8 for display, while still handling other encodings appropriately. |
https://github.com/Mergifyio backport jazzy humble |
✅ Backports have been created
|
Signed-off-by: Zhaoyuan Cheng <[email protected]> (cherry picked from commit cebd97a)
Signed-off-by: Zhaoyuan Cheng <[email protected]> (cherry picked from commit cebd97a) # Conflicts: # image_view/src/image_view_node.cpp
…1075) Co-authored-by: Zhaoyuan Cheng <[email protected]>
based on issue 1021, Fix the issue that the input image encoding as yuv, error to show