标签:for share 初始化 inter some push sample int one
Mat is some kind of smart pointer for the pixels
Mat a=b will have shared pixels for a and b. similar situation for push_back()
if you need a ‘deep copy‘, use Mat::clone()
所以在初始化含Mat的容器时要用以下代码:
vector<cv::Mat> fims;
for (int numMat = 0; numMat < 6; numMat++) {
cv::Mat fim(m_hSample, m_wSample, CV_32FC3);
fims.push_back(fim);
}
标签:for share 初始化 inter some push sample int one
原文地址:https://www.cnblogs.com/amarr/p/10768839.html