Ask Your Question

[OSX] Can't find opencv_createsamples & opencv_traincascade

asked 2019-10-01 20:20:38 -0500

updated 2019-10-02 00:13:54 -0500

berak gravatar image


Im running on OSX mojave 10.14.6 and im facing issue that it miss 2 scripts after the opencv's installation ..

After installing opencv from the repo github (, it installed all apps script except opencv_createsamples & opencv_traincascade ..

How i installed the package :

  1. git clone
  2. cd opencv
  3. mkdir build
  4. cd build
  5. cmake ..

( i remark on this step, in the opencv/build/apps/ directory, there is no createsample & traincascade folder)

  1. make -j 4
  2. sudo make install

Do you guys know why im facing this issue please ?

Thanks by advance for your help

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2019-10-02 00:25:31 -0500

berak gravatar image

the cascade training tools can no more be built in opencv4, after a lot of arcane C-api code was removed.

since you cloned the github repo, you can easily fall back to the 3.4 branch, where those tools are still intact:

git checkout 3.4

then clean your build folder and restart with cmake.

note: it's 2019, and you should rather use some SSD,RCNN or yolo network for object detection, they're much faster / accurate.

edit flag offensive delete link more



Hi, many thanks for your reply and advise !^^ (i just learned opncv about 4 days ago, im totally new haha)

xShadow gravatar imagexShadow ( 2019-10-02 04:46:31 -0500 )edit

answered 2020-03-29 05:44:06 -0500

ComputerVisionary gravatar image

I can suggest to use an earlier versions of OpenCV to train the cascades, I'm still using the traincascade in Opencv 2.4.10 and it is still perfectly working and suitable for OpenCV 3 and 4 detectors.

Take a look here:


edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-10-01 20:20:38 -0500

Seen: 498 times

Last updated: Mar 29