![]() |
0.4.3
|
|
#include <AlsonMat.h>
Public 类型 | |
| enum | Depth { DEPTH_8U = 0 , DEPTH_8S = 1 , DEPTH_16U = 2 , DEPTH_16S = 3 , DEPTH_32S = 4 , DEPTH_32F = 5 , DEPTH_64F = 6 , DEPTH_16F = 7 } |
Public 成员函数 | |
| AlsonMat () | |
| AlsonMat (int r, int c, int t) | |
| AlsonMat (int r, int c, int t, uint8_t *d) | |
| AlsonMat (const AlsonMat &) | |
| AlsonMat & | operator= (const AlsonMat &) |
| AlsonMat (AlsonMat &&) noexcept | |
| AlsonMat & | operator= (AlsonMat &&) noexcept |
| ~AlsonMat () | |
| AlsonMat | clone () |
| void | save (const std::string &filename) |
| uint8_t * | data () const |
| void | setData (uint8_t *data) |
静态 Public 成员函数 | |
| static AlsonMat | create (int rows, int cols, int type) |
| static AlsonMat | create (int rows, int cols, int type, uint8_t *data) |
| static AlsonMat | load (const std::string &filename) |
Public 属性 | |
| int | rows |
| int | cols |
| int | type |
| int | depth |
| int | channels |
| size_t | elementSize |
| size_t | total |
Alson矩阵类,实现矩阵的读取、保存、遍历等操作
它可用于存储向量和矩阵、灰度或彩色图像,这是一个简化版的 cv::Mat
使用如下示例代码可以将 ALSON::Alson 转换为 cv::Mat
使用如下示例代码可以将 cv::Mat 转换为 ALSON::AlsonMat
在文件 AlsonMat.h 第 132 行定义.
矩阵深度类型
| 枚举值 | |
|---|---|
| DEPTH_8U | 8位无符号整型 |
| DEPTH_8S | 8位有符号整型 |
| DEPTH_16U | 16位无符号整型 |
| DEPTH_16S | 16位有符号整型 |
| DEPTH_32S | 32位有符号整型 |
| DEPTH_32F | 单精度浮点型 |
| DEPTH_64F | 双精度浮点型 |
| DEPTH_16F | 16位浮点型 |
在文件 AlsonMat.h 第 144 行定义.
| ALSON::AlsonMat::AlsonMat | ( | ) |
创建一个空矩阵
| ALSON::AlsonMat::AlsonMat | ( | int | r, |
| int | c, | ||
| int | t ) |
| ALSON::AlsonMat::AlsonMat | ( | int | r, |
| int | c, | ||
| int | t, | ||
| uint8_t * | d ) |
创建一个指定行、列、类型、数据的矩阵
| r | 矩阵行数 |
| c | 矩阵列数 |
| t | 矩阵类型,同OpenCV,参考 AlsonMatType |
| d | 矩阵数据 |
| ALSON::AlsonMat::AlsonMat | ( | const AlsonMat & | ) |
|
noexcept |
| ALSON::AlsonMat::~AlsonMat | ( | ) |
|
static |
|
static |
| AlsonMat ALSON::AlsonMat::clone | ( | ) |
深拷贝当前矩阵对象
|
static |
从本地图像文件中加载数据并构造一个矩阵
该接口支持加载常见的图像格式,包括 bmp、jpg、png、tiff 等
如下示例代码展示了该接口的用法
| filename | 本地图像路径 |
| void ALSON::AlsonMat::save | ( | const std::string & | filename | ) |
将当前矩阵作为图像保存到本地
该接口支持加载常见的图像格式,包括 bmp、jpg、png、tiff 等
如下示例代码展示了该接口的用法
| filename | 本地图像路径 |
|
inline |
|
inline |
设置矩阵数据指针
| data | 矩阵数据指针 |
在文件 AlsonMat.h 第 445 行定义.
| int ALSON::AlsonMat::rows |
| int ALSON::AlsonMat::cols |
| int ALSON::AlsonMat::type |
| int ALSON::AlsonMat::depth |
| int ALSON::AlsonMat::channels |
| size_t ALSON::AlsonMat::elementSize |
| size_t ALSON::AlsonMat::total |