Repository navigation
how to do demosaic on D455 Y16 raw images #15561
Replies: 5 comments 6 replies
|
Hi @xuanlunhuang A case involving D435 at #1526 (comment) advises that the Y16 image would be debayered if the maximum 1920x1080 resolution was used. D455 only supports 1280x800 maximum for Y16 though. Is the image still bayered if you use 1280x800? If the image is bayered then a solution may be to use OpenCV to demosaic the images. It can do so using COLOR_BayerBG2GRAY https://docs.opencv.org/3.4/db/d8c/group__cudaimgproc__color.html#ga7fb153572b573ebd2d7610fcbe64166e https://stackoverflow.com/questions/63787099/demosaicing-with-opencv |
|
When using the Infrared stream, the default format is Y8 and not RGB / BGR. D455 does though support outputting RGB from infrared (for the left infrared sensor only though) by setting the Infrared stream to RGB8 or BGR8. If OpenCV is being used then it is recommended to use BGR8, otherwise the image's colors will be reversed. Although Y16 is not rectified, Y8 is, and so you would not need to apply rectification if you use Y8 for the left and right IR, as its images are already rectified automatically by the camera hardware. The main reason that Y16 is used is when it is important that the image is unrectified (such as when performing camera calibration). If you plan to rectify the Y16 images to achieve similar results to Y8 then it may be worth simply using Y8 and letting the camera do the rectification for you. |
|
There is a past case at #11543 where a RealSense user who was demosaicing a raw16 stream used COLOR_BAYER_GBRG2RGB If you are using a greyscale image though then COLOR_BAYER_GBRG2GRAY may be more appropriate. The D455 camera model uses the OV9782 sensor for both the RGB and IR sensors. |
|
My colleagues advised that the D455 IR Y16 format output is in RGGB and ask you to "please try COLOR_BayerRGGB2*" I believe the asterisk on the end means that they are suggesting to use COLOR_BayerRGGB2GRAY |
|
You are very welcome! |

Uh oh!
There was an error while loading. Please reload this page.
I obtained Y16‑format images from the left and right IR cameras of the RealSense D455, and I am trying to perform image rectification on my own.
However, I noticed that the Y16 images contain Bayer mosaic patterns. My plan is to demosaic the images first, then apply rectification using the distortion coefficients retrieved from the camera, to achieve results equivalent to the native Y8 output from the camera.
What operations should I apply to these Y16 images? I am not certain about the exact Bayer filter order of the D455 (official documentation suggests it might be BGGR).
Would directly using OpenCV’s cv2.COLOR_BayerBG2GRAY on the Y16 data be correct?
All reactions