raspberrypi / picamera2

New libcamera based python library
BSD 2-Clause "Simplified" License
901 stars 190 forks source link

[HOW-TO] OpenCV VideoCapture help #617

Closed Jeevaakg closed 1 year ago

Jeevaakg commented 1 year ago

How to capture pi camera feed to opencv?

I want to us OpenCV.videocaputure () function in my code. Please help me to configure picamera2 for my requirement

Petros626 commented 1 year ago

Hey,

I opened an issue some days before, exactly about this topic here: https://github.com/opencv/opencv/issues/23328. It's not possible I guess. If you activate the old camera stack picamera2 probably will not work. I'm working these days for a workaround, one way would to use just OpenCV without picamera2 (using old camera stack). Another I didn't proved is to use the something like PiRGBArray like in the old picamera library.

Let's see what the authors have to say to this issue.

davidplowman commented 1 year ago

You would have to talk to the OpenCV developers about adding support for libcamera, there is not much we can do about this. I believe it was raised at some point, but I don't believe the discussion has really moved on.

As has been commented, the legacy camera stack should work, but you don't get access to the new camera modules, the ability to receive different streams, and so on.

I think some folks have had some luck with the libcamerify utility, but it's not an ideal solution.

Sorry not to be more help.