0.4.3
ALSON::ClassicDeviceController类 参考

#include <ClassicDeviceController.h>

Public 成员函数

 ClassicDeviceController ()=default
 
 ClassicDeviceController (const ClientContextPtr &clientContextPtr)
 
 ~ClassicDeviceController ()=default
 
 ClassicDeviceController (const ClassicDeviceController &)=default
 
ClassicDeviceControlleroperator= (const ClassicDeviceController &)=default
 
 ClassicDeviceController (ClassicDeviceController &&)=default
 
ClassicDeviceControlleroperator= (ClassicDeviceController &&)=default
 
void open ()
 
void close ()
 
bool isOpen ()
 
DeviceInfo getDeviceInfo ()
 
void setDeviceEventListener (const ClassicDeviceEventListenerPtr &deviceEventListenerPtr)
 
std::vector< AlsonMatcaptureSourceImage (bool isLatest)
 
std::vector< AlsonMatcaptureTextureImage (bool isLatest)
 
AlsonMat scan (bool isDepthMode)
 
AlsonMat grabTextureImage ()
 
std::vector< AlsonMatgrabSourceImages ()
 
PointCloud grabPointCloud ()
 
void setUserMask (const AlsonMat &left, const AlsonMat &right)
 
ClassicDeviceUtil createClassicDeviceUtil ()
 
AlsonMat getDeviceIntrinsics ()
 
PointUV pointXYZToUV (const PointXYZ &pointXYZ) const
 
PointUV pointXYZToUV (float x, float y, float z) const
 
std::vector< PointUVpointXYZToUV (const PointCloud &pointCloud) const
 
PointCloud addRGBForPointCloud (const PointCloud &pointCloud, const AlsonMat &textureImage) const
 
PointCloud addRGBAndNormalForPointCloud (const PointCloud &pointCloud, const AlsonMat &textureImage, double radiusSearch, int totalThreads=1) const
 
AlsonMat alignTextureImage (const AlsonMat &textureImage)
 
AlsonMat pointCloudToDepthImage (const PointCloud &pointCloud) const
 
PointCloud depthImageToPointCloud (const AlsonMat &depthImage) const
 
PointCloud alignPointCloud (const PointCloud &pointCloud) const
 

Protected 成员函数

virtual ClassicDeviceControllerImplPtr classicDeviceControllerImplPtr () const
 

详细描述

经典系列(A、C系列)设备控制器

ClassicDeviceController 包含基本的设备控制接口、数据获取接口、数据处理接口

自从
0.1.0

在文件 ClassicDeviceController.h42 行定义.

构造及析构函数说明

◆ ClassicDeviceController() [1/4]

ALSON::ClassicDeviceController::ClassicDeviceController ( )
default

◆ ClassicDeviceController() [2/4]

ALSON::ClassicDeviceController::ClassicDeviceController ( const ClientContextPtr & clientContextPtr)
explicit

◆ ~ClassicDeviceController()

ALSON::ClassicDeviceController::~ClassicDeviceController ( )
default

◆ ClassicDeviceController() [3/4]

ALSON::ClassicDeviceController::ClassicDeviceController ( const ClassicDeviceController & )
default

◆ ClassicDeviceController() [4/4]

ALSON::ClassicDeviceController::ClassicDeviceController ( ClassicDeviceController && )
default

成员函数说明

◆ operator=() [1/2]

ClassicDeviceController & ALSON::ClassicDeviceController::operator= ( const ClassicDeviceController & )
default

◆ operator=() [2/2]

ClassicDeviceController & ALSON::ClassicDeviceController::operator= ( ClassicDeviceController && )
default

◆ open()

void ALSON::ClassicDeviceController::open ( )

打开设备

注意
只有先调用该接口打开设备,才能调用其它与设备相关的接口
异常
ClientException
自从
0.1.0

◆ close()

void ALSON::ClassicDeviceController::close ( )

关闭设备

注意
关闭设备之后,下次再打开设备会比较耗时。通常情况下,并不需要关闭设备。如果确认长时间不再使用设备,就可以关闭设备
异常
ClientException
自从
0.1.0

◆ isOpen()

bool ALSON::ClassicDeviceController::isOpen ( )

判断设备是否已经打开

返回
返回 true 表示已经打开,返回 false 表示尚未打开
异常
ClientException
自从
0.1.0

◆ getDeviceInfo()

DeviceInfo ALSON::ClassicDeviceController::getDeviceInfo ( )

获取设备信息

返回
设备信息
异常
ClientException
自从
0.1.0

◆ setDeviceEventListener()

void ALSON::ClassicDeviceController::setDeviceEventListener ( const ClassicDeviceEventListenerPtr & deviceEventListenerPtr)

注册设备事件监听器

如果要注销监听器,传递 nullptr 即可

参数
deviceEventListenerPtr监听器指针
异常
ClientException
自从
0.4.0

◆ captureSourceImage()

std::vector< AlsonMat > ALSON::ClassicDeviceController::captureSourceImage ( bool isLatest)

采集原始图像

该接口返回左右相机采集的原始图像

参数
isLatest如果给定的参数值是 true,将采集最新的图像
返回
原始图像列表,按序存放左图像、右图像
异常
ClientException
自从
0.1.0
弃用
该接口可能会在未来的某个版本中弃用,请优先使用 grabSourceImages 接口

◆ captureTextureImage()

std::vector< AlsonMat > ALSON::ClassicDeviceController::captureTextureImage ( bool isLatest)

采集纹理图像

注意
该接口返回左右相机采集的对齐后的图像。其中,左图像(即返回列表中的第一张图像)和深度图(或有序点云)是一一对应的
参数
isLatest如果给定的参数值是 true,将采集最新的图像
返回
纹理图像列表,按序存放左图像、右图像
异常
ClientException
自从
0.1.0
弃用
该接口可能会在未来的某个版本中弃用,请优先使用 grabTextureImage 接口

◆ scan()

AlsonMat ALSON::ClassicDeviceController::scan ( bool isDepthMode)

执行扫描并获取点云或深度图

点云是三通道浮点数矩阵,深度图是单通道浮点数矩阵

注意
该接口返回的点云是对齐后的点云
参数
isDepthMode如果设置为 true 将返回深度图,否则返回点云
返回
点云或深度图
异常
ClientException
自从
0.1.0
弃用
该接口可能会在未来的某个版本中弃用,请优先使用 grabPointCloud 接口

◆ grabTextureImage()

AlsonMat ALSON::ClassicDeviceController::grabTextureImage ( )

采集纹理图像

对于双目设备,纹理图由左相机采集

注意
该接口返回的是未对齐的纹理图像
返回
纹理图像
异常
ClientException
自从
0.3.0

◆ grabSourceImages()

std::vector< AlsonMat > ALSON::ClassicDeviceController::grabSourceImages ( )

采集原始图像

该接口固定返回两张图像,分别是左右相机采集的原始图像

返回
原始图像
异常
ClientException
自从
0.3.0

◆ grabPointCloud()

PointCloud ALSON::ClassicDeviceController::grabPointCloud ( )

采集点云

注意
该接口返回的点云可能是有序点云,也有可能是无序点云
返回
点云
异常
ClientException
自从
0.3.0

◆ setUserMask()

void ALSON::ClassicDeviceController::setUserMask ( const AlsonMat & left,
const AlsonMat & right )

限定点云在指定的 mask 区域内生成

mask 矩阵的大小和左右相机的图像分辨率一致。在 mask 矩阵中,值为 0 的位置不生成点云。 如果指定的 mask 矩阵为空,则表示不限制 点云的生成范围。

参数
left左相机 mask
right右相机 mask
异常
ClientException
自从
0.4.0

◆ createClassicDeviceUtil()

ClassicDeviceUtil ALSON::ClassicDeviceController::createClassicDeviceUtil ( )

创建离线工具

离线工具可以在不连接设备的情况下,对数据进行处理

返回
离线工具
异常
ClientException
自从
0.4.0

◆ getDeviceIntrinsics()

AlsonMat ALSON::ClassicDeviceController::getDeviceIntrinsics ( )

获取设备内参矩阵

返回
内参矩阵
异常
ClientException
自从
0.4.0

◆ pointXYZToUV() [1/3]

PointUV ALSON::ClassicDeviceController::pointXYZToUV ( const PointXYZ & pointXYZ) const

计算指定点在未对齐纹理图上的坐标

参数
pointXYZ三维点坐标
返回
未对齐纹理图上的坐标
异常
ClientException
自从
0.4.0

◆ pointXYZToUV() [2/3]

PointUV ALSON::ClassicDeviceController::pointXYZToUV ( float x,
float y,
float z ) const

计算指定点在未对齐纹理图上的坐标

参数
xX 坐标
yY 坐标
zZ 坐标
返回
未对齐纹理图上的坐标
异常
ClientException
自从
0.4.0

◆ pointXYZToUV() [3/3]

std::vector< PointUV > ALSON::ClassicDeviceController::pointXYZToUV ( const PointCloud & pointCloud) const

将点云中的所有三维坐标转换为未对齐纹理图上的坐标

参数
pointCloud点云
返回
未对齐纹理图上的坐标
异常
ClientException
自从
0.4.0

◆ addRGBForPointCloud()

PointCloud ALSON::ClassicDeviceController::addRGBForPointCloud ( const PointCloud & pointCloud,
const AlsonMat & textureImage ) const

点云贴图

参数
pointCloud点云
textureImage未对齐的纹理图像
返回
贴图后的点云
异常
ClientException
自从
0.4.0

◆ addRGBAndNormalForPointCloud()

PointCloud ALSON::ClassicDeviceController::addRGBAndNormalForPointCloud ( const PointCloud & pointCloud,
const AlsonMat & textureImage,
double radiusSearch,
int totalThreads = 1 ) const

点云贴图并计算法向量

参数
pointCloud点云
textureImage未对齐的纹理图像
radiusSearch搜索半径
totalThreads线程数
返回
贴图并计算法向后的点云
异常
ClientException
自从
0.4.0

◆ alignTextureImage()

AlsonMat ALSON::ClassicDeviceController::alignTextureImage ( const AlsonMat & textureImage)

纹理图对齐

对齐后的纹理图与有序点云或深度图是一一对应的

参数
textureImage未对齐的纹理图像,通常是 grabTextureImage 返回的图像
返回
对齐后的纹理图像
异常
ClientException
自从
0.4.0
参见
pointCloudToDepthImage
depthImageToPointCloud
alignPointCloud

◆ pointCloudToDepthImage()

AlsonMat ALSON::ClassicDeviceController::pointCloudToDepthImage ( const PointCloud & pointCloud) const

将点云转换成深度图

深度图与对齐后的纹理图像是一一对应的

参数
pointCloud点云
返回
深度图
异常
ClientException
自从
0.4.0
参见
alignTextureImage

◆ depthImageToPointCloud()

PointCloud ALSON::ClassicDeviceController::depthImageToPointCloud ( const AlsonMat & depthImage) const

将深度图转换成点云

注意
转换后的点云为有序点云
参数
depthImage深度图
返回
有序点云
异常
ClientException
自从
0.4.0
参见
alignPointCloud

◆ alignPointCloud()

PointCloud ALSON::ClassicDeviceController::alignPointCloud ( const PointCloud & pointCloud) const

点云对齐

对齐后的点云是有序点云,有序点云的尺寸和纹理图像一致,有序点云与对齐后的纹理图像一一对应

如果我们知道纹理图上一个点的坐标为 (u,v),那么我们可以通过如下示例代码获取到它在有序点云中对应的三维点

或者也可以参照如下示例代码通过指针的方式获取三维点

ALSON::PointXYZ p = pointCloud.ptr<ALSON::PointXYZ>() + (v * pointCloud.width + u);
参数
pointCloud原始点云,通常是 grabPointCloud 接口返回的点云
返回
对齐后的点云
异常
ClientException
自从
0.4.0
参见
alignTextureImage

◆ classicDeviceControllerImplPtr()

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