Visual Servoing Platform
version 3.0.1
|
In this tutorial you will learn how to install ViSP from source on Windows with Visual C++. These steps have been tested on Windows 7 (64 bit), with CMake 3.3.2 and Visual Studio 2012 but should work with any other version as well.
ViSP is interfaced with several 3rd party libraries. The complete list is provided here. 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 material in C:\OpenCV\opencv
. C:\OpenCV\opencv\build\x86\vc12
and in C:\OpenCV\opencv\build\x64\vc12
for the Win64 compiler) and also libraries compatible with Visual C++ 2012 (in C:\OpenCV\opencv\build\x86\vc11
and in C:\OpenCV\opencv\build\x64\vc11
for the Win64 compiler). With any other compiler version you need to build yourself OpenCV from source.OpenCV_DIR
environment variable. Start up a command window (in your "Start" menu click on "Run" and type in cmd.exe
) 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
.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 a Visual Studio C++ solution that 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 Visual Studio VISP.sln
generated solution file.C:/ViSP/visp-build/VISP
.sln solution file. This action will open ViSP project in Visual Studio C++. As shown in the next image, by default, Visual Studio position the solution configuration to Debug
.C:/ViSP/visp-build/install
folder.Debug
configuration.Release
settings. As shown in the next image, select the Release
configuration.C:/ViSP/visp-build/install/bin
folder you have two versions of ViSP DLL libraries for each module; the one suffixed by "d" with debug information, the other one optimized with release compiler options.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 libraries, 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:
We recommand to install Git for Windows from https://git-for-windows.github.io/. This installation allows then to use git in a cmd.exe command dos shell.
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.