How to build opencv correctly in windows to get "opencv_createsamples.exe" - windows

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.
My attempts to install OpenCV in windows
Attempt 1 : using MinGW and cmake
cloned latest OpenCV using git at "C:\OpenCV" from https://github.com/opencv/opencv
Installed cmake
created build using cmake at "C:\OpenCV\build" using MinGW(64 bit) build system with default options
ran mingw32-make
ran mingw32-make install
It created an install directory in "C:\OpenCV\build\install"
but to my surprise opencv_createsamples.exe was not present there
opencv_visualisation.exe, opencv_annotation.exe, opencv_version.exe etc. are present
screenshot of install files generated
screenshot of build options selected in cmake by default
It is clear BUILD_opencv_apps is true by default and other apps were created except this one
still in source folder : createsamples.cpp is present in "C:\OpenCV\apps\" along with opencv_visualisation.cpp and others
Attempt 2: visual studio 14_15 build from official site
Downloaded OpenCV latest 4.0.1 from https://github.com/opencv/opencv/releases/download/4.0.1/opencv-4.0.1-vc14_vc15.exe from https://github.com/opencv/opencv/releases webpage
extracted the opencv build at "C:\OpenCV401\"
still to my surprise at "C:\OpenCV401\build\x64\vc14\bin" no opencv_createsamples.exe
likewise other files are present
screenshot of files present in build
Attempt 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
screenshot of files present in this build
So, my question is :
Why that utility was not built from the source using MinGW and cmake in my first attempt
Why they have not included in the official build
How to build using MinGW and cmake to get that utility correctly (maybe some build configuration needed?)

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

Related

How to build and install OpenCV 4.2.0 for x86?

Im trying to build the newest OpenCV version (4.2.0) for x86/32bit on Windows for Visual Studio. However there is only 1 OpenCVConfig.cmake in the finished build (opencv/build/win-install/x86/vc16/lib/OpenCVConfig.cmake - there is no bin folder).
What i've tried:
I've downloaded and executed the latest version (opencv-4.2.0-vc14_vc15.exe)
I've followed this SO thread and added the short snippet in my opencv/build/OpenCVConfig.cmake
Downloaded Cmake 3.17 and installed via the installer
Started the Cmake GUI - set source code to opencv/sources and binaries to opencv/build
Choose Visual Studio 16-2019 as generator and options to win32
Configured Proxy for the downloads and clicked on Generate.
I got no noticeable Errors in the build process. The last lines of the console are:
Install to: C:/Users/user/opencv/build/install
Configuring done
Generating done
There is also no install folder inside opencv/install. I think it installs to opencv/build/win-install.
What am i doing wrong?

Build Lua 5.2.2 in Windows

I already have Lua For Windows installed but as I read about the latest version of Lua which is 5.2.2, I noticed that Lua For Windows is using an old version of Lua which is 5.1.
I want to build the latest lua version to my windows 7 pc, but I don't quite get the idea on how I can build it. I already read this too Detailed Instruction for installing Lua. Do i need to remove the Lua For Windows ? please give me links how I can build it? what are the necessary tools to build the last lua source code.
Note: please also tell how can I test a source on it.
Compiling lua on Windows using Visual Studio is as simple as:
Downloading a copy of the lua source code and extracting it
Opening a Visual Studio Developer Command Prompt and navigating to the 'src' directory
Run this command: move luac.c .. & cl *.c -o lua.exe /O1
Lua binaries are hosted on sourceforge. You don't need to remove Lua for Windows. What I do on my installation of LFW is, I overwrite the lua.exe and lua.dll with the respective 5.2.* files from the binaries I downloaded.
PS: Sourceforge hasn't been updated with 5.2.2 release of Lua and is still at version 5.2.1. If you want to build, you'll find the similar question that greatwolf has linked to.

ubuntu 13.04, can't see source files of c++ project in QT creator

On ubuntu 12.10 I've been using Qt Creator for a while. After updating to ubuntu 13.04 I've encountered the problem, that I can no longer see my src-files in the project editor. I only see the .pro and .pri file.
I've checked that the build path is correct and re-installed QT 5. As well, I can compile and run the project as usual, but the src-files just won't appear in the editor. I used to run the project with QT4 (qmake-qt4 makefile.pro), might this interfere?
I found a workaround by adding the required source and header files manually via right-click on the project. But this is rather inconvenient as the source files are spread across several folders. I still couldn't figure out why QT creator does not add them automatically after I've upgraded to ubuntu 13.04 and QT 5 (downgrade to QT 2.7 was in vain, too).

Qt on Mac: where to find "configure"

I am very new to Mac.
I downloaded QT SDK Mac Open source (http://get.qt.nokia.com/qtsdk/qt-sdk-mac-opensource-2010.02.dmg) and installed the Package.
I can run qmake, build samples and run demos,
but I cannot run configure (in order to build the Qt libraries statically).
It says: -bash: No such file or directory.
Documentation says I should run this in the "Qt root folder", but what is this folder in Mac?
I looked for it in /usr/bin, /usr/local/Qt4.6, /Developer/Tools/Qt.
Anyway, what is "configure" on Mac. is it an executable or a script?
Thanks a lot
The SDK download is a pre-built binary library. You need to download the source code version of Qt to be able to configure it to build as static libraries.
The configure script only comes with the source code download version.
I think the SDK only provides the headers and libraries hence the reason you can build applications using Qt. To build Qt itself you will need the source package which is a different download.

How to install OpenCV 2.0 on win32

I need to install OpenCV on Win32. I do not have it installed currently. I downloaded OpenCV-2.0.0a-win32.exe and ran it. What the heck do I do now? There are no .lib's and whatnot.
I found some instructions for building the release using cmake at http://opencv.willowgarage.com/wiki/InstallGuide . I downloaded the latest and greatest cmake, and tried to follow the instructions, but I was guessing. No joy.
I specified VC++9 when I did the "configure," but cmake built a VC++ 6 dsw file. No vcproj. I converted the dsw into a vc++9 vcproj anyway, just to see if it would work. Nope. It compiled lots of files, but many failed because it could not find omp.h. Sure enough, it's not there, anywhere. The build log said, 'A tool returned an error code from "Performing Custom Build Step".'
I am lost.
Ideally, I would like to find a full installation with all the files pre-built for Win32 vc++ 2008. Failing that, I need instructions that even I can follow. Short sentences and small words, but lots of them.
Please help!
UPDATE: I tried to build just CXCORE. It complained, "cannot open file 'VCOMPD.lib'" There's that OMP again.
For version 2.0, you must build the project from source.
Here's what you will need:
The OpenCV installer.
CMake. Here's the CMake installer.
Instructions for using CMake to install OpenCV-2.0.01-win32. Those instructions need an extra step if you are using a vc++ Express edition. In that case you must un-check ENABLE_OPENMP when running the CMake GUI.
Instructions for setting up an application project. (Thanks to mloskot for this find.)
If you've installed OpenCV-2.0.0a-win32.exe then it will install pre-built DLLs and libs. Then you just have to follow the instructions in this tutorial.
I recommend that you wipe the folder you previously installed OpenCV2.0 in and reinstall it.
Update:
Well sorry it didn't work out. I suggest the following then: check out the latest version from the SVN repository, https://code.ros.org/svn/opencv/trunk/opencv with any SVN client - I use TortoiseSVN.
Then run CMake (I see you've already installed it) on the source folder and then compile the Solution file. This should work - it does for me.
I apologize for my old answer - I had started off with OpenCV a few months ago in the same way and assumed that downloading the Gold version would still work - apparently not.
OMP
The OMP issue may arise from the checked Enable OpenMP in the CMake config. Try unchecking that .. might solve your initial problem.
I followed Jive Dadson's procedure to get OpenCV2.0 to work on Visual Studio 2010 Express (disabled OMP).
All went good until compilation of the generated stuff in Debug and Release. In both cases got this error: "LINK : fatal error LNK1181: cannot open input file '../../lib/Release/cv200.lib'"
in debug the only difference is that the library is cv200d.lib.
EDIT: I solved by downloading the latest svn snapshot for OpenCV2.0. One additional thing on Vista/7: it may be good to execute CMake as administrator.
Download OpenCV installer for Windows
Read OpenCV-2.0.0a-win32.Readme.Please.txt
Follow OpenCV with Visual C++ 6.0, 2005 Express, and 2008 Express in order to create project using OpenCV

Resources