Programming/Image Processing

[OpenCV] 이미지 로드 + 출력예제 소스코드

DevMonster 2014. 2. 8. 02:29


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <opencv/cv.h>
#include <opencv/highgui.h>
 
using namespace std;
using namespace cv;
 
int main(void){
    char* imagename = "circuit/b.jpg";
    IplImage* circuit = cvLoadImage(imagename, CV_LOAD_IMAGE_COLOR);
 
    cvNamedWindow("Circuit", 1);        
    cvShowImage("Circuit", circuit);   // "Circuit" 이름과 동일한 Window에 circuit 이미지를 띄움
 
    cvWaitKey(0);                             // 키 입력을 기다리며 사진을 보여줌
 
    cvDestroyWindow("Circuit");        // 윈도우 해제
    cvReleaseImage(&circuit);           // 이미지 해제
 
    return 0;
}


728x90
반응형