Finally, I found https://github.com/raspberrypi/picamera ... ssions/407 (last post in the threaad) and it works.
I don't know if it's possible to do the same thing using script code instead of modifying the Picamera2 source code.The code snippet example used here is:Camera stream is now centered in the display, leaving two lateral rectangular zones free.
PS: I had to switch width and height in the np.zeros definition to obtain the correct orientation of the colored overlay ... don't know why ....
I don't know if it's possible to do the same thing using script code instead of modifying the Picamera2 source code.The code snippet example used here is:
Code:
overlay = np.zeros((480, 800, 4), dtype=np.uint8)overlay[:240, 400:] = (255, 0, 0, 64)overlay[240:, :400] = (0, 255, 0, 64)overlay[240:, 400:] = (0, 0, 255, 64)colour = (0, 255, 0, 255)origin = (10, 30)font = cv2.FONT_HERSHEY_SIMPLEXscale = 1thickness = 2cv2.putText(overlay, str(10), origin, font, scale, colour, thickness)cam.set_overlay(overlay)PS: I had to switch width and height in the np.zeros definition to obtain the correct orientation of the colored overlay ... don't know why ....
Statistics: Posted by GigiG — Wed May 28, 2025 7:25 am