FastDeploy  latest
Fast & Easy to Deploy!
Public Member Functions | Static Public Member Functions | List of all members
fastdeploy::vision::NormalizeAndPermute Class Reference

Processor for Normalize and Permute images from HWC to CHW. More...

#include <normalize_and_permute.h>

Inheritance diagram for fastdeploy::vision::NormalizeAndPermute:
Inheritance graph
[legend]
Collaboration diagram for fastdeploy::vision::NormalizeAndPermute:
Collaboration graph
[legend]

Public Member Functions

void SetAlpha (const std::vector< float > &alpha)
 Process the input images. More...
 
void SetBeta (const std::vector< float > &beta)
 Process the input images. More...
 
void SetSwapRB (bool swap_rb)
 Process the input images. More...
 
- Public Member Functions inherited from fastdeploy::vision::Processor
virtual bool operator() (FDMat *mat)
 operator () for calling processor in this way: processor(mat) More...
 
virtual bool operator() (FDMat *mat, ProcLib lib)
 operator () for calling processor in this way: processor(mat, lib) This function is for backward compatibility, will be removed in the near future, please use operator()(FDMat* mat) instead and set proc_lib in mat. More...
 
virtual bool operator() (FDMatBatch *mat_batch)
 operator () for calling processor in this way: processor(mat_batch) More...
 

Static Public Member Functions

static bool Run (FDMat *mat, const std::vector< float > &mean, const std::vector< float > &std, bool is_scale=true, const std::vector< float > &min=std::vector< float >(), const std::vector< float > &max=std::vector< float >(), ProcLib lib=ProcLib::DEFAULT, bool swap_rb=false)
 Process the input images. More...
 

Detailed Description

Processor for Normalize and Permute images from HWC to CHW.

Member Function Documentation

◆ Run()

bool fastdeploy::vision::NormalizeAndPermute::Run ( FDMat mat,
const std::vector< float > &  mean,
const std::vector< float > &  std,
bool  is_scale = true,
const std::vector< float > &  min = std::vector<float>(),
const std::vector< float > &  max = std::vector<float>(),
ProcLib  lib = ProcLib::DEFAULT,
bool  swap_rb = false 
)
static

Process the input images.

Parameters
[in]matThe input image data, result = mat * alpha + beta
[in]meantarget mean vector of output images
[in]stdtarget std vector of output images
[in]maxmax value vector to be in target image
[in]minmin value vector to be in target image
[in]libto define OpenCV or FlyCV or CVCUDA will be used.
[in]swap_rbto define whether to swap r and b channel order
Returns
true if the process successed, otherwise false

◆ SetAlpha()

void fastdeploy::vision::NormalizeAndPermute::SetAlpha ( const std::vector< float > &  alpha)
inline

Process the input images.

Parameters
[in]alphaset the value of the alpha parameter

◆ SetBeta()

void fastdeploy::vision::NormalizeAndPermute::SetBeta ( const std::vector< float > &  beta)
inline

Process the input images.

Parameters
[in]betaset the value of the beta parameter

◆ SetSwapRB()

void fastdeploy::vision::NormalizeAndPermute::SetSwapRB ( bool  swap_rb)
inline

Process the input images.

Parameters
[in]swap_rbset the value of the swap_rb parameter

The documentation for this class was generated from the following files: