opencv学习日记——截图与深浅拷贝
一、图像处理结果
二、代码部分
#include<iostream>
#include<opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat img0 = imread("nazha.jpg");
Mat img;
resize(img0, img, Size(800, 600));
Mat img1 = imread("cat.jpg");
Mat rot1, rot2, rot2_ropy, mask, img2, img_copy, img_copy2;
resize(img1, mask, Size(200, 200));
img2 = img;
img.copyTo(img_copy);
copyTo(img, img_copy2, img);
Rect rect(206, 206, 200, 200);
rot1 = img(rect);
rot2 = img(Range(300, 500), Range(300, 500));
mask.copyTo(rot1);
circle(img, Point(300, 300), 20, Scalar(0, 0, 255), -1);
imshow("rot1", rot1);
imshow("rot2", rot2);
imshow("mask", mask);
imshow("img2", img2);
imshow("img_copy", img_copy);
imshow("img_copy2", img_copy2);
waitKey(0);
return 0;
}