------------------------------------------------------
opencv officail home
------------------------------------------------------
http://opencv.org/
------------------------------------------------------
download
------------------------------------------------------
http://opencv.org/downloads.html
1. extract donwload opencv package where do you want to install
- I used opencv 2.4.6
- My installation DIR is C:\opencv_2.4.6
- I test it under VC10
2. set opencv enviroment variable and add path
- open console then enter below command
$ setx -m OPENCV_DIR C:\opencv_2.4.6\build\x86\vc10
- add path
%OPENCV_DIR%\bin
3. create sample project in VS
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2mMsibnkxWj7OGaI1hOHXF6gTkr8eVaWGkL0XbHtkAc06udDqRsW-8nugkCbhd2_cIIuttfc2Yy2Jw1zGpyN5WnYhoJTw_pSjT1xQnCcQlGaTDeaubmxpAIaSygHaWNucm66bP4dGC4s/s400/opencv_sample_proj_01.png)
4. select property manager(?) tab and right click Debug | Win32 then add new project propery
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP34zBSteIais0GJFhbvQEbw_Lb1FFZcefcBOKgm6bZSM_yLUv5IgOt9SLxYBQU1Bdh3KF42VCiusz-fI53H8VV8_6csXnHTlAEqUVuWPAvq6LieFcUGvMOTJJF2AUwMQW-U4ewM5280s/s400/opencv_sample_proj_03.png)
6. right click the create property sheet, then select propery
7. move c/c++ then add additional include directory C:\opencv_2.4.6\build\include
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8gDK5hctWf64J5cR36qLQJIolE8R5LmQwWdy48K9tQ63xORkd_Kysxz7AIVbCmcOuWCRGWu_2etCnpcyyww9UJqcKrCHHCI9_AyvCX38ZMJCIw7nZE7VjPmXL5Kzu5OB76EzEtxWIO5I/s320/opencv_sample_proj_05.png)
8. move link, then add additional library directory C:\opencv_2.4.6\build\x86\vc10\lib
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinJ2_Yyoqz1H9s-qMTOV6DPirisTfmtZ-PgIpB1IgcagjCIvbfrm53-z4og0nu8DHk9Z9IzDy1WqqHOAe8ytocMWx750owsPcx6vkn-2uTQQJbIFqL6ts80HowYlH-Dud4hlk0Q0CEiE0/s320/opencv_sample_proj_06.png)
8. move link, input directory then add additional dependency and add below libs
opencv_core246d.lib
opencv_imgproc246d.lib
opencv_highgui246d.lib
opencv_ml246d.lib
opencv_video246d.lib
opencv_features2d246d.lib
opencv_calib3d246d.lib
opencv_objdetect246d.lib
opencv_contrib246d.lib
opencv_legacy246d.lib
opencv_flann246d.lib
opencv_imgproc246d.lib
opencv_highgui246d.lib
opencv_ml246d.lib
opencv_video246d.lib
opencv_features2d246d.lib
opencv_calib3d246d.lib
opencv_objdetect246d.lib
opencv_contrib246d.lib
opencv_legacy246d.lib
opencv_flann246d.lib
9 .make main functin as like below
#include "stdafx.h"
#include <opencv\cv.h>
#include <opencv\highgui.h>
#include <opencv\highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage * image = cvLoadImage("C:\\Hydrangeas.jpg", 1);
cvShowImage("test image", image);
cvWaitKey(0);
cvWaitKey(0);
cvReleaseImage(&image);
return 0;
}
}
then build and run