如何在windows中正确构建opencv获取“opencv_createsamples.exe" [英] How to build opencv correctly in windows to get "opencv_createsamples.exe"

查看:251
本文介绍了如何在windows中正确构建opencv获取“opencv_createsamples.exe"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想学习和使用使用 OpenCV 的 haarcascade 分类器来检测我选择的对象.我在互联网上搜索,发现 createsamples 实用程序有助于为正面和负面图像创建数据集.我知道如何在 python 中安装 OpenCV(pip install opencv-python 完美运行)但由于我需要使用该实用程序,因此我需要为我的 Windows 系统构建 OpenCV.

I want to learn and use haarcascade classifier using OpenCV for detection of object of my choice. I searched the internet and found that createsamples utility helps in creating dataset for positive and negative images. I know how to install OpenCV in python (pip install opencv-python works perfectly) but since I need to use that utility I need to build the OpenCV for my windows system.

尝试 1:使用 MinGW 和 cmake

  • cloned latest OpenCV using git at "C:\OpenCV" from https://github.com/opencv/opencv

安装 cmake

它在"C:\OpenCV\build\install"

但令我惊讶的是 opencv_createsamples.exe 不存在

but to my surprise opencv_createsamples.exe was not present there

opencv_visualisation.exeopencv_annotation.exeopencv_version.exe 等存在

生成的安装文件截图

默认在 cmake 中选择的构建选项的屏幕截图

很明显BUILD_opencv_apps默认为true,并且除了这个应用程序之外还创建了其他应用程序

It is clear BUILD_opencv_apps is true by default and other apps were created except this one

仍在源文件夹中:createsamples.cpp 存在于 "C:\OpenCV\apps\" 以及 opencv_visualisation.cpp 和其他

still in source folder : createsamples.cpp is present in "C:\OpenCV\apps\" along with opencv_visualisation.cpp and others

尝试 2:从官方网站构建 Visual Studio 14_15

"C:\OpenCV401\"

仍然令我惊讶的是 "C:\OpenCV401\build\x64\vc14\bin" 没有 opencv_createsamples.exe同样存在其他文件

still to my surprise at "C:\OpenCV401\build\x64\vc14\bin" no opencv_createsamples.exe likewise other files are present

构建中存在的文件的屏幕截图

尝试 3

  • This time I downloaded visual studio 10 build from this github page : https://github.com/abreheret/opencv3.2.0_build
  • here at <OpenCV_DIR>/x64/vc10/bin/ all the amazing files are present

此版本中存在的文件的屏幕截图

所以,我的问题是:

  • 为什么我第一次尝试时没有使用 MinGW 和 cmake 从源代码构建该实用程序
  • 为什么他们没有包含在正式版本中
  • 如何使用 MinGW 和 cmake 构建以正确获取该实用程序(可能需要一些构建配置?)

推荐答案

Createsamples 在最新的 OpenCV(4.0 及更高版本)中被禁用:这里.

Createsamples was disabled in latest OpenCV (4.0 and greater): here.

这篇关于如何在windows中正确构建opencv获取“opencv_createsamples.exe"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆