ViSP
2.10.0
|
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.1 and Visual Studio 2012 but should work with any other version as well.
There are different ways to get ViSP source code.
You can download the latest stable release as a zip.
When significant changes or bug fixes were introduced in the current developpement version of the source code, we provide snapshots.
If available, you can download a recent snapshot following the link.
You can also get the cutting-edge ViSP version from Subversion repository svn://scm.gforge.inria.fr/svn/visp/trunk/ViSP.
One way to do that under Windows is to install Subversion that comes with Cygwin installer that is available on https://cygwin.com/install.html
Once installed, to get ViSP source code run:
We suppose now that ViSP source is in a directory denoted <source_dir>, for example C:\ViSP\ViSP-2.10.0
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-2.10.0-build
.
C:\ViSP\ViSP-2.10.0-build
folder.C:\ViSP\ViSP-2.10.0-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.ViSP is interfaced with some 3rd party libraries. The complete list is provided here.
OpenCV-3.0.0-beta.exe
pre-build SDK in C:\OpenCV
. The installer opencv-3.0.0-beta.exe copied all the material in C:\OpenCV\opencv
.OpenCV_DIR
environment variable. Start up a command window (in your "Start" menu click on "Run" and type in cmd.exe
) and enter: OpenCVConfig.cmake
.OpenCV_DIR
environment variable. Click "Configure" button. As shown in the next image, a new red line indicating that OpenCV is found should appear.C:/OpenCV/opencv/build/x64/vc11/lib
folder.C:/ViSP/ViSP-2
.10.0-build folder you have the Visual Studio VISP.sln
generated solution file.C:/ViSP/ViSP-2
.10.0-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-install
folder.Debug
configuration.Release
settings. As shown in the next image, select the Release
configuration.C:/ViSP/ViSP-install/bin
folder you have two versions of ViSP DLL library; 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 set (images, models). These data set is provided as a compressed zip files.
C:/ViSP
.VISP_INPUT_IMAGE_PATH
. In our case, this variable should be set to C:\ViSP
. VISP_INPUT_IMAGE_PATH
by using command line option -i
<path
to
the
data
set>
. If you want to run <binary
dir>/example/device/display/Debug/displayGDI.exe, open a command window, enter in the right folder, and run: 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.