OpenCV

NetBeans

First of all, try no to use Windows.

1. Make sure you got the following installed

  • C:\OpenCV2.1
  • C:\MinGW
  • C:\msys

2. Right click on your project and click in Properties and complete the following:

Build » C++ Compiler
   » Include Directories » C:/OpenCV2.1/include/opencv

Build » C++ Compiler » Include Directories » C:/OpenCV2.1/include/openc

   » Linker
      » Additional Library Directories » C:/OpenCV2.1/lib
      » Libraries » cv210.dll, cvaux210.dll,
                    cxcore210.dll, highgui210.dll

Build » Linker

3. Build your project.

Executable (*.exe) file will be generated and located in your project directory on the following path: dist/Debug/MinGW-Windows/

Use this simple code to test your recently set environment:

#include "highgui.h"

int main(int argc, char** argv){
   IplImage* img = cvLoadImage(argv[1]);
   cvNamedWindow("ImgViewer", CV_WINDOW_AUTOSIZE);
   cvShowImage("ImgViewer", img);
   cvWaitKey(0);
   cvReleaseImage(&img);
   cvDestroyWindow("ImgViewer");
}

Advertisement