1、Mat(Rect)
重载与此处:
inline
Mat Mat::operator()( const Rect& roi ) const
{
return Mat(*this, roi);
}
Mat(*this, roi)函数定义:
/** @overload
@param m Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied by these constructors. Instead, the header pointing to m data or its sub-array is constructed and associated with it. The reference counter, if any, is incremented. So, when you modify the matrix formed using such a constructor, you also modify the corresponding elements of m . If you want to have an independent copy of the sub-array, use Mat::clone() .
@param roi Region of interest.
*/
Mat(const Mat& m, const Rect& roi);
概要解释:该方法用于提取图片中感兴趣区域(及参数矩形框内区域),提取的方式不是复制,而是指向原图的指针,后续对于该ROI进行操作,即可改变原图。常用于在一副大图片中将部分不需要的区域置零。