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

Camera board • Re: Face Detection Auto Exposure

$
0
0
It happens automatically if you use capture_array() which outputs a NumPy array that OpenCV can read. The only gotchas are you need to ensure you've configured Picamera2 to capture RGB rather than say YCbCr, and note that OpenCV likes to call byte-ordered RGB as "BGR".

You can also pull out and reshape the Y component from an 8-bit YCbCr image buffer, but you need to know something about the in-memory layout including any extra "padding" columns on the right side.

The thing not to use is cv2.VideoCapture which AFAIK doesn't work with libcamera/Picamera2.

There's example code for this kind of thing here; see e.g. opencv_face_detect_2.py, and see the PiCamera2 manual

Statistics: Posted by njh — Fri Dec 22, 2023 9:27 pm



Viewing all articles
Browse latest Browse all 5196

Trending Articles