opencv_createsamples:在 ubuntu 中找不到命令 [英] opencv_createsamples: command not found ubuntu
问题描述
我正在关注 创建您自己的 Haar Cascade OpenCV Python 教程 但是当我开始制作样本时,我得到 opencv_createsamples: command not found
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
我正在使用它来创建示例 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
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
但我知道该命令存在,因为当我执行 man opencv_createsamples
时,它会打开手册页.我使用的是 ubuntu 20.04.1
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
推荐答案
我在尝试获得 Haar Cascade 时也遇到了同样的问题.此处也提到了类似的问题.
I have also met this same problem while trying to get Haar Cascade. Similar problem also mentioned here.
根据@Alekhin 所说这里:
According to @Alekhin saying here:
为了能够使用 opencv_createsamples
命令,你应该使用opencv 3.x 或更低版本.
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:
在 docker 中安装支持的 opencv 版本并获取示例
Installing supported opencv version in a docker and getting samples
在另一台机器上安装支持的 opencv 并获取示例
Installing supported opencv in another machine and getting samples
注意:我不建议你安装opencv,而你的机器上已经有其他的了.
Note: I don't suggest you to install opencv while other one already exist in your machine.
Same problems also mentioned here and here.
这篇关于opencv_createsamples:在 ubuntu 中找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!