Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6404 Discussions

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

jobdulo
New Contributor I
5,943 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-find-starting-number-in/m-p/1129111

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

Labels (2)
0 Kudos
10 Replies
Zulkifli_Intel
Moderator
5,928 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



0 Kudos
jobdulo
New Contributor I
5,915 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?

0 Kudos
Maksim_S_Intel
Employee
5,905 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".

0 Kudos
jobdulo
New Contributor I
5,898 Views

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

0 Kudos
Zulkifli_Intel
Moderator
5,904 Views

Hello Job Dulo,


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


Regards,

Zulkifli


0 Kudos
jobdulo
New Contributor I
5,898 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 ?

0 Kudos
Zulkifli_Intel
Moderator
5,880 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



0 Kudos
jobdulo
New Contributor I
5,869 Views

Hey Zulkifli,

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

0 Kudos
Zulkifli_Intel
Moderator
5,856 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 

 

0 Kudos
Zulkifli_Intel
Moderator
5,752 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


0 Kudos
Reply