Comments (10)
Some questions to help with debugging:
- Does the
mergevec.cpp
file exist? - Do you have libtbb installed?
- Which OpenCV version are you using?
from opencv-haar-classifier-training.
The mergevec.cpp file does not exist (to the best of my knowledge).
I am not sure how to check if libtbb is installed, but I want to lean towards no.
I am using OpenCV 2.4.9.
(Thank you for your patience, this is my first time working with OpenCV. I'm a new Swift developer)
from opencv-haar-classifier-training.
I thought that the mergevec.cpp would be created automatically by following the steps in the tutorial, should I have added it manually at some point?
from opencv-haar-classifier-training.
I just realized that you're running the outdated commands from the blog post. Try following the steps in the current version of the README in this repo. It contains a Python version of the mergevec.cpp
file.
from opencv-haar-classifier-training.
So, I think I used code from this repo's README as well as from the outdated blog. This is a snippet from my history:
387 cd opencv-haar-classifier-training/
388 cp src/mergevec.cpp ~/opencv-2.4.9/apps/haartraining
389 python ./tools/mergevec.py -v samples/ -o samples.vec
390 ls
391 opencv_traincascade -data classifier -vec samples.vec -bg negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 1000 -numNeg 600 -w 80 -h 40 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024 -featureType LBP
392 cd ~/opencv-2.4.9/samples/c
393 chmod +x build_all.sh
394 ./build_all.sh
But, I do have a mergevec.py file after executing the steps as outlined in the README.
I'm confused about what to do next. When I run ./build_all.sh
I get all the errors I sent as a snippet above. I tried to follow the steps in this link: Avoid recompiling opencv with mergevec.cpp. How do I access my finished classifier (and test it in an Xcode project)?
from opencv-haar-classifier-training.
So what exactly is failing now? Only build_all.sh
or creating the classifier itself?
from opencv-haar-classifier-training.
It seems as though only '''build_all.sh''' is failing. The training seemed to have completed successfully after about 2 hours
from opencv-haar-classifier-training.
That means you can use your classifier with "any other" project that uses one, right? I'm sorry. I don't know more about why compiling OpenCV fails. But I'd say installing libtbb
is a requirement.
from opencv-haar-classifier-training.
Okay so this snippet fixed the spelling error that was preventing the compiler from accessing the proper libraries:
g++ -L/usr/local/lib `pkg-config --libs --cflags opencv | sed 's/libtbb\.dylib/tbb/'`\
-I. -o mergevec samples.vec cvboost.cpp cvcommon.cpp cvsamples.cpp\
cvhaarclassifier.cpp cvhaartraining.cpp cvsamplesoutput.cpp -lopencv_core\
-lopencv_calib3d -lopencv_imgproc -lopencv_highgui -lopencv_objdetect
I had to add cvsamplesoutput.cpp/h and another file called ioutput.h in order for this to work (Downloaded from https://github.com/apc-llc/opencv-2.4.10). In the code above I used the samples.vec file, and that is what is generating the following error:
warning: ignoring file samples.vec, file was built for unsupported file format ( 0x9B 0x05 0x00 0x00 0x80 0x0C 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xA1 0x00 0xA8 ) which is not the architecture being linked (x86_64): samples.vec
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
from opencv-haar-classifier-training.
Looks like the samples.vec
was built for another architecture, meaning it wasn't compiled/generated by you. Sorry, I don't have anything more to add!
Also, I'm sorry to say, but the problems looks more like a OpenCV problem than a problem that has to do with this repository.
from opencv-haar-classifier-training.
Related Issues (20)
- hi, i'm getting like this while creating my own harr-cascade classifier, please let me correct if anything wrong, and please tell the reason for why classifier cant be trained? and thanks in advance HOT 3
- Illegal division by zero at bin/createsamples.pl line 45. HOT 3
- OpenCV error : Bad Arguement - Can not get new Positive Sample
- no vec files
- Can not see finished_classifier.xml file HOT 15
- unable to create .vec files with create samples file HOT 1
- how createsamples.pl will works? HOT 1
- Error when create samples HOT 1
- Cannot create sample.vec HOT 14
- opencv_createsamples not creating anything inside the 'samples' folder HOT 1
- not able to create final classifier HOT 1
- File not found - '*.jpg' HOT 1
- Please Help
- std::logic_error
- opencv error assertion failed
- sh: 1: Syntax error: Unterminated quoted string HOT 1
- opencv_traincascade assertion error HOT 2
- vec files can't be created HOT 1
- mergevec.py error
- 'opencv_createsamples' is not recognized as an internal or external command, HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencv-haar-classifier-training.