Step 1
Download OpenCV from here
unzip and change the name of opencv to OpenCV2.4.8
add to system path:
C:\OpenCV2.4.8\build\x64\vc10\bin
Step 2:
Open Visual Studio 2012 and create a new console win32 application preferrebly uncheck the precomplied hadear and security options
Go to BUILD -> Configuration Manager
Click on Win32 and create a new x64
Step 3:
Go to Project properties and add the following :
C/C++ -> Additional Include Directories
C:\OpenCV2.4.8\build\include\opencv;C:\OpenCV2.4.8\build\include;
Linker-> General -> Additional Library Dependencies
C:\OpenCV2.4.8\build\x64\vc10\lib
Linker->Input-> Additional Dependencies
Release mode:
opencv_core248.lib
opencv_imgproc248.lib
opencv_highgui248.lib
opencv_ml248.lib
opencv_video248.lib
opencv_features2d248.lib
opencv_calib3d248.lib
opencv_objdetect248.lib
opencv_contrib248.lib
opencv_legacy248.lib
opencv_flann248.lib
for Debug mode:
opencv_core248d.lib
opencv_imgproc248d.lib
opencv_highgui248d.lib
opencv_ml248d.lib
opencv_video248d.lib
opencv_features2d248d.lib
opencv_calib3d248d.lib
opencv_objdetect248d.lib
opencv_contrib248d.lib
opencv_legacy248d.lib
opencv_flann248d.lib
Step 4
Run this small snippet
#include "stdafx.h"
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/highgui/highgui.hpp>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("image.jpg");
cvNamedWindow("Image:",1);
cvShowImage("image:",img);
cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}