Thank you for pointing me to this.
I got it running with the following code:
One thing to note is, that the image still is returned as an uint8-array with the shape (3040, 8128), which has to be casted to an uint16-array. This is done with the line .
Now the image is 16 bit, with 12 bit color depth (values are multiple of 16) and shows the typical bayer pattern.
I got it running with the following code:
Code:
import timeimport numpy as npfrom picamera2 import Picamera2, Previewfrom matplotlib import pyplot as plttuning = Picamera2.load_tuning_file("imx477_noir.json")picam2 = Picamera2(tuning=tuning)config = picam2.create_still_configuration(raw={'format': 'SBGGR12', 'size': (4056, 3040)})picam2.configure(config)print('Sensor configuration:', picam2.camera_configuration()['sensor'])print('Stream Configuration:', picam2.camera_configuration()['raw'])picam2.start()time.sleep(2)data8 = picam2.capture_array('raw')data16 = data8.view(np.uint16)plt.imshow(data16, cmap='gray')picam2.stop()
Code:
data16 = data8.view(np.uint16)
Now the image is 16 bit, with 12 bit color depth (values are multiple of 16) and shows the typical bayer pattern.
Statistics: Posted by jo_br — Sun Jan 07, 2024 10:39 am