Building and Installing OpenCV 2.x / 3.x with MSVS

Semantic Image Segmentation with Conditional Random Fields
User avatar
Creator
Posts: 157
Joined: Tue Dec 16, 2008, 20:52
Location: Hannover, Germany
Contact:

Building and Installing OpenCV 2.x / 3.x with MSVS

Postby Creator » Thu Dec 10, 2009, 19:36

I use OpenCV with MS Visual Studio. As it happen, one absolutely have to read buried in the download section readme, before doing anything. The thing is, OpenCV doesn’t include lib files for VS. They have to be built by user.
So here is step by step retelling of readme:
  1. Download and install OpenCV
  2. Download and install CMake
  3. Run cmake-gui.exe
  4. In the “Where is the source code” field choose your new OpenCV directory (C:\OpenCV\sources)
    In “Where to build the binaries” choose directory for VS compiled OpneCV (C:\OpenCV\builds)
  5. Press Configure button and choose Visual Studio 14 2015 or Visual Studio 14 2015 Win64 (or whatever) as building environment
  6. Press one more time Configure and then Generate, so the VS project will be generated in the C:\OpenCV\builds
  7. Open the solution and build it for Release and Debug configurations
  8. Build also the INSTALL project in the solution (again for Release and Debug configurations). That will copy OpenCV headers and binaries to C:\OpenCV\builds\install
  9. Now you can copy the content of the C:\OpenCV\builds\install to another folder, e.g. C:\OpenCV\build
  10. Reconfigure your application project:
    • Include directories are C:\OpenCV\build\include\opencv and C:\OpenCV\build\include\opencv2
    • Additional library directories are C:\OpenCV\build\[x86|x64]\vcXX\lib
    • The dll files are in C:\OpenCV\build\[x86|x64]\vcXX\bin

Return to “Direct Graphical Models”

Who is online

Users browsing this forum: No registered users and 32 guests