I don't know the Intel RealSense SDK as I have only used the librealsense API.
The documentation for the Intel RealSense SDK shoud be here.
I don't know how it works with the SDK but with librealsense
you can select directly the appropriate color format (for OpenCV mat
it should be bgr8
).
If you don't have this option with the SDK, you can see here how librealsense
unpack yuy2
format.
Or maybe you can try to copy the data directly to a mat
(you will have to figure out the good value for cvDataType
and the good value for cvDataWidth
) and then use cvtColor()
with the appropriate conversion if you want to be able to access to the pixel values as a RGB triplet?
Hope it helps.