I have some troubles to make my CSI camera work with OpenCV on Python.
I have already posted a similar topic but it was previously a thread problem that Nanocamera module fixed :
I upgraded Jetpack from 4.5 to 4.6 because it has native drivers to use IMX477 CSI cameras which I need for a project.
Now with the same python program as my previous post, I am not able to connect to CSI camera anymore.
I am able to make a pipeline on the console with the gst-launch-1.0 command and the same with nvgstcapture-1.0 command but I can t connect to CSI camera with Open CV on python (I have tried with a IMX477 camera and the Pi camera V2).
I tried with an USB camera and it works fine because I am using the command âcap = cv2.VideoCapture(1)â, not the pipeline.
I think something changed with the new version of OpenCV or Jetpack 4.6 and the pipeline command has to be modified a bit to work but I don t know howâŠ
If I launch the program from the console, this is the error message I get :
~$ python3 camtest.py
[ERROR:0@0.449] global /io/opencv/modules/videoio/src/cap.cpp (164) open VIDEOIO(CV_IMAGES): raised OpenCV exception:
OpenCV(4.5.5) /io/opencv/modules/videoio/src/cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: canât find starting number (in the name of file): nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080,format=(string)NV12, framerate=(fraction)30/1 ! nvvidconv ! video/x-raw, format=(string)RGBA ! appsink in function âicvExtractPatternâ
Hi,
From the log it looks like the OpenCV is not built with gstreamer being enabled. You may rebuild OpenCV 4.5.5 and try again. Or re-flash the system to use default OpenCV 4.1.1
Indeed it looks like Gstreamer is not activated in my OpenCV versionâŠ
It looks pretty complicated to rebuid OpenCV so I will try to reinstall Jetpack 4.6 on the SD card and reinstall everything