The data of csi bayer image is too large

Hi, I use v4l2 to obtain bayer image from imx 219 camera on jetson nx. I get the raw image, but I think the data is not right. I use the following command to get raw image from this post.

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 -d /dev/video0 --stream-to=imx219.raw

I think the lagest value of the data is 1024, But when I read the raw image by using python, I find most values are bigger than 1024.

>>> import numpy as np
>>> f = open('imx219.raw', 'rb')
>>> rawdata = np.fromfile(f, dtype=np.uint16, count=1080 * 1920)
>>> print(rawdata)
[4100 4292 4164 ... 4100 4100 4164]

I want to know the reason, thanks in advance.

hello 85704592,

you may try using 3rdparty tools, such as 7yuv to view the raw files directly.

I can use the 7yuv to view the file, but in the HEX mode with 16bit, the value is also bigger than 1024.
Because I want to scale the value to 8bit, I need to know what value I shoud to divide.

hello 85704592,

there’s MSBs replicated.
please access download center for Xavier TRM.
you may refer to page-1394, for [Figure 7.17] to understand the Raw memory formats.

Got it. Thanks.

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