Error with opencv cap.read()
When I start my python's programm, i got this error
select timeout
select timeout
ret, frame = cap.read()
cv2.error: OpenCV(3.4.0-dev) /home/damien/opencv/opencv/module/core/include/opencv2/core/mat.inl.hpp:500:error: (-215) total() == 0 || data != __null in function Mat
The code is bassic, and got no error (Its just read the webcam). when i search on google, I fond one message saying 'it's the OpenCv compilation the probleme'
I don't found my error, I used this command to compile opencv
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH=~/oc/opencv_contrib-3.1.1/modules \
-D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python \
-D BUILD_EXAMPLES=ON ..
one things, I'm runing Ubuntu on Vmware, and the version for opencv is the 3.4.0 (the lastest)
here is the cmake https://pastebin.com/X6eN4q4m
can you add the cmake output to your question, please ?
Yes I edit it, here is the link https://pastebin.com/X6eN4q4m
"ModuleNotFoundError: No module named 'numpy'" -- so,
it never build any python bindings (see line 400) , so i wonder , what you're using above
(like the pip installed version does not have any video file support builtin, well known flaw)
Yes I know its don't working, But I don't what is the problem, I Follow all this tuto https://www.pyimagesearch.com/2016/10... But use the version 3.3.1
try to install numpy for the python you want to use.
no use to run make, until cmake says it will build it.
I already install numpy
try to use cmake-gui, type PYTHON into the search box, and try to explicitly specify, which of your (various ?) pythons you want to use. and this one needs a valid numpy
I tried one things, its sudo pip3 install python-opencv, but i got the same error, is it possible the probleme, is the vmware?
the pip version cannot read video files, like said before.
your problem is more like: too many python versions, and multiple cv2 instances.
and using virtual env things make it worse , even.
Can i contact you with vocal please? I don't understand the handling