-
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
image_view_node
: support bayer images
#1046
image_view_node
: support bayer images
#1046
Conversation
so far bayer images always failed with an error: ``` [ERROR] [..] [image_view_node]: Unable to convert 'bayer_rggb8' image for display: 'cv_bridge.cvtColorForDisplay() does not have an output encoding that is color or mono, and has is bit in depth' ``` the `stereo_view_node` on the other hand already supports bayer images, however it always forcibly converts them to monochrome, even if they are colour images. for now, this adds the same logic for the single-image viewer and thus only partially resolves ros-perception#1045.
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.
Seems reasonable given what we do in stereo node
i just realised that i was a bit tired when i thought yesterday that it's better to go with mono for now and then figure out colour later on... bayer is of course always colour, so i guess it'd be fine to just always use |
I'm pretty sure this won't show the expected colors you want. I think the trick here is that by casting to 'mono8' we treat the 4 pixels (2 green, 1 red, 1 blue) as a black and white image that is basically 2x the resolution of the actual image and so it looks roughly correct. If you do test out 'bgr' and it looks OK - please post some screen shots here of the 'mono' and 'bgr' for review (I don't have any bayer cameras around to test with). |
ok, i'll do that either tonight or in the coming days. it did look ok when i tried it (though the colours were off, but that's because i'd need to set white balance & co. in the camera for it to look correct) |
i've posted it on the issue: #1045 (comment) |
@mikeferguson: any chance that you could merge this? either way it'd be great to get this merged & released soon so that i don't need a local build of the image pipeline to see raw images (while i do have the debayer node in place as well for further processing it's sometimes relevant to inspect the raw images) |
Let's stick with mono8 for now then. |
thanks, @mikeferguson! should i create a backport PR for jazzy or do you do this automatically? should i create a follow-up PR for |
https://github.com/Mergifyio backport jazzy |
✅ Backports have been created
|
so far bayer images always failed with an error: ``` [ERROR] [..] [image_view_node]: Unable to convert 'bayer_rggb8' image for display: 'cv_bridge.cvtColorForDisplay() does not have an output encoding that is color or mono, and has is bit in depth' ``` the `stereo_view_node` on the other hand already supports bayer images, however it always forcibly converts them to monochrome, even if they are colour images. for now, this adds the same logic for the single-image viewer and thus only partially resolves #1045. (cherry picked from commit 6ff605c)
Are the colors actually accurate? I know you mentioned it wasn't color calibrated, but also, I imagine that having two green channels is maybe part of the issue (my understanding is that the data really isn't bgr8 under the hood, it seems wrong to try and interpret it that way - mono kinda makes sense because you're just casting what is basically BGGR to grayscale) |
OpenCV correctly debayers it if you use |
so far bayer images always failed with an error: ``` [ERROR] [..] [image_view_node]: Unable to convert 'bayer_rggb8' image for display: 'cv_bridge.cvtColorForDisplay() does not have an output encoding that is color or mono, and has is bit in depth' ``` the `stereo_view_node` on the other hand already supports bayer images, however it always forcibly converts them to monochrome, even if they are colour images. for now, this adds the same logic for the single-image viewer and thus only partially resolves #1045.<hr>This is an automatic backport of pull request #1046 done by [Mergify](https://mergify.com). Co-authored-by: Ralph Ursprung <[email protected]>
so far bayer images always failed with an error:
the
stereo_view_node
on the other hand already supports bayer images, however it always forcibly converts them to monochrome, even if they are colour images.for now, this adds the same logic for the single-image viewer and thus only partially resolves #1045.