Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
5861 Discussions

OpenCV(4.5.1-openvino): error: (-5:Bad argument) CAP_IMAGES: can't find starting number

jobdulo
New Contributor I
1,798 Views

I have converted an ONNX model file to the OpenVINO IR format. 

I am running a demo using the following command to test the IR format :

python yolo__openvino_demo.py -m "C:\Program Files (x86)\IntelSWTools\openvino_2021.2.185\deployment_tools\model_optimizer\yolov4-p5.xml" -i .\images\bus.jpg -at yolov4-p5

 

from which I get the following error

 OpenCV(4.5.1-openvino) C:\jenkins\workspace\OpenCV\OpenVINO\2021.2\build\windows\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): .\images\bus.jpg in function 'cv::icvExtractPattern'

 

What I have tried:

Stepping down the OpenVINO version to 2020.3.341 but it could not even convert ONNX file to IR as per the instructions at: 

https://github.com/Chen-MingChang/pytorch_YOLO_OpenVINO_demo

 

I have also looked at the following solved question on the forum:

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/OpenCV-4-1-2-openvino-CAP-IMAGES-can-t...

but this is a video file problem. Mine is an image file problem.

Labels (2)
0 Kudos
10 Replies
Zulkifli_Intel
Moderator
1,783 Views

Hello Job Dulo,

 

Greetings to you.

 

Have you try these recommendations:

 

  • Install FFmpeg as VideoCapture backend (on Windows you need to download the OpenCV community plugin. There's a downloader script in the package: openvino\opencv\ffmpeg-download.ps1. Right-click on it - Run with PowerShell).


If you don't, please give it a try and share with us the result.


Regards,

Zulkifli



jobdulo
New Contributor I
1,770 Views

Hey Zulkifli,

 

Thank you for the response. I have done the following:

  1. Downloaded the OpenCV from https://docs.opencv.org/3.4/d3/d52/tutorial_windows_install.html using the instructions under Installation by Using the Pre-built Libraries
  2. I have right-click on ffmpeg-download.ps1 and run with PowerShell
  3. Tried the inferencing one more time

But the error still persists.

Have I missed anything?

Maksim_S_Intel
Employee
1,760 Views

This application reads an input using OpenCV's `VideoCapture` class, it only supports images with numbers in names, e.g. "frame0001.jpg". So you can just rename your input file to "bus0.jpg".

jobdulo
New Contributor I
1,753 Views

Hey Maksim, renaming the file seems to remove the error but the application hangs from here on.

Zulkifli_Intel
Moderator
1,759 Views

Hello Job Dulo,


Have you rebooted your system after installing FFmpeg? Reboot is required after installing FFmpeg.


Regards,

Zulkifli


jobdulo
New Contributor I
1,753 Views

I skipped this part. I did not install FFmpeg.  Is this the right place to download it from https://www.ffmpeg.org/download.html#build-windows ?

Zulkifli_Intel
Moderator
1,735 Views

Hello Job Dulo.

 

You can find the FFmpeg here "C:\<Installation Path>\openvino_2021.3.394\opencv\ffmpeg-download.ps1". Right-click on it - Run with PowerShell). Once installation is completed, reboot your PC.

 

Regards,

Zulkifli



jobdulo
New Contributor I
1,724 Views

Hey Zulkifli,

I had done exactly that but nothing happened on the powershell. It popped up, blinked, and exited. No output was given.

Zulkifli_Intel
Moderator
1,711 Views

Hello Job Dulo,

 

Go to this directory:

“C:\<install_directory>\openvino_2021.2.185\opencv\bin”

Delete the file opencv_videoio_ffmpeg451_64.dll

Rerun the ffmpeg-download.ps1 using Powershell. You will see this:

 

Zulkifli_Intel_0-1620672003472.png

 

 

Regards,

Zulkifli 

 

Zulkifli_Intel
Moderator
1,607 Views

Hello Job Dulo,


Thank you for your question. If you need any additional information from Intel, please submit a new question as this thread is no longer being monitored. 


Sincerely,

Zulkifli


Reply