Installing OpenCV 2.3 in Windows 7, 64 bit edition

July 8, 2011

I may be reinventing the wheel here but I never found a reliable web source that clearly explains OpenCV 2.3 installation for Windows 64bit except for information posted on mailing lists.

The current version of OpenCV is easier to install compared to the previous versions.

The *.exe file for extracting the source files and pre-build files can be downloaded from here. After downloading the file, you may use the following window to extract the files to a directory of your choice:

Extract window

After extracting the files, open the “read me”  file inside the opencv directory.

Refer to the notes section where it asks to set the environment variables before you start.

Go to Computer and select “System Properties”—> Advanced System Settings —> Environment Variables.


Select Path and edit your environment variables:

Add the environment variables as follows to the existing configuration:


Save the environment variables and proceed to generating the solution files for building the opencv libraries. A CMake compiler is necessary for generating the solution files. The Cmake compiler may be downloaded from here.

Provide the location of the OpenCV source code and the directory location for building the solution:

Click on Configure and Choose your platform as Visual Studio 10

Your window should appear something like this:

Choose Build_Examples and Install C_Examples and click on configure again. Click on Generate.

Now go to the directory where you chose to build your solution files and open OpenCV.sln using visual studio. Wait for the file to parse and select Build  –> Build Solution:

Your build should have succeeded. Building the first OpenCV tutorial is as same as the earlier versions but ensure that you include the following directories as mentioned in the read me file.

There are several tutorials to write your first OpenCV based program. It would be just redundant to write one again.

The two documents that I always prefer are those written by Nashruddin and Utkarsh Sinha.

In the days to come, I will post about a machine learning technique using OpenCV!