1 inline 2 Mat Mat::clone() const 3 { 4 Mat m; 5 copyTo(m); 6 return m; 7 }
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 void Mat::copyTo( OutputArray _dst ) const 2 { 3 int dtype = _dst.type(); 4 if( _dst.fixedType() && dtype != type() ) 5 { 6 CV_Assert( channels() == CV_MAT_CN(dtype) ); 7 convertTo( _dst, dtype ); 8 return; 9 } 10 11 if( empty() ) 12