Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8093

Camera board • Re: Time Lapse Night-time Query

$
0
0
You could just use some simple maths to calculate average value of the image, and then stop saving the captures if too low...

Code:

from picamera2 import Picamera2import numpy as nppicam2 = Picamera2()picam2.configure(picam2.create_preview_configuration(main={"format": 'XRGB8888', "size": (640, 480)}))picam2.start()while True:    img = picam2.capture_array("main")    print(np.average(img))

Statistics: Posted by gordon77 — Tue Jul 08, 2025 1:21 pm



Viewing all articles
Browse latest Browse all 8093

Trending Articles