OpenCV haartraining: Mergevec error: Input file does not exist or not readable

允我心安 提交于 2019-12-02 18:44:38

问题


Following this tutorial, I've created my positive samples but need to merge them now, using mergevec. I downloaded the mergevec.exe binary file provided and got the two required dlls cxcore100.dll and highgui100.dll. However, when I run it like so:

mergevec samples.txt samples.vec

it gives me the error:

ERROR: Input file <filename> does not exist or not readable.

What should I do to fix this? My vec files are fine, because I was able to view them using the opencv_createsamples utility. So I know they're fine.


回答1:


I ran into this issue as well and made a python utility that combines .vec files to avoid installing openCV again: https://github.com/wulfebw/mergevec

Hope it helps.




回答2:


I was in the same situation as you few days ago so i'll try to help you out =P.

First of all i am interested to know where you found the mergevec.exe, because it isn't available to download anymore if i recall. I ask because i think that you might have downloaded an exe compiled on Linux. I had the same error when i tried to execute the mergevec, i had compiled on Ubuntu, on my Windows computer. Even with the 2 dlls.

As i explained it here , The mergevec from Naotoshi was originally made for Unix distribution, so under windows you will encounter a lot of problems. I first tried to do it on windows but i abandonned because it was too complicated and even with a full Cygwin installation i could not compile the mergevec.cpp.

What i advise you to do is to create yourself an Ubuntu virtual machine and to compile your own mergevec.exe. Once done you can copy your vec files in your virtual machine and merge them under Ubuntu. After this you can bring back the merged vec file to Windows if you want (It is better to not run the training under a VM: less computation power).

Here is what i did:

  • Installed VMware player with Ubuntu 14.0.4 (although i don't recommend it, still some bugs)
  • Installed OpenCV from the sources with TBB. There are a lot of tutorials, but the only one that worked for me is the OPenCV website, they are the more accurate on the libraries you mandatorily need.
  • I downloaded the GitHub classifier training and then I followed the commands given and it worked well.

If you encounter any library problem or OpenCV Installation issue don't hesitate i went through them too.



来源:https://stackoverflow.com/questions/22915363/opencv-haartraining-mergevec-error-input-file-does-not-exist-or-not-readable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!