1 #ifndef _NNDEPLOY_PREPROCESS_OPENCV_CONVERT_H_
2 #define _NNDEPLOY_PREPROCESS_OPENCV_CONVERT_H_
22 namespace preprocess {
48 static bool normalize(
const cv::Mat &src, cv::Mat &dst,
59 bool normalize,
float *scale,
float *mean,
62 bool normalize,
float *scale,
float *mean,
63 float *std,
int batch);
Template class for a 4-element vector. Scalar_ and Scalar can be used just as typical 4-element vecto...
static int convertFromDataType(base::DataType src)
static bool convertToBatchTensor(const cv::Mat &src, device::Tensor *dst, bool normalize, float *scale, float *mean, float *std, int batch)
static bool convertToTensor(const cv::Mat &src, device::Tensor *dst, bool normalize, float *scale, float *mean, float *std)
cast + normalize + premute
static cv::Scalar convertFromScalar(const base::Scalar2d &src)
static int convertFromBorderType(base::BorderType src)
static bool normalize(const cv::Mat &src, cv::Mat &dst, base::DataType data_type, float *scale, float *mean, float *std)
static int convertFromInterpType(base::InterpType src)
static int convertFromCvtColorType(base::CvtColorType src)
#define NNDEPLOY_CC_API
api