- If you do not have Visual C++ 2010 Express Edition, get it from http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express
- Get OpenCV from http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.2/
- Choose OpenCV-2.2.0-win32-vs2010.exe
- Install it following the easy instructions. (add the OpenCV path to the PATH variable when asked)
- First go to View in VC++ Express Edition and check whether the Property Manger is there. If not, go to Tools->Settings and choose Expert Settings.
- Next, choose Property Manager from View; this will open up Property Manager side-by-side with solution explorer and Class view.
- Right click on top of your project name and since this is first time, click "Add New Project Property Sheet" and give a suitable name for your property sheet.
- By double clicking on the file name open the newly created property file.
- In Common Properties->C++->General: Additional Include Directories enter
- <OpenCV2.2 directory>\include;
- In Linker->General: Additional LibraryDirectories enter
- <OpenCV2.2 directory>\lib
- In Input: Additional Dependencies enter
- opencv_core220d.lib;opencv_highgui220d.lib;opencv_video220d.lib;opencv_ml220d.lib;opencv_legacy220d.lib;opencv_imgproc220d.lib if you are in debug mode
- opencv_core220.lib;opencv_highgui220.lib;opencv_video220.lib;opencv_ml220.lib;opencv_legacy220.lib;opencv_imgproc220.lib if you are release mode
#include <stdio.h>
#include <highgui.h>
int main( int argc, char** argv )
{
IplImage* img = cvLoadImage( "c:/temp/abcs.jpg",1 );
cvNamedWindow("test", CV_WINDOW_AUTOSIZE );
cvShowImage("test", img );
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow("test");
}
No comments:
Post a Comment