OpenCV/example
[OpenCV #4]관심 영역
baram4815
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;
}
반응형