Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cv2.VedioCapture("bus.jpg") will report an error #3

Open
zengqingfa opened this issue Jun 25, 2021 · 6 comments
Open

cv2.VedioCapture("bus.jpg") will report an error #3

zengqingfa opened this issue Jun 25, 2021 · 6 comments

Comments

@zengqingfa
Copy link

My model was exported successfully. When my input was a video, the program performed fine, but when my input was an image, the program responded with an error.

image
image
image

How can I fix this demo to solve this problem?

@Chen-MingChang
Copy link
Owner

Try to type "D:\bus.jpg" instead of "D:/bus.jpg".

@zengqingfa
Copy link
Author

Same mistake. @Chen-MingChang

@Chen-MingChang
Copy link
Owner

@zengqingfa Please check your path where "bus.jpg" is.
In my sample, it is images/bus.jpg

@wdkwyf
Copy link

wdkwyf commented Jul 7, 2021

videocapture is used to read image sequence or video:
https://docs.opencv.org/3.4/d8/dfe/classcv_1_1VideoCapture.html#a949d90b766ba42a6a93fe23a67785951
So, you'd better rename your image to bus001.jpg or use video file instead.

@Chen-MingChang
Copy link
Owner

@zengqingfa
After checking, this problem is related to media files with audio streams and MSMF backend.
You can follow the link bellow to expand your opencv support.

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/OpenCV-4-1-2-openvino-CAP-IMAGES-can-t-find-starting-number-in/m-p/1129123#M8204

@zengqingfa
Copy link
Author

This seems to be a problem with the OpenCV version used by OpenVino2021.1, I have read elsewhere that OpenVino2021.2 has fixed this problem, that OpenVino2021.2 can read videos and images using cv2.VedioCapture (path), the previous version doesn't seem to work.
Since I only need to read the image, I use cv2.imread (img_path) instead of cv2.vediocapture (path), but other things have changed as well. Now the program can be used normally.So I have no problem with this program. Thanks for the answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants