Hi,
I am trying to make the 16 MP Arducam work on Raspi4 with OpenCV. I have followed the Arducam tutorial to make it working with libcamera. Which it does. At least libcamera-hello
does it’s job.
Now what I need to achieve is a simple camera feed on the screen similar to what libcamera-hello -f would do, but I need to implement keyboard controlled Zoom in / out. Which is effectively realtime adjustment of the ROI.
Since I know my way around OpenCV, my first bet is to use that, but for some reason, I cannot open the camera in OpenCV (I’m trying C++, not Python). I installed the latest OpenCV (4.8), but it fails when trying to open the camera. When I call cv::VideoCapture::open
, it fails with the following console output:
[ WARN:[email protected]] global cap_gstreamer.cpp:2784 handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Failed to allocate required memory.
[ WARN:[email protected]] global cap_gstreamer.cpp:1679 open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:[email protected]] global cap_gstreamer.cpp:1164 isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Which is weird as I use Rpi4 with 4 GB RAM. I also tried increasing the video memory to 256 MB, but I don’t think that’s the problem given what the message says. And it of course didn’t help.
I wasn’t able to find anything useful regarding arducam and C++ OpenCV. Is there anything else I need to do?
Also, I assume I should be able to achieve the above mentioned functionality using libcamera only, but first, I’m trying to get it working with OpenCV since that would be waaaay easier for me not having to learn a new API…