Mat::create
来源:互联网 发布:网络鬼差系统txt下载 编辑:程序博客网 时间:2024/05/29 20:01
Mat::create
Allocates new array data if needed.
- C++: void Mat::create(int rows, int cols, int type)
- C++: void Mat::create(Size size, int type)
- C++: void Mat::create(int ndims, const int* sizes, int type)
Parameters: - ndims – New array dimensionality.
- rows – New number of rows.
- cols – New number of columns.
- size – Alternative new matrix size specification: Size(cols, rows)
- sizes – Array of integers specifying a new array shape.
- type – New matrix type.
This is one of the key Mat methods. Most new-style OpenCV functions and methods that produce arrays call this method for each output array. The method uses the following algorithm:
- If the current array shape and the type match the new ones, return immediately. Otherwise, de-reference the previous data by calling Mat::release().
- Initialize the new header.
- Allocate the new data of total()*elemSize() bytes.
- Allocate the new, associated with the data, reference counter and set it to 1.
Such a scheme makes the memory management robust and efficient at the same time and helps avoid extra typing for you. This means that usually there is no need to explicitly allocate output arrays. That is, instead of writing:
you can simply write:
because cvtColor , as well as the most of OpenCV functions, calls Mat::create() for the output array internally.
- Mat::create
- Mat::create
- create .mat file
- opencv 3.0 Mat 初始化 eye ones zeros create randn
- MAT
- MAT
- Mat
- MAT
- Mat
- Mat
- mat
- mat
- MAT
- Mat
- MAT
- Mat
- Mat
- Mat
- HTML5应用——生日快乐动画之星星
- 全球网络拓扑图
- C#xml的压缩与解压还原(使用系统自带的压缩与解压)(源码分享)
- 使用telerik报表控件生成报表
- Glusterfs全局统一命名空间
- Mat::create
- 添加 和删除日历闹钟
- NAT后无法在内网通过外部IP访问内部服务的问题的详细说明
- mysql分屏显示结果
- c# 获取网页源代码(可解决某些页面乱码的问题)
- Joomla 模板常用技巧函数收集
- 每天悲催的十分钟
- 适当的休息一下, 适当的把注意力从程序离开,也挺好的
- ORA-01659:无法分配超出 4 的 MINEXTENTS (在表空间 SDE 中)