Skip to content

Instantly share code, notes, and snippets.

Created January 14, 2023 01:30
What would you like to do?
Overlay displaying 640x75 and 640x150 areas for Raspberry v2 camera raspiraw capturing at 1007fps (with 640x75 and 640x150_s tools)
import numpy as np
from picamera2 import Picamera2, Preview
picam2 = Picamera2()
picam2.start_preview(Preview.QTGL, x=100, y=100, width=640, height=480)
overlay = np.zeros((480, 640, 4), dtype=np.uint8)
col = (0xFF, 0xFF, 0x00)
overlay[0 , : ] = (col) + (0xFF,)
overlay[74 , : ] = (col) + (0x80,)
overlay[149 , : ] = (col) + (0xFF,)
overlay[:150, :1] = (col) + (0xFF,)
overlay[:150, 639: ] = (col) + (0xFF,)
input("Press Enter to continue ...")
Copy link

Hermann-SW commented Jan 14, 2023

Example screenshot, shows the 640x75 and 640x150 areas on top of 640x480 camera preview window. Not really useful for raspiraw capturing, because raspiraw needs legacy camera mode, and picamera2 needs libcamera stack. So for working with raspiraw better use picamera version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment