Problem with raw frame shape with IMX462 sensor

  1. Where did you get the camera module(s)?
    UCTronics

  2. Model number of the product(s)?
    Arducam IMX462

  3. What hardware/platform were you working on?
    Raspberry PI 4 2Go

  4. Instructions you have followed. (link/manual/etc.)

  5. Problems you were having?
    Problem with the raw image size

  6. The dmesg log from your hardware?

  7. Troubleshooting attempts you’ve made?

  8. What help do you need?
    I want to retrieve the raw frame from the sensor using following python code, but I am bit confused because the raw frame shape is 1080x3840. If it is RGGB format, I was expecting a 2160x3840 shape ? Am I wrong ?

camera = Picamera2()
still_config = camera.create_still_configuration(raw={“format”: “SRGGB10”}, display=None)
camera.configure(still_config)
camera.start()

time.sleep(1)

raw_frame = camera.capture_array(“raw”)
print(raw_frame.shape) #Return 1080x3840

To be more precise if you have a piece of code to convert the raw image to bgr 8 bits numpy array, I will be more than happy!

Hi,
Correct.
SRGGB10 is 10bit data stored in 16bit, so the amount of data in 1920x1080 raw format is 1920x1080x2 = 3840x1080

You can try to change the numpy dtype to uint16, then the shape will become 1080, 1920.

Thanks a lot Dion for your reply. Just to well understand, each pixel is contiguously stored in 16bits with trailing 0 for the 6 unused bits in order rggb ?
Thanks

Ok found the solution. Thanks again