Computer Vision/OpenCV

[OpenCV] Image Resize

Kanais 2015. 4. 21. 19:48



개발환경

사용툴       : Visual Studio 2013

라이브러리 : openCV library 2.4.10

프로젝트    : Visual C++ console application

개발날짜    : 2015-04-21


참고 : Stack Overflow - How to resize an image to a specific size in OpenCV?




void FaceDetection::Haar_FaceDetection(const char* filename)

{

       CvCapture* capture;

 

       capture = cvCaptureFromFile(filename);

 

       assert(capture != NULL);

 

       IplImage* bgr_frame;// = cvQueryFrame(capture);

 

        while ((bgr_frame = cvQueryFrame(capture)) != NULL)

        {

           IplImage* resize_img = cvCreateImage(cvSize(2048, 1024), bgr_frame->depth, bgr_frame->nChannels);

           cvResize(bgr_frame, resize_img, CV_INTER_LINEAR);

        }

}