Install OpenCV with Visual Studio

Install OpenCV with Visual Studio

In this article, we will study how to install Opencv3.2.0 with Visual Studio 2015 on the windows 10. But it is almost same for other versions.

To install the OpenCV, we can use OpenCV pre-built libraries or we can compile the latest source code (GitHub) to get the OpenCV libraries. In this article, I am going to use pre-built libraries of OpenCV to configure the visual studio.

Initial Perquisites:

  • Windows-10 (64-bit)
  • Visual Studio-2015
  • Pre-built OpenCV libraries

Installation and project creation steps:

Here I have assumed that you have already installed visual studio 2015 on your computer (Windows 10 – 64 bits). Now it’s time to download the Pre-built OpenCV libraries. You can download from the  SourceForge.

After downloading the “OpenCV-3.4.0-vc14_vc15.exe”, you need to double-click on it to extract the package. When you will double click on it, it asks to create the directory. Here I am creating a directory in my c drive: “C/ opencv3.2.



After the extraction of all the package, you need to set some environment variable.



After clicking on environment variable a popup window will be open. In popup windows, we will select variable “path” and add the new path of OpenCV compiler bin. The path will be relative to your created directory, here, it is  “C:\opencv3.2\opencv\build\x64\vc14\bin”.


Install OpenCV with Visual Studio


When we will click on edit button then again a popup window will open, where we will add the compiler bin path.



Now time to create OpenCV project, using the visual studio2015. In below Image, I am mentioning some image that describes the steps to create the new project.



After clicking the project button a popup window will open. In this window, you need to select application type win32 console and give the desired name to the project.



Now press the ok button, after pressing the ok button a popup window will open where you just only press the next button.



After pressing the next button, again a popup window will open where you will select application type console and press the finish button.



Finally, a project is created, now we need to include some required OpenCV header file and libraries. So first we need to go to project properties.


You can see the free trial of this video course “Getting Started with OpenCV in .NET“.

When you will click on properties button a popup window open where you need to add the header files and required libraries.

Add the path of below header files (Below path corresponding to my created directory).




Add the path of the required library which resides in OpenCV Directory.



When you will click on the additional library directories popup window open where copy the path of the library.


After adding the path need to write the name of the library in additional dependencies.


When you will click on the additional library directories popup window open where copy the path of the library.


Remember before building the project, we need to switch the compilation mode of visual studio X86 to X64.

This article is contributed by Nitesh Bhakta. If you like aticleworld and would like to contribute, you can also write an article and mail your article to [email protected]

Leave a Reply