openCv /cv2 python problem

Hey, maybe you can help me.

Few weeks ago, i programmed for my CSI-Camera a little code and when i was finished, i saved a backup on my cloud afterwards. Unfortunately, i had to reinstall Ubuntu 18.4 and all my installed packages were gone.

After installing openCv for python with “sudo apt install python3-opencv” i got the cv2 version 3.2 and following error description when
i run my code now:

cv2.imshow(‘NanoCam’,image)
cv2.error: /build/opencv-XDqSFW/opencv-3.2.0+dfsg/modules/highgui/src/window.cpp:304: error: (-215) size.width>0 && size.height>0 in function imshow

My camera is working i checked it with nvgstcapture-1.0 in my terminal.

I uninstalled that version from my Jetson Nano 2G dev kit and tried to intsall OpenCv from the source as mentioned here:

But after using the “make -j4”/“make -j2” command i get everytime when i reach 90 procent following error description:

c++: internal compiler error: Killed (program cc1plus)
.
.
.
make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o] Error 4
CMakeFiles/Makefile2:21551: recipe for target ‘modules/python3/CMakeFiles/opencv_python3.dir/all’ failed
make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs…
[ 92%] Built target example_cpp_cloning_demo
Makefile:162: recipe for target ‘all’ failed
make: *** [all] Error 2

I don’t think that is because of my code because i uploaded the "correct " version but just in case here my camera stream config:

nanoCamSet=‘nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM),width=3280,height=2464,framerate=21/1,format=NV12 ! nvvidconv flip-method=2 ! video/x-raw,width=800,height=600,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! appsink’
nanoCam=cv2.VideoCapture(nanoCamSet)

So is there any tip or advice to fix my problem?

I appreciate every single hint to solve that problem.

Hi,
Please check if you can run this sample:
OpenCV Video Capture with GStreamer doesn't work on ROS-melodic - #3 by DaneLLL

If camera is good, and OpenCV package is good, this sample should be run successfully. Please give it a try.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.