OpenCV 4.11.0
开源计算机视觉
加载中...
搜索中...
无匹配项
cv::cann 命名空间参考

类  AscendEvent
 AscendEvent 用于不同流之间的同步。更多...
 
结构体  AscendEventAccessor
 此类允许从cann::AscendEvent 获取 aclrtAscendEvent。更多...
 
类  AscendMat
 
结构体  AscendPicDesc
 
类  AscendStream
 在 AscendCL 中,Stream (AscendStream) 是一个任务队列。Stream 用于管理任务的并行性。一个 Stream 内的任务按顺序执行,即 Stream 根据发送的任务顺序依次执行;不同 Stream 中的任务并行执行。更多...
 
结构体  AscendStreamAccessor
 此类允许从cann::AscendStream 获取 aclrtAscendStream。更多...
 
结构体  AscendTensor
 call_call 接口的参数类型。更多...
 
类  DvppOperatorDesc
 调用 DVPP 算子描述符的接口。这里的 DVPP VPC 接口均为 v2 版本。支持的设备:Atlas 推理系列产品、Atlas 200/500 A2 推理产品和 Atlas A2 训练系列产品/Atlas 300I A2 推理产品。更多...
 
类  OperatorRunner
 调用 CANN 包中算子的接口。更多...
 

枚举

枚举  InterpolationFlags {
  INTER_NEAREST = 0 ,
  INTER_LINEAR = 1 ,
  INTER_CUBIC = 2 ,
  INTER_AREA = 3 ,
  INTER_MAX = 7
}
 插值算法 更多...
 

函数

void aclrtFreeWarpper (void *data)
 
void aclrtMallocWarpper (void **data, size_t size)
 
void aclrtMemcpy2dWarpper (std::shared_ptr< uchar > &dst, size_t offset, size_t dpitch, const void *src, size_t spitch, size_t width, size_t length, AscendStream &stream)
 
void aclrtMemcpy2dWarpper (void *dst, size_t dpitch, const std::shared_ptr< uchar > &src, size_t offset, size_t spitch, size_t width, size_t length, AscendStream &stream)
 
void aclrtMemcpyWarpper (std::shared_ptr< uchar > &dst, size_t dstOffset, const std::shared_ptr< uchar > &src, size_t srcOffset, size_t size, AscendStream &stream)
 
void aclrtMemcpyWarpper (std::shared_ptr< uchar > &dst, size_t offset, const void *src, size_t size, AscendStream &stream)
 
void aclrtMemcpyWarpper (void *dst, const std::shared_ptr< uchar > &src, size_t offset, size_t size, AscendStream &stream)
 
void aclrtMemsetWarpper (std::shared_ptr< uchar > &ptr, int32_t value, size_t count, AscendStream &stream)
 
void add (const AscendMat &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void add (const AscendMat &src1, const Scalar &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void add (const InputArray src1, const InputArray src2, OutputArray dst, const InputArray mask=noArray(), int dtype=-1, AscendStream &stream=AscendStream::Null())
 计算矩阵-矩阵或矩阵-标量的和。
 
void add (const Scalar &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void addWeighted (const AscendMat &src1, double alpha, const AscendMat &src2, double beta, double gamma, AscendMat &dst, int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void addWeighted (const InputArray src1, double alpha, const InputArray src2, double beta, double gamma, OutputArray dst, int dtype=-1, AscendStream &stream=AscendStream::Null())
 计算两个数组的加权和。
 
void arithm_op (const AscendMat &src, AscendMat &dst, const char *op, AscendStream &stream)
 
void arithm_op (const AscendMat &src, const Scalar &sc, AscendMat &dst, const char *op, AscendStream &stream)
 
void arithm_op (const AscendMat &src, float scalar, AscendMat &dst, const char *op, AscendStream &stream)
 
void arithm_op (const AscendMat &src1, const AscendMat &src2, AscendMat &dst, const char *op, AscendStream &stream)
 
void arithm_op (const Scalar &sc, const AscendMat &src, AscendMat &dst, const char *op, AscendStream &stream)
 
void bitwise_and (const AscendMat &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void bitwise_and (const AscendMat &src1, const Scalar &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void bitwise_and (const InputArray src1, const InputArray src2, OutputArray dst, const InputArray mask=noArray(), AscendStream &stream=AscendStream::Null())
 对两个矩阵(或矩阵和标量)执行逐元素按位与运算。
 
void bitwise_and (const Scalar &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void bitwise_not (const AscendMat &src, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void bitwise_not (const InputArray src, OutputArray dst, const InputArray mask=noArray(), AscendStream &stream=AscendStream::Null())
 执行逐元素按位非运算。
 
void bitwise_or (const AscendMat &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void bitwise_or (const AscendMat &src1, const Scalar &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void bitwise_or (const InputArray src1, const InputArray src2, OutputArray dst, const InputArray mask=noArray(), AscendStream &stream=AscendStream::Null())
 对两个矩阵(或矩阵和标量)执行逐元素按位或运算。
 
void bitwise_or (const Scalar &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void bitwise_xor (const AscendMat &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void bitwise_xor (const AscendMat &src1, const Scalar &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void bitwise_xor (const InputArray src1, const InputArray src2, OutputArray dst, const InputArray mask=noArray(), AscendStream &stream=AscendStream::Null())
 执行两个矩阵(或矩阵和标量)的逐元素按位异或运算。
 
void bitwise_xor (const Scalar &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), AscendStream &stream=AscendStream::Null())
 
void checkAclError (aclError err, const char *file, const int line, const char *func)
 
void checkAclPtr (void *ptr, const char *file, const int line, const char *func)
 
void copyMakeBorder (const AscendMat &src, AscendMat &dst, int top, int bottom, int left, int right, int borderType, const Scalar &value=Scalar())
 
void copyMakeBorder (const InputArray src, OutputArray dst, int top, int bottom, int left, int right, int borderType, const Scalar &value=Scalar())
 在输入图像副本周围形成边界并使用指定的边界类型填充它。
 
void crop (const AscendMat &src, AscendMat &dst, const AscendMat &sizeSrcNpu, int64_t *offset, AscendStream &stream)
 
AscendMat crop (const AscendMat &src, const Rect &rect, AscendStream &stream=AscendStream::Null())
 
AscendMat crop (InputArray src, const Rect &rect, AscendStream &stream=AscendStream::Null())
 裁剪二维数组。该函数使用给定的cv::Rect裁剪矩阵。输出矩阵的深度必须与输入矩阵相同,大小由给定的矩形大小指定。
 
void cropResize (const AscendMat &src, AscendMat &dst, const Rect &rect, Size dsize, double fx, double fy, int interpolation)
 
void cropResize (const InputArray src, OutputArray dst, const Rect &rect, Size dsize, double fx, double fy, int interpolation)
 从大的图像中裁剪一个子图像,并将其调整为特定大小。
 
void cropResizeMakeBorder (const AscendMat &src, AscendMat &dst, const Rect &rect, Size dsize, double fx, double fy, int interpolation, int top, int left, const int borderType, Scalar value=Scalar())
 
void cropResizeMakeBorder (const InputArray src, OutputArray dst, const Rect &rect, Size dsize, double fx, double fy, int interpolation, int top, int left, const int borderType, Scalar value=Scalar())
 从大的图像中裁剪一个子图像,将其调整为特定大小,并在顶部/左侧形成边界并使用指定的边界类型填充它。
 
void cvtColor (const AscendMat &src, AscendMat &dst, int code, int dstCn=0, AscendStream &stream=AscendStream::Null())
 
void cvtColor (const InputArray src, OutputArray dst, int code, int dstCn=0, AscendStream &stream=AscendStream::Null())
 转换图像的颜色空间。
 
void divide (const AscendMat &src1, const AscendMat &src2, AscendMat &dst, float scale=1, int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void divide (const AscendMat &src1, const Scalar &src2, AscendMat &dst, float scale=1, int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void divide (const InputArray src1, const InputArray src2, OutputArray dst, float scale=1, int dtype=-1, AscendStream &stream=AscendStream::Null())
 计算矩阵与矩阵或矩阵与标量的除法。
 
void divide (const Scalar &src1, const AscendMat &src2, AscendMat &dst, float scale=1, int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void finalizeAcl ()
 结束AscendCL。
 
void finalizeDvpp ()
 结束DVPP系统。
 
void flip (const AscendMat &src, AscendMat &dst, int flipCode, AscendStream &stream=AscendStream::Null())
 
void flip (const AscendMat &src, std::vector< int32_t > &asixs, AscendMat &dst, AscendStream &stream)
 
void flip (InputArray src, OutputArray dst, int flipCode, AscendStream &stream=AscendStream::Null())
 沿垂直轴、水平轴或两个轴翻转二维矩阵。
 
aclDataType getACLType (int opencvdepth)
 opencv和cann之间的类型映射。
 
int32_t getDevice ()
 获取当前Ascend设备。
 
AscendMat getInputMat (InputArray src, AscendStream &stream)
 从输入数组获取Ascend矩阵对象,如有需要则上传矩阵内存。(非阻塞调用)
 
AscendMat getOutputMat (OutputArray dst, int rows, int cols, int type, AscendStream &stream)
 从输出数组获取Ascend矩阵对象,如有需要则上传矩阵内存。
 
void initAcl ()
 初始化AscendCL。
 
void initDvpp ()
 初始化DVPP系统。
 
template<typename KERNEL_TYPE , typename TILING_TYPE , typename... ARGS>
void kernel_launch (KERNEL_TYPE kernel, AscendStream &stream, TILING_TYPE &tiling, ARGS... args)
 
std::shared_ptr< ucharmallocAndUpload (const void *data, size_t size, AscendStream &stream, AscendMat::Allocator *allocator)
 为设备分配内存并上传原始数据。
 
void merge (const AscendMat *src, size_t n, AscendMat &dst, AscendStream &stream=AscendStream::Null())
 将多个单通道矩阵组合成一个多通道矩阵。
 
void merge (const AscendMat *src, size_t n, OutputArray &dst, AscendStream &stream=AscendStream::Null())
 
void merge (const std::vector< AscendMat > &src, AscendMat &dst, AscendStream &stream=AscendStream::Null())
 
void merge (const std::vector< AscendMat > &src, OutputArray &dst, AscendStream &stream=AscendStream::Null())
 
void multiply (const AscendMat &src1, const AscendMat &src2, AscendMat &dst, float scale=1, int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void multiply (const AscendMat &src1, const Scalar &src2, AscendMat &dst, float scale=1, int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void multiply (const InputArray src1, const InputArray src2, OutputArray dst, float scale=1, int dtype=-1, AscendStream &stream=AscendStream::Null())
 计算矩阵与矩阵或矩阵与标量的逐元素乘积。
 
void multiply (const Scalar &src1, const AscendMat &src2, AscendMat &dst, float scale=1, int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void resetDevice ()
 清除当前昇腾设备中创建的所有上下文。
 
void resize (const AscendMat &src, AscendMat &dst, int32_t *dstSize, int interpolation, AscendStream &stream)
 
void resize (const AscendMat &src, AscendMat &dst, Size dsize, double fx, double fy, int interpolation, AscendStream &stream=AscendStream::Null())
 
void resize (InputArray src, OutputArray dst, Size dsize, double fx, double fy, int interpolation, AscendStream &stream=AscendStream::Null())
 调整图像 src 的大小,缩小或放大到指定大小。
 
void rotate (const AscendMat &src, AscendMat &dst, int rotateMode, AscendStream &stream=AscendStream::Null())
 
void rotate (InputArray src, OutputArray dst, int rotateCode, AscendStream &stream=AscendStream::Null())
 将二维数组旋转 90 度的倍数。函数 cv::rotate 以三种不同的方式之一旋转数组:顺时针旋转 90 度 (rotateCode = ROTATE_90_CLOCKWISE)。顺时针旋转 180 度 (rotateCode = ROTATE_180)。顺时针旋转 270 度 (rotateCode = ROTATE_90_COUNTERCLOCKWISE)。
 
void setDevice (int device)
 选择昇腾 NPU 设备。
 
void split (const AscendMat &src, AscendMat *dst, AscendStream &stream=AscendStream::Null())
 将多通道矩阵的每个平面复制到一个数组中。
 
void split (const AscendMat &src, std::vector< AscendMat > &dst, AscendStream &stream=AscendStream::Null())
 
void split (const InputArray src, AscendMat *dst, AscendStream &stream=AscendStream::Null())
 
void split (const InputArray src, std::vector< AscendMat > &dst, AscendStream &stream=AscendStream::Null())
 
void subtract (const AscendMat &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void subtract (const AscendMat &src1, const Scalar &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void subtract (const InputArray src1, const InputArray src2, OutputArray dst, const InputArray mask=noArray(), int dtype=-1, AscendStream &stream=AscendStream::Null())
 计算矩阵与矩阵或矩阵与标量的差。
 
void subtract (const Scalar &src1, const AscendMat &src2, AscendMat &dst, const AscendMat &mask=AscendMat(), int dtype=-1, AscendStream &stream=AscendStream::Null())
 
void syncOutput (const AscendMat &dst, OutputArray _dst, AscendStream &stream)
 将输出矩阵同步到输出数组,根据需要下载矩阵内存。
 
double threshold (const AscendMat &src, AscendMat &dst, double thresh, double maxval, int type, AscendStream &stream=AscendStream::Null())
 
double threshold (const InputArray src, OutputArray dst, double thresh, double maxval, int type, AscendStream &stream=AscendStream::Null())
 对每个数组元素应用固定级别的阈值。
 
void transData (const AscendMat &src, AscendMat &dst, const char *from, const char *to, AscendStream &stream)
 
void transpose (const AscendMat &src, AscendMat &dst, AscendStream &stream=AscendStream::Null())
 
void transpose (const AscendMat &src, int64_t *perm, AscendMat &dst, AscendStream &stream)
 
void transpose (InputArray src, OutputArray dst, AscendStream &stream=AscendStream::Null())
 转置矩阵。
 
void vpcCopyMakeBorderWarpper (hi_vpc_chn chnId, hi_vpc_pic_info &inPic, hi_vpc_pic_info &outPic, uint32_t *taskID, int *offsets, int bordertype, Scalar value)
 
void vpcCropResizeMakeBorderWarpper (hi_vpc_chn chnId, std::vector< AscendPicDesc > &inPicDesc, std::vector< AscendPicDesc > &outPicDesc, int cnt, uint32_t *taskID, const Rect &rect, Size dsize, int interpolation, const int borderType, Scalar scalarV, int top, int left)
 
void vpcCropResizeWarpper (hi_vpc_chn chnId, hi_vpc_pic_info &inPic, hi_vpc_pic_info &outPic, int cnt, uint32_t *taskID, const Rect &rect, Size dsize, int interpolation)
 
void vpcResizeWarpper (hi_vpc_chn chnId, hi_vpc_pic_info &inPic, hi_vpc_pic_info &outPic, int interpolation, uint32_t *taskID)
 
AscendStream wrapStream (size_t AscendStreamAddress)
 绑定重载,用于根据现有 CANN 运行时 API 流指针 (aclrtStream) 中存储的地址创建流对象。
 

函数文档

◆ aclrtFreeWarpper()

void cv::cann::aclrtFreeWarpper ( void * data)

◆ aclrtMallocWarpper()

void cv::cann::aclrtMallocWarpper ( void ** data,
size_t size )

◆ aclrtMemcpy2dWarpper() [1/2]

void cv::cann::aclrtMemcpy2dWarpper ( std::shared_ptr< uchar > & dst,
size_t offset,
size_t dpitch,
const void * src,
size_t spitch,
size_t width,
size_t length,
AscendStream & stream )

◆ aclrtMemcpy2dWarpper() [2/2]

void cv::cann::aclrtMemcpy2dWarpper ( void * dst,
size_t dpitch,
const std::shared_ptr< uchar > & src,
size_t offset,
size_t spitch,
size_t width,
size_t length,
AscendStream & stream )

◆ aclrtMemcpyWarpper() [1/3]

void cv::cann::aclrtMemcpyWarpper ( std::shared_ptr< uchar > & dst,
size_t dstOffset,
const std::shared_ptr< uchar > & src,
size_t srcOffset,
size_t size,
AscendStream & stream )

◆ aclrtMemcpyWarpper() [2/3]

void cv::cann::aclrtMemcpyWarpper ( std::shared_ptr< uchar > & dst,
size_t offset,
const void * src,
size_t size,
AscendStream & stream )

◆ aclrtMemcpyWarpper() [3/3]

void cv::cann::aclrtMemcpyWarpper ( void * dst,
const std::shared_ptr< uchar > & src,
size_t offset,
size_t size,
AscendStream & stream )

◆ aclrtMemsetWarpper()

void cv::cann::aclrtMemsetWarpper ( std::shared_ptr< uchar > & ptr,
int32_t value,
size_t count,
AscendStream & stream )

◆ arithm_op() [1/5]

void cv::cann::arithm_op ( const AscendMat & src,
AscendMat & dst,
const char * op,
AscendStream & stream )

◆ arithm_op() [2/5]

void cv::cann::arithm_op ( const AscendMat & src,
const Scalar & sc,
AscendMat & dst,
const char * op,
AscendStream & stream )

◆ arithm_op() [3/5]

void cv::cann::arithm_op ( const AscendMat & src,
float scalar,
AscendMat & dst,
const char * op,
AscendStream & stream )

◆ arithm_op() [4/5]

void cv::cann::arithm_op ( const AscendMat & src1,
const AscendMat & src2,
AscendMat & dst,
const char * op,
AscendStream & stream )

◆ arithm_op() [5/5]

void cv::cann::arithm_op ( const Scalar & sc,
const AscendMat & src,
AscendMat & dst,
const char * op,
AscendStream & stream )

◆ checkAclError()

void cv::cann::checkAclError ( aclError err,
const char * file,
const int line,
const char * func )

◆ checkAclPtr()

void cv::cann::checkAclPtr ( void * ptr,
const char * file,
const int line,
const char * func )

◆ crop()

void cv::cann::crop ( const AscendMat & src,
AscendMat & dst,
const AscendMat & sizeSrcNpu,
int64_t * offset,
AscendStream & stream )

◆ flip()

void cv::cann::flip ( const AscendMat & src,
std::vector< int32_t > & asixs,
AscendMat & dst,
AscendStream & stream )

◆ getACLType()

aclDataType cv::cann::getACLType ( int opencvdepth)

opencv和cann之间的类型映射。

◆ kernel_launch()

template<typename KERNEL_TYPE , typename TILING_TYPE , typename... ARGS>
void cv::cann::kernel_launch ( KERNEL_TYPE kernel,
AscendStream & stream,
TILING_TYPE & tiling,
ARGS... args )
此函数的调用图如下所示

◆ mallocAndUpload()

std::shared_ptr< uchar > cv::cann::mallocAndUpload ( const void * data,
size_t size,
AscendStream & stream,
AscendMat::Allocator * allocator )

为设备分配内存并上传原始数据。

◆ resize()

void cv::cann::resize ( const AscendMat & src,
AscendMat & dst,
int32_t * dstSize,
int interpolation,
AscendStream & stream )

◆ transData()

void cv::cann::transData ( const AscendMat & src,
AscendMat & dst,
const char * from,
const char * to,
AscendStream & stream )

◆ transpose()

void cv::cann::transpose ( const AscendMat & src,
int64_t * perm,
AscendMat & dst,
AscendStream & stream )

◆ vpcCopyMakeBorderWarpper()

void cv::cann::vpcCopyMakeBorderWarpper ( hi_vpc_chn chnId,
hi_vpc_pic_info & inPic,
hi_vpc_pic_info & outPic,
uint32_t * taskID,
int * offsets,
int bordertype,
Scalar value )

◆ vpcCropResizeMakeBorderWarpper()

void cv::cann::vpcCropResizeMakeBorderWarpper ( hi_vpc_chn chnId,
std::vector< AscendPicDesc > & inPicDesc,
std::vector< AscendPicDesc > & outPicDesc,
int cnt,
uint32_t * taskID,
const Rect & rect,
Size dsize,
int interpolation,
const int borderType,
Scalar scalarV,
int top,
int left )

◆ vpcCropResizeWarpper()

void cv::cann::vpcCropResizeWarpper ( hi_vpc_chn chnId,
hi_vpc_pic_info & inPic,
hi_vpc_pic_info & outPic,
int cnt,
uint32_t * taskID,
const Rect & rect,
Size dsize,
int interpolation )

◆ vpcResizeWarpper()

void cv::cann::vpcResizeWarpper ( hi_vpc_chn chnId,
hi_vpc_pic_info & inPic,
hi_vpc_pic_info & outPic,
int interpolation,
uint32_t * taskID )
inline