Visual Servoing Platform
version 3.0.1
|
In this tutorial you will learn how to install ViSP from source on Windows 8.1 with Mingw-w64. These steps have been tested on Windows 8.1 (64 bit), with CMake 3.3.2 and Mingw-w64 - GCC for Windows 64 & 32 bits. It should also work under Windows 10.
Mingw-w64 could be found following http://mingw-w64.org/doku.php/download From that page, click on download "Win-builds" that will bring you to the page http://mingw-w64.org/doku.php/download/win-builds from where you can access to http://win-builds.org/doku.php/download_and_installation_from_windows Here simply download and run the package manager, in our case we downloaded win-builds-1.5.0.exe file.
C:\mingw
as in the following image: MINGW_DIR
environment variable to your installation location in order to allow CMake to detect 3rd party libraries that come with Mingw installer. Fo example, if you install Mingw in C:\folder\mingw-w64
, setting MINGW_DIR
is simply done running in a cmd terminal: C:\mingw\bin
folder to the PATH variable. To this end open a cmd terminal and do the following: CMake 2.8.3 or higher that could be download at : http://www.cmake.org.
cmake-x.y.z-win32-x86.exe
you downloaded.ViSP is interfaced with several 3rd party libraries. The complete list is provided here. Some of them are automatically detected since they are part of MinGW distribution. Other may be installed from source. We recommend to install the following:
We recommend to install OpenCV.
opencv-3.0.0.exe
pre-build SDK in C:\OpenCV
. The installer opencv-3.0.0.exe extracted all the prebuilt binaries, but also the source code in C:\OpenCV\opencv
.<source_dir>
we will set C:\OpenCV\opencv\sources
and as <binary_dir>
we set C:\OpenCV\opencv\sources\build-mingw
. C:\OpenCV\opencv\sources\build-mingw
folder.C:\OpenCV\opencv\build
folder. This is the location of the pre-build libraries that come with the installer. Doing that, allows to install OpenCV libraries in a same parent folder. <binary_dir>
folder and start mingw32-make OpenCV_DIR
environment variable. Start up cmd terminal and enter: C:\OpenCV\opencv\build
is where you have the build directory (extracted or built). Inside this folder you should have a file named OpenCVConfig.cmake
.OpenCVConfig.cmake
.There are different ways to get ViSP source code.
We suppose now that ViSP source is in a directory denoted <source_dir>
, for example C:\ViSP\visp
The goal of the configuration step is now to use CMake to produce all the material requested to build ViSP with Mingw. This material will be located in <binary_dir>
, for example C:\ViSP\visp-build
.
<source_dir>
and <binary_dir>
locations as in the next image. C:\ViSP\visp-build
folder.C:\ViSP\visp-build\install
. C:/Program
Files
(x86)/ViSP, make sure that you have administrator privileges to write in that folder.
.dll extension). This is the default configuration that is recommended. If you want to create rather a static library (with
.lib extension) you have to uncheck the BUILD_SHARED_LIBS
option to disable DLL creation.C:/ViSP/visp-build
folder you have the Makefile file that will be used by Mingw to build the entire project.C:\ViSP\visp-build
folder and run mingw32-make: C:/ViSP/visp-build/install/x64/mingw/bin
folder you will find ViSP DLL libraries corresponding to the build modules. If you built static libraries then you are done. Otherwise, if you follow this tutorial step by step you need to add the bin folders path to the systems path. This is because you will use ViSP and OpenCV libraries in form of "Dynamic-link libraries" (also known as DLL). Inside these are stored all the algorithms and information the libraries contains. The operating system will load them only on demand, during runtime. However, to do this he needs to know where they are. The systems PATH
variable contains a list of folders where DLLs can be found. Add ViSP and OpenCV libraries path to this and the OS will know where to look if he ever needs the libraries. Otherwise, you will need to copy the used DLLs right beside the applications executable file (exe) for the OS to find it.
To modify the PATH var and add the path to ViSP library, open a cmd terminal and run:
Then to add the path to OpenCV 3rd party library, close and re-open a cmd-terminal and run:
Then close and re-open a cmd terminal to check if the PATH var was well positioned
Some ViSP examples and tests require data (images, video, models) that are not part of ViSP source code but available in a separate archive named ViSP-images-x.y.z.zip
. This archive could be downloaded from http://visp.inria.fr/download page. We provide here after the way to install these data if you want to run ViSP examples.
Download ViSP-images-x.y.z.zip from http://visp.inria.fr/download and uncompress it for example in C:/ViSP
.
We suppose now that the data are located in C:/ViSP/ViSP-images
.
ViSP examples and tests are able to detect automatically the location of the requested data if you position an environment variable called VISP_INPUT_IMAGE_PATH
. In our case, this variable should be set to C:\ViSP
.
VISP_INPUT_IMAGE_PATH
should not contain the folder ViSP-images
, but the parent folder.From now, you can try to run ViSP examples and tests. For example, if you want to run <binary
dir>/example/device/display/Debug/displayGDI.exe, open a command window, enter in the right folder, and run:
If you encounter the following issue during CMake configuration
Edit C:\OpenCV\opencv\sources\CMakeLists.txt file, and line 464 replace:
by:
If you encounter a build issue during libtiff build as given in the next image:
The following image shows the link issue that may appear when building OpenCV with mingw:
A work arround is to configure OpenCV without ipp support turning WITH_IPP=OFF and then trying to build again.
This error that occurs with OpenCV 3.0.0 during cap_dshow.cpp
build is known and reported as an issue in https://github.com/Itseez/opencv/pull/5282/commits.
modules/videoio/src/cap_dshow.cpp
by adding near line 96: C:\OpenCV\opencv\sources\cmake\OpenCVConfig.cmake
, and line 89 replace: You are now ready to see the next Tutorial: How to create and build a CMake project that uses ViSP on Unix or Windows that will show you how to use ViSP as a 3rd party to build your own project.