[Solved] opencv_createsamples: command not found ubuntu

I am following Creating your own Haar Cascade OpenCV Python Tutorial But when I get to making the samples I get opencv_createsamples: command not found

I am using this to create the samples opencv_createsample -img img.jpg -bg bg.txt -info info/info.lst -pngoutput info -maxxangle 0.5 -maxyangle 0.5 -maxzangle 0.5 -num 573

but I know the command exists because when I do man opencv_createsamples it pulls up the man page.
I am using ubuntu 20.04.1

Solution #1:

I have also met this same problem while trying to get Haar Cascade. Similar problem also mentioned here.

According to @Alekhin saying here:

To be able to use opencv_createsamples command, you should use
opencv version 3.x or lower.

This step(creating samples) is only necessary to get our samples. So my suggestions:

  1. Installing supported opencv version in a docker and getting samples

  2. Installing supported opencv in another machine and getting samples

Note: I don’t suggest you to install opencv while other one already exist in your machine.

Same problems also mentioned here and here.

For opencv installation on a docker.

Respondent: Yunus Temurlenk

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.