본문 바로가기
Computer/OpenCV

OpenCV_001_Install

by DogBull 2008. 7. 18.
1. http://sourceforge.net/projects/opencvlibrary 에서 설치파을 다운 가능.

2. 설치

3. VS에서 Include, Lib 경로 설정
  include
    c:/ program files/ OpenCV/ cxcore/ include
    c:/ program files/ OpenCV/ cv/ include
    c:/ program files/ OpenCV/ otherlibs/ highgui
    c:/ program files/ OpenCV/ otherlibs/cvcam/ include

  lib
    c:/ program files/ OpenCV/ lib

4. VS 프로젝트에 라이브러리 추가
   cxcore.lib
   cv.lib
   highgui.lib
   cvcam.lib

5. 동적 링크 라이브러리
   cv097.dll
   cxcore097.dll
   cvcam097.dll
   highgui097.dll

6. 헤더추가
   #include <cv.h>
   #include <cxcore.h>
   #include <highgui.h>

7. 코딩예제

#include <cv.h>
#include <highgui.h>

#pragma comment(lib, "cxcore.lib")
#pragma comment(lib, "cv.lib")
#pragma comment(lib, "highgui.lib")
#pragma comment(lib, "cvcam.lib")

const static char gWinName[]= "NoName";

void main(){
    IplImage* image= NULL;
    image= cvLoadImage("./Media/수련.jpg", 1);

    cvNamedWindow(gWinName, 1);
    cvShowImage(gWinName, image);
    cvWaitKey(0);

    cvDestroyWindow(gWinName);
}

'Computer > OpenCV' 카테고리의 다른 글

OpenCV_002_ToGray  (0) 2008.07.19
1. OpenCV 설명 및 셋팅  (0) 2007.07.31