GMSL Camera - MAX9296A Deserializer Through USB

Hi there,

I am trying to read data from MAX9296A deserializer which produces RAW12 images. USB controller at the edge of the deserializer is configured as YUV 4:2:2 and sends it as 16 bit pixels and I have no control on it.
I tried to use jetson-utils, but videoSource::Capture() method only supports RGB, RGBA images. What I need is reading 2 meaningful bytes for 1080x1920 pixels.
I can do this with OpenCV but IO backend is really slow compared to jetson-utils.
Just to give an idea I am sharing working OpenCV pipeline.

def demosaicing(raw):
    img16 = raw.view(dtype=np.uint16).reshape(1080,1920)
    rgb8 = cv2.normalize(img16, dst=None, alpha=0, beta=255, norm_type=cv2.NORM_MINMAX).astype(np.uint8)
    rgb8 = cv2.demosaicing(rgb8, cv2.COLOR_BayerGB2BGR)
    rgb8_downsized = cv2.resize(rgb8, (0,0),fx=0.5, fy=0.5, interpolation=cv2.INTER_AREA)
    return rgb8_downsized

camera = cv2.VideoCapture(2)
camera.set(cv2.CAP_PROP_CONVERT_RGB, False)

while True:
    ok,raw =
    if not(ok):
    bgr = demosaicing(raw)
    key = cv2.waitKey(25)
    cv2.imshow('frame', bgr)
    if key == 27:

Question is how can I get raw data with the Jetson-utils or gstreamer?

Check if the camera support RAW output first.
Maybe below command.

v4l2-ctl --list-formats-ext

Only format that camera supports is YUYV 4:2:2 @ 30FPS. But it is sending raw12(12bit+4bit padding) bayer images through this pixel packaging format.

Sorry don’t understand your meaning.
If v4l2-ctl didn’t list the raw Bayer image I don’t think able to get it.

Camera sends bayer images in YUYV 4:2:2 format. It is weird because it is a prototype product. So, if I view it as RGB, picture is look like this one.

Basically it produces 1080x1920x2 (uint8) images and I need to get the data before it is converted to RGB.
Right now, I am able to access it by using OpenCV+gstreamer. Problem is solved.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.