0.4.3
ALSON::AlsonMat类 参考

#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 &)
 
AlsonMatoperator= (const AlsonMat &)
 
 AlsonMat (AlsonMat &&) noexcept
 
AlsonMatoperator= (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 cvMat(alsonMat.rows, alsonMat.cols, alsonMat.type, alsonMat.data());

使用如下示例代码可以将 cv::Mat 转换为 ALSON::AlsonMat

ALSON::AlsonMat alsonMat = ALSON::AlsonMat::create(cvMat.rows, cvMat.cols, cvMat.type(), cvMat.data);
static AlsonMat create(int rows, int cols, int type)
自从
0.3.0

在文件 AlsonMat.h132 行定义.

成员枚举类型说明

◆ Depth

矩阵深度类型

枚举值
DEPTH_8U 

8位无符号整型

DEPTH_8S 

8位有符号整型

DEPTH_16U 

16位无符号整型

DEPTH_16S 

16位有符号整型

DEPTH_32S 

32位有符号整型

DEPTH_32F 

单精度浮点型

DEPTH_64F 

双精度浮点型

DEPTH_16F 

16位浮点型

在文件 AlsonMat.h144 行定义.

构造及析构函数说明

◆ AlsonMat() [1/5]

ALSON::AlsonMat::AlsonMat ( )

创建一个空矩阵

自从
0.3.0

◆ AlsonMat() [2/5]

ALSON::AlsonMat::AlsonMat ( int r,
int c,
int t )

创建一个指定行、列、类型的矩阵

参数
r矩阵行数
c矩阵列数
t矩阵类型,同OpenCV,参考 AlsonMatType
自从
0.4.0

◆ AlsonMat() [3/5]

ALSON::AlsonMat::AlsonMat ( int r,
int c,
int t,
uint8_t * d )

创建一个指定行、列、类型、数据的矩阵

注意
使用该接口可以设置外部数据指针,但数据的生命周期不再由 AlsonMat 管理
参数
r矩阵行数
c矩阵列数
t矩阵类型,同OpenCV,参考 AlsonMatType
d矩阵数据
自从
0.4.0

◆ AlsonMat() [4/5]

ALSON::AlsonMat::AlsonMat ( const AlsonMat & )

◆ AlsonMat() [5/5]

ALSON::AlsonMat::AlsonMat ( AlsonMat && )
noexcept

◆ ~AlsonMat()

ALSON::AlsonMat::~AlsonMat ( )

成员函数说明

◆ operator=() [1/2]

AlsonMat & ALSON::AlsonMat::operator= ( const AlsonMat & )

◆ operator=() [2/2]

AlsonMat & ALSON::AlsonMat::operator= ( AlsonMat && )
noexcept

◆ create() [1/2]

static AlsonMat ALSON::AlsonMat::create ( int rows,
int cols,
int type )
static

创建一个指定行、列、类型的矩阵

参数
rows矩阵行数
cols矩阵列数
type矩阵类型,同OpenCV,参考 AlsonMatType
返回
矩阵
自从
0.3.0

◆ create() [2/2]

static AlsonMat ALSON::AlsonMat::create ( int rows,
int cols,
int type,
uint8_t * data )
static

创建一个指定行、列、类型的矩阵

参数
rows矩阵行数
cols矩阵列数
type矩阵类型,同OpenCV,参考 AlsonMatType
data矩阵数据
返回
矩阵
自从
0.3.0

◆ clone()

AlsonMat ALSON::AlsonMat::clone ( )

深拷贝当前矩阵对象

返回
矩阵
自从
0.4.0

◆ load()

static AlsonMat ALSON::AlsonMat::load ( const std::string & filename)
static

从本地图像文件中加载数据并构造一个矩阵

该接口支持加载常见的图像格式,包括 bmp、jpg、png、tiff 等

如下示例代码展示了该接口的用法

static AlsonMat load(const std::string &filename)
参数
filename本地图像路径
返回
矩阵
异常
CommonException
自从
0.4.0

◆ save()

void ALSON::AlsonMat::save ( const std::string & filename)

将当前矩阵作为图像保存到本地

该接口支持加载常见的图像格式,包括 bmp、jpg、png、tiff 等

如下示例代码展示了该接口的用法

m.save("./new_demo.png");
void save(const std::string &filename)
参数
filename本地图像路径
异常
CommonException
自从
0.4.0

◆ data()

uint8_t * ALSON::AlsonMat::data ( ) const
inline

获取矩阵数据指针

返回
矩阵数据指针
自从
0.3.0

在文件 AlsonMat.h427 行定义.

◆ setData()

void ALSON::AlsonMat::setData ( uint8_t * data)
inline

设置矩阵数据指针

注意
不建议直接使用该接口设置矩阵数据指针,建议使用 create(int rows, int cols, int type, uint8_t* data)
参数
data矩阵数据指针
自从
0.3.0

在文件 AlsonMat.h445 行定义.

类成员变量说明

◆ rows

int ALSON::AlsonMat::rows

矩阵的行数

自从
0.3.0

在文件 AlsonMat.h459 行定义.

◆ cols

int ALSON::AlsonMat::cols

矩阵的列数

自从
0.3.0

在文件 AlsonMat.h471 行定义.

◆ type

int ALSON::AlsonMat::type

矩阵的类型

自从
0.3.0

在文件 AlsonMat.h483 行定义.

◆ depth

int ALSON::AlsonMat::depth

矩阵的深度

自从
0.3.0

在文件 AlsonMat.h495 行定义.

◆ channels

int ALSON::AlsonMat::channels

矩阵的通道数

自从
0.3.0

在文件 AlsonMat.h507 行定义.

◆ elementSize

size_t ALSON::AlsonMat::elementSize

矩阵中每个元素的字节大小

自从
0.3.0

在文件 AlsonMat.h519 行定义.

◆ total

size_t ALSON::AlsonMat::total

矩阵中元素的数量

自从
0.3.0

在文件 AlsonMat.h531 行定义.

My Custom Doxygen Footer
Data Processing Programmer's Guide 0.4.3
Copyright © 2014-2024 Henan Alson Intelligent Technology Co, Ltd 河南埃尔森智能科技有限公司 版权所有 豫ICP备15002212号