Comments (8)
That's weird. It worked for me just a couple of weeks ago on OS X.
Yeah, g++ can't find OpenCV in your output. Did you check what the pkg-config line returns? Do you have opencv installed? In a standard location or somewhere else?
from opencv-haar-classifier-training.
Hi there, I've been helping @kaylalewis install and use this awesome package. We cloned and successfully built the version of openCV you mentioned in the README. Once we downloaded openCV to ~/
we moved into the root openCV directory and ran:
cmake # which successfully generated build files
make -j8
make install
Which built and installed openCV binaries. Would this have also built and installed the necessary lib files (like opencv2) and installed them to $PATH
?
from opencv-haar-classifier-training.
As far as I know, lib files don't get moved into $PATH
, only executables should. And I don't know what the make install
step of OpenCV does exactly.
What needs to happen is g++ getting the correct -I
and -l
flags passed to it. It also needs the correct dylib
files (on OS X) to compile. In the instructions I use pkg-config
for that. The output of pkg-config
looks like this on my machine:
$ pkg-config --libs --cflags opencv | sed 's/libtbb\.dylib/tbb/'
-I/usr/local/Cellar/opencv/2.4.9/include/opencv -I/usr/local/Cellar/opencv/2.4.9/include /usr/local/Cellar/opencv/2.4.9/lib/libopencv_calib3d.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_contrib.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_core.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_features2d.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_flann.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_gpu.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_highgui.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_imgproc.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_legacy.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_ml.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_nonfree.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_objdetect.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_ocl.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_photo.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_stitching.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_superres.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_ts.a /usr/local/Cellar/opencv/2.4.9/lib/libopencv_video.dylib /usr/local/Cellar/opencv/2.4.9/lib/libopencv_videostab.dylib -ltbb
So if you can reproduce this with your manual OpenCV installation it should work.
from opencv-haar-classifier-training.
I am now trying to build on my OSX 10.10 machine (following the same steps in the README) and I am also receiving errors on step 6. pkg-config --libs --cflags opencv | sed 's/libtbb\.dylib/tbb/'
output is:
-I/usr/local/Cellar/opencv/2.4.9/include/opencv
-I/usr/local/Cellar/opencv/2.4.9/include
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_calib3d.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_contrib.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_core.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_features2d.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_flann.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_gpu.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_highgui.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_imgproc.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_legacy.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_ml.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_nonfree.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_objdetect.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_ocl.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_photo.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_stitching.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_superres.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_ts.a
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_video.dylib
/usr/local/Cellar/opencv/2.4.9/lib/libopencv_videostab.dylib
which, to spare you the comparison, is exactly the output of yours excluding the -ltbb
flag which errors with library not found
. The main error is that -lopencv_core
isn't found, which is strange because I have the dylib installed in a place where pkg-config can find it. Any thoughts?
from opencv-haar-classifier-training.
I actually have no idea. You're basically running the same setup as I do.
But it's not pkg-config that needs to find the library, it's g++ that needs access. pkg-config only provides us with the flags to pass to g++ so it can find the libraries.
Just a quick guess: is your g++ command correctly constructed?
from opencv-haar-classifier-training.
I'm closing this for now.
from opencv-haar-classifier-training.
Hey guys, I got the same error..
Did you fix it?
Thank you so much///
from opencv-haar-classifier-training.
I had lots of issues with building the mergevec
tool on OS X Yosemite but I've managed to fix them like this:
g++ `pkg-config --libs --cflags opencv` -I. -I/usr/local/Cellar/opencv/2.4.12_2/include/opencv -I/usr/local/Cellar/opencv/2.4.12_2/include -o mergevec mergevec.cpp\
cvboost.cpp cvcommon.cpp cvsamples.cpp cvhaarclassifier.cpp\
cvhaartraining.cpp cvsamplesoutput.cpp\
-L/usr/local/Cellar/opencv/2.4.12_2/lib\
-lopencv_core -lopencv_calib3d -lopencv_imgproc -lopencv_highgui -lopencv_objdetect
Notes
- The
opencv
package has been installed using Homebrew and the installed version was 2.4.12 - You need to run
export DYLD_LIBRARY_PATH=/usr/local/lib
in case you run into this errorld: library not found for -llibtbb.dylib
-I/usr/local/Cellar/opencv/2.4.12_2/include/opencv -I/usr/local/Cellar/opencv/2.4.12_2/include
is needed in case of this errormergevec.cpp:1:10: fatal error: 'cv.h' file not found
- You also need to include the
cvsamplesoutput.cpp
in case you run into this problemJpgDatasetGenerator::JpgDatasetGenerator(char const*) in cvhaartraining-8f5a1b.o
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.