一 Mat
Mat是什么?
Mat有什么好处?

cpp
class CV_EXPORTS Mat{
public:
...
int dims;//维数
int rows,cols;//行列数
uchar *data;//存储数据的指针
int *refcount;//引用计数
...
};
二 Mat属性

三 Mat拷贝

1 Mat浅拷贝
cpp
Mat A
A=imread(file,IMREAD_COLOR)
Mat B(A)
2 Mat深拷贝
cpp
cv::Mat::clone()
cv::Mat::copyTo()
copy()
cpp
import cv2
import numpy as np
img=cv2.imread('./2037548.jpg')
#浅拷贝
img2=img
#深拷贝
img3=img.copy()
img[10:100,10:100]=[0,0,255]
cv2.imshow('img',img)
cv2.imshow('img2',img2)
cv2.imshow('img3',img3)
cv2.waitKey(0)