I don't know much about what each process does. I have gone through several web sites and summarized the correct version,
- Download OpenCV 2.4.3
- Then extract it to any path you want.
- Let the path be C:\OpenCV
- Add following two environment variables under 'PATH'.
- User variables: ;C:\OpenCV\opencv\build\x86\vc10\bin
- System variables: ;C:\OpenCV\opencv\build\x86\vc10\bin
- Open Microsoft Visual Studio 2012.
- Start a new win32 console program.
- View >> Other Windows >> Property Manager.
- Double click on the 'Debug | win32'.
- Common Properties >> C/C++ >> General
- Add the following under the additional include directories,
- C:\OpenCV\opencv\build\include;
- Common Properties >> Linker >> General
- Add the following under Additional Library Directories,
- C:\OpenCV\opencv\build\x86\vc10\lib;
- Common Properties >> Linker >> Input
- Add the following under Additional Dependencies,
- opencv_core243d.lib;
- opencv_imgproc243d.lib;
- opencv_highgui243d.lib;
- opencv_ml243d.lib;
- opencv_video243d.lib;
- opencv_features2d243d.lib;
- opencv_calib3d243d.lib;
- opencv_objdetect243d.lib;
- opencv_contrib243d.lib;
- opencv_legacy243d.lib;
- opencv_flann243d.lib;
- Now click ok.
- Next I have downloaded two '.dll's which were missing,
http://www.mediafire.com/?115pz9e0xpa0059
Then I extracted them into,
C:\OpenCV\opencv\build\x86\vc10\bin - Finally run the following sample program to make sure that your configuration is successful.
#include "stdafx.h"
#include "opencv2/highgui/highgui.hpp"
/**
* @function main
*/
int main( int argc, const char** argv )
{
CvCapture* capture;
IplImage* frame = 0;
while (true)
{
//Read the video stream
capture = cvCaptureFromCAM(1);
frame = cvQueryFrame( capture );
// create a window to display detected faces
cvNamedWindow("Sample Program", CV_WINDOW_AUTOSIZE);
// display face detections
cvShowImage("Sample Program", frame);
int c = cvWaitKey(10);
if( (char)c == 27 ) { exit(0); }
}
// clean up and release resources
cvReleaseImage(&frame);
return 0;
}
Enjoy!!!
Reference:
- http://docs.opencv.org/opencv_tutorials.pdf
- http://karanjthakkar.wordpress.com/2012/11/21/usin-opencv-2-4-2-with-visual-studio-2012-on-windows-7-64-bit/