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:firstname.lastname@example.org] 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’