OpenCV 2.1 on NetBeans on Windows

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");
}

2 pensamientos en “OpenCV 2.1 on NetBeans on Windows”

  1. THANK YOU SIR! very helpful.
    clarification:

    » Libraries » cv210.dll, cvaux210.dll,
    cxcore210.dll, highgui210.dll
    select the “Add Library” option, and navigate to OpenCV2.1/bin folder they are in there 🙂

    Me gusta

  2. very nice
    helped me a lot

    one problem though

    i’m working with version 2.2 now

    and some of the dll are not availible anymore
    witch should i include?

    availible:
    msvcp100.dll
    msvcr100.dll
    opencv_calib3d220.dll
    opencv_contrib220.dll
    opencv_core220.dll
    opencv_features2d220.dll
    opencv_ffmpeg220.dll
    opencv_flann220.dll
    opencv_gpu220.dll
    opencv_highgui220.dll
    opencv_imgproc220.dll
    opencv_legacy220.dll
    opencv_ml220.dll
    opencv_objdetect220.dll
    opencv_ts220.dll
    opencv_video220.dll

    Me gusta

Deja un comentario

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s