[OpenCV #4]관심 영역

OpenCV/example 2013. 2. 14. 19:19

1.관심 영역

2.Project.cpp

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

using namespace cv;

int main()
{
     Mat image = imread("sistar.jpg"); //Load image form disk
     if(!image.data) return -1; //Check image
     //Cut of picture
     Rect rect = Rect(100, 30, 500, 100); //Rectangle cut
     Mat image3;
     image(rect).copyTo(image3); //Copy of the image

     //Change the part of the picture inside the picture
     image(rect) *= 2;
     imshow("image changed", image);
 
     waitKey(0); //Wait for keystroke
     return 0;

}


반응형

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

[OpenCV #6]split and merge  (0) 2013.02.20
[OpenCV #5]cv::Mat 클래스,복사,픽셀 접근  (0) 2013.02.19
[OpenCV #3]Threshold  (0) 2013.02.14
[OpenCV #2]이미지에서 RGB 채널 분리  (1) 2013.02.14
[OpenCV #1]이미지 출력  (0) 2013.02.14