MNN::CV::ImageProcess类 参考

`#include <ImageProcess.hpp>`

## 类

struct | Config

## Public 成员函数

| ~ImageProcess ()
const Matrix & | matrix () 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 ImageProcess * | create (const Config &config, const Tensor *dstTensor=nullptr)
| create image process with given config for given tensor. 更多...
static 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)
| create image process with given config for given tensor. 更多...
template<typename T >
static Tensor * | createImageTensor (int w, int h, int bpp, void *p=nullptr)
| create tensor with given data. 更多...
static Tensor * | createImageTensor (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.

参数

  source | source data.
  iw | source width.
  ih | source height.
  stride | number of elements per row. eg: 100 width RGB contains at least 300 elements.
  dest | given 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.

参数

  config | given config.
  dstTensor | given 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.

参数

  means | given means
  meanCount | given means count
  normals | given normals
  normalCount | given normal count
  sourceFormat | format of source data
  destFormat | format of destination data
  dstTensor | given 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.

参数

  w | image width.
  h | image height.
  bpp | bytes per pixel.
  p | pixel 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 | ) |

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

- include/ImageProcess.hpp