在opencv中,对于矩阵的处理过程几乎是不可能避开Mat矩阵这一数据类型的,而在创建Mat类型对象的过程中,我们会在某些初始化阶段需要设定type参数,这一参数规定了所生成矩阵对象内部存储的数据的相应属性。而涉及type属性的常用初始化方法如下:
Mat::Mat(int rows, int cols, int type)
Mat::Mat(Size size, int type)
Mat::Mat(int rows, int cols, int type, constScalar& s)
Mat::Mat(Size size, int type, constScalar& s)
Mat::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP)
Mat::Mat(Size size, int type, void* data, size_t step=AUTO_STEP)