I want to use sensor.ioctl to take the top left QVGA window with a target resolution of QVGA (no resizing). I want to only capture the top left 320x240 pixels and do so at very high FPS. I’m using the following code:
import sensor, image sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.ioctl(sensor.IOCTL_SET_READOUT_WINDOW, (0,0,320,240)) sensor.skip_frames(time = 2000) while(True): img = sensor.snapshot()
While the FPS is very high, the image quality is extremely poor. The image is extremely dark and somewhat blurry. See the example sensor snapshots below:
However, when I remove the “sensor.ioctl(sensor.IOCTL_SET_READOUT_WINDOW, (0,0,320,240))” line from my code, the image looks fine. See the example sensor snapshots below:
The images were taking under identical lighting conditions of the same objects (image 1 is of a laptop, image 2 is of scissors). Why does using sensor.ioctl cause the image to be so dark?