Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencv with pi5 (or pi4 or..) #763

Open
petercwallis opened this issue Jan 12, 2025 · 1 comment
Open

opencv with pi5 (or pi4 or..) #763

petercwallis opened this issue Jan 12, 2025 · 1 comment

Comments

@petercwallis
Copy link

I came across this page:
https://forums.raspberrypi.com/viewtopic.php?t=361778

Which describes how to name the camera when creating a new opencv VideoCapture object. The opencv demos say use VideoCapture vcFramesIn(0) to get the default device; rpi users need to use gstreamer with some rather esoteric strings.

Is this still current?

And would it be possible to either update rpicam-apps to provide opencv "device 0" or to at least provide an up to date description of what parameter to hand to VideoCapture for the pis and to do that where we don't spend days looking for it.
cheers, P

@naushir
Copy link
Collaborator

naushir commented Jan 13, 2025

OpenCV does not have native support for libcamera yet. So unfortunately you cannot use the OpenCV api to capture frames directly from /dev/video0 or similar.

To use OpenCV with rpicam-apps, we have a postprocessing API you can find here: https://github.com/raspberrypi/rpicam-apps/tree/main/post_processing_stages. This uses libcamera to capture frames, and OpenCV APIs for any image processing tasks needed. You can find similar examples with Picamera2 here: https://github.com/raspberrypi/picamera2/tree/main/examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants