OpenCV
3.3.0
Open Source Computer Vision
|
In this tutorial you will learn how to:
biicode resolves and keeps track of dependencies and version compatibilities in C/C++ projects. Using biicode hooks feature, getting started with OpenCV in C++ and C is pretty straight-forward. Just write an include to OpenCV headers and biicode will retrieve and install OpenCV in your computer and configure your project.
Once biicode is installed, execute in your terminal/console:
Windows users also execute:
Now execute bii cpp:build
to build the project.
Find your binaries in the bin folder:
biicode works with include headers in your source-code files, it reads them and retrieves all the dependencies in its database. So it is as simple as typing:
in the headers of your .cpp
file.
To start a new project using OpenCV, execute:
The next line just creates a myuser/myblock folder inside "blocks" with a simple "Hello World" main.cpp into it. You can also do it manually:
Now replace your main.cpp contents inside blocks/myuser/myblock with your app code. Put the includes as:
If you type:
You will check that opencv/cv.h
is an "unresolved" dependency. You can find it with:
Now, you can just bii cpp:configure
and bii cpp:build
your project as described above.
To use regular include directives, configure them in your biicode.conf file. Let your includes be:
And write in your biicode.conf:
If you want to try or develop your application against OpenCV 2.4.10 and also against 3.0-beta, change it in your biicode.conf file, simply alternating track in your [requirements]
:
replace with:
Find the hooks and examples:
This is just an example of how can it be done with biicode python hooks. Probably now that CMake files reuse is possible with biicode, it could be better to implement it with CMake, in order to get more control over the build of OpenCV.
Installing OpenCV with biicode is straight forward for any OS.
Run any example like you just did with objdetect module from OpenCV, or develop your own application. It only needs a biicode.conf file to get OpenCV library working in your computer.
Switching between OpenCV versions is available too and effortless.
For any doubts or further information regarding biicode, suit yourselves at Stackoverflow, biicode’s forum or ask biicode, we will be glad to help you.