catrueeb
Posts: 5
Joined: Wed May 15, 2019 7:44 am

Picamera sensor mode

Sat Jun 08, 2019 3:53 pm

Hi All

I am using the python module picamera to stream images from my V2 camera module. Somehow setting the sensor mode does not work. I am initializing the camera like this:

Code: Select all

camera = PiCamera(sensor_mode = 4, framerate = 40)
This does not seem to work: When calling

Code: Select all

camera.resolution
the output is 1920x1080, which corresponds to mode 1. Furthermore, if I then set the resolution to 1640x1232, the framerate is around 4.5 Hz.
Here is the code to reproduce:

Code: Select all

fs = 36
frames = fs * 10
imgs = []
camera = PiCamera(sensor_mode = 4, framerate = fs)
camera.resolution = (1640,1232)
rawCapture = PiRGBArray(camera, size=camera.resolution)
print("Camera Sensor mode: {}".format(camera.sensor_mode))
print("Camera resolution: {}".format(camera.resolution))
start = time.time()
for frame, i in zip(camera.capture_continuous(rawCapture, format="bgr", use_video_port=True), range(frames)):
	image = frame.array
	rawCapture.truncate(0)
print("Time for {0} frames: {1} seconds".format(frames ,time.time()-start))
According to the documentation the camera can record videos with 1640x1232 resolution at 40 Hz. What am I doing wrong? Thanks!

Return to “Camera board”