Code:
Setup I'm running is:
- pi 3 b +
- OS Bookworm 64 bit
- python 3.11
- virtual env created (with --system-site-packages so that I could access picamera2, since I couldn't install properly in virtual)
- OpenCV 4.9.0 (installed in VM via pip install opencv-python-contrib)
- picamera2 (built-in on OS install)
The code I'm updating uses picamera and I've changed to picamera2. My goal is to get the most efficient way to do the following:
- continually capture the frame and process it in cv2
- have a lower resolution stream available for viewing
This is a dumbed down version of how it's running currently. What I'm wondering:
- is this efficient?
- is it better to capture a video stream and do still captures?
- do I need to configure a capture_array raw instead?
Code:
#initcamera = Picamera2()capture_config = camera.create_still_configuration()camera.configure(capture_config)while True: # grab the raw NumPy array representing the image image = camera.capture_array()
Statistics: Posted by darnitdiy — Mon Jan 08, 2024 9:18 pm