MNN  1.0
| Public 成员函数 | 静态 Public 成员函数 | 所有成员列表
MNN::CV::ImageProcess类 参考

#include <ImageProcess.hpp>

struct  Config
 

Public 成员函数

 ~ImageProcess ()
 
const Matrixmatrix () const
 get affine transform matrix. 更多...
 
void setMatrix (const Matrix &matrix)
 
ErrorCode convert (const uint8_t *source, int iw, int ih, int stride, Tensor *dest)
 convert source data to given tensor. 更多...
 

静态 Public 成员函数

static ImageProcesscreate (const Config &config, const Tensor *dstTensor=nullptr)
 create image process with given config for given tensor. 更多...
 
static ImageProcesscreate (const ImageFormat sourceFormat=RGBA, const ImageFormat destFormat=RGBA, const float *means=nullptr, const int meanCount=0, const float *normals=nullptr, const int normalCount=0, const Tensor *dstTensor=nullptr)
 create image process with given config for given tensor. 更多...
 
template<typename T >
static TensorcreateImageTensor (int w, int h, int bpp, void *p=nullptr)
 create tensor with given data. 更多...
 
static TensorcreateImageTensor (halide_type_t type, int w, int h, int bpp, void *p=nullptr)
 

详细描述

handle image process for tensor. step: 1: Do transform compute and get points 2: Sample line and do format convert 3: Turn RGBA to float tensor, and do sub and normalize

构造及析构函数说明

◆ ~ImageProcess()

MNN::CV::ImageProcess::~ImageProcess ( )

成员函数说明

◆ convert()

ErrorCode MNN::CV::ImageProcess::convert ( const uint8_t *  source,
int  iw,
int  ih,
int  stride,
Tensor dest 
)

convert source data to given tensor.

参数
sourcesource data.
iwsource width.
ihsource height.
stridenumber of elements per row. eg: 100 width RGB contains at least 300 elements.
destgiven tensor.
返回
result code.

◆ create() [1/2]

static ImageProcess* MNN::CV::ImageProcess::create ( const Config config,
const Tensor dstTensor = nullptr 
)
static

create image process with given config for given tensor.

参数
configgiven config.
dstTensorgiven tensor.
返回
image processor.

◆ create() [2/2]

static ImageProcess* MNN::CV::ImageProcess::create ( const ImageFormat  sourceFormat = RGBA,
const ImageFormat  destFormat = RGBA,
const float *  means = nullptr,
const int  meanCount = 0,
const float *  normals = nullptr,
const int  normalCount = 0,
const Tensor dstTensor = nullptr 
)
static

create image process with given config for given tensor.

参数
meansgiven means
meanCountgiven means count
normalsgiven normals
normalCountgiven normal count
sourceFormatformat of source data
destFormatformat of destination data
dstTensorgiven tensor.
返回
image processor.

◆ createImageTensor() [1/2]

template<typename T >
static Tensor* MNN::CV::ImageProcess::createImageTensor ( int  w,
int  h,
int  bpp,
void *  p = nullptr 
)
inlinestatic

create tensor with given data.

参数
wimage width.
himage height.
bppbytes per pixel.
ppixel data pointer.
返回
created tensor.

◆ createImageTensor() [2/2]

static Tensor* MNN::CV::ImageProcess::createImageTensor ( halide_type_t  type,
int  w,
int  h,
int  bpp,
void *  p = nullptr 
)
static

◆ matrix()

const Matrix& MNN::CV::ImageProcess::matrix ( ) const
inline

get affine transform matrix.

返回
affine transform matrix.

◆ setMatrix()

void MNN::CV::ImageProcess::setMatrix ( const Matrix matrix)

该类的文档由以下文件生成: