- Microsoft Visual Studio 2008
- OpenCV 2.1.0 Windows Executable Install
- Memulai Object baru dengan (Start->All Programs --> Microsoft Visual Studio 2008
- File --> New --> Project --> Win 32 Console Aplication
- Name:'OpenCV_Helloworld' ...'OK'....'Finish'
- Configure Project Directory
- Tools -> Options -> Projects and Solutions -> VC++ Directories
- Include Directories... add: 'C:\OpenCV2.1\include\opencv
- Library Directories... add: 'C:\OpenCV2.1\lib
- Source Directories... add: 'C:\OpenCV2.1\src\cv; C:\OpenCV2.1\src\cvaux; C:\OpenCV2.1\src\cxcore; C:\OpenCV2.1\src\highgui; C:\OpenCV2.1\src\ml
- Linker -> Input -> Additional Dependencies
- Buat Isi dari "OpenCV_Helloworld.cpp" seperti berikut:
#include
#include
#include
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("funny-pictures-cat-goes-pew.jpg");
cvNamedWindow("Image:",1);
cvShowImage("Image:",img);
cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
- Debug
No comments:
Post a Comment