Skip to main content

Color

Rect

功能

矩形框结构体(抠图贴图),用来保存一个矩形框的左上角坐标和右下角坐标(图像的左上角坐标和右下角坐标)。

结构定义

struct Rect {
Rect()
: x0(0), y0(0), x1(0), y1(0) {};
Rect(const uint32_t leftTopX, const uint32_t leftTopY,
const uint32_t rightBottomX, const uint32_t rightBottomY)
: x0(leftTopX), y0(leftTopY), x1(rightBottomX), y1(rightBottomY) {};
Rect(const Point leftTop, const Point rightBottom)
: x0(leftTop.x), y0(leftTop.y), x1(rightBottom.x), y1(rightBottom.y) {};

uint32_t x0 = 0;
uint32_t y0 = 0;
uint32_t x1 = 0;
uint32_t y1 = 0;
};

参数说明

参数名说明
x0,leftTopX矩形框左上角坐标的横坐标(以图像左上角为原点)。
y0,leftTopY矩形框左上角坐标的纵坐标(以图像左上角为原点)。
x1,rightBottomX矩形框右下角坐标的横坐标(以图像左上角为原点)。
y1,rightBottomY矩形框右下角坐标的纵坐标(以图像左上角为原点)。
leftTop矩形框左上角坐标点(Point 结构体)。
rightBottom矩形框右下角坐标点(Point 结构体)。

父主题: 通用数据结构

Size

功能

图像大小结构体(缩放),用来保存一个图像的高和宽。

结构定义

struct Size {
Size()
: width(0), height(0) {};
Size(const uint32_t inputWidth, const uint32_t inputHeight)
: width(inputWidth), height(inputHeight) {};

uint32_t width = 0;
uint32_t height = 0;
};

参数说明

参数名说明
width,inputWidth图像宽。
height,inputHeight图像高。

父主题: 通用数据结构

Point

功能

坐标点,用于保存图像像素点位置的结构体。

结构定义

struct Point {
Point()
: x(0), y(0) {};
Point(const uint32_t inputX, const uint32_t inputY)
: x(inputX), y(inputY) {};

uint32_t x = 0;
uint32_t y = 0;
};

参数说明

参数名说明
x,inputX横坐标(以图像左上角为原点)。
y,inputY纵坐标(以图像左上角为原点)。

父主题: 通用数据结构

Color

功能

色彩值,用于图像处理补边功能,描述三通道色彩的结构体。

结构定义

struct Color {
Color()
: channel_zero(0), channel_one(0), channel_two(0) {};
Color(const uint32_t inputRed, const uint32_t inputGreen, const uint32_t inputBlue)
: channel_zero(inputRed), channel_one(inputGreen), channel_two(inputBlue) {};

uint32_t channel_zero;
uint32_t channel_one;
uint32_t channel_two;
};

参数说明

参数名说明
channel_zero,inputRed0号通道取值,范围[0, 255]。 例如:对于RGB_888格式图像,该通道为R;对于YUV格式图像,该通道为Y。
channel_one,inputGreen1号通道取值,范围[0, 255]。 例如:对于RGB_888格式图像,该通道为G;对于YUV格式图像,该通道为U。
channel_two,inputBlue2号通道取值,范围[0, 255]。 例如:对于RGB_888格式图像,该通道为B;对于YUV格式图像,该通道为V。

父主题: 通用数据结构

Dim

功能

补边值,用于图像处理“ImageProcessor”的补边功能,描述左、右、上、下四个方向补边的像素个数。

结构定义

struct Dim {
Dim()
: left(0), right(0), top(0), bottom(0) {};
Dim(const uint32_t inputDim)
: left(inputDim), right(inputDim), top(inputDim), bottom(inputDim) {};
Dim(const uint32_t inputLeft, const uint32_t inputRight, const uint32_t inputTop, const uint32_t inputBottom)
: left(inputLeft), right(inputRight), top(inputTop), bottom(inputBottom) {};
uint32_t left;
uint32_t right;
uint32_t top;
uint32_t bottom;
};

参数说明

参数名说明
left,inputLeft左侧补边像素数量。
right,inputRight右侧补边像素数量。
top,inputTop上方补边像素数量。
bottom,inputBottom下方补边像素数量。
inputDim左、右、上、下补边像素数量。 仅在使用**Dim(const uint32_t inputDim)**构造函数时,将左、右、上、下补边像素数量设为与inputDim相同的值。

父主题: 通用数据结构

TensorDType

功能

用于描述Tensor类的数据类型。

结构定义

enum class TensorDType {
UNDEFINED = -1,
FLOAT32 = 0,
FLOAT16 = 1,
INT8 = 2,
INT32 = 3,
UINT8 = 4,
INT16 = 6,
UINT16 = 7,
UINT32 = 8,
INT64 = 9,
UINT64 = 10,
DOUBLE64 = 11,
BOOL = 12
};

参数说明

参数名说明
UNDEFINED未定义类型。
FLOAT3232位浮点型。
FLOAT1616位浮点型。
INT88为整型。
INT3232位整型。
UINT88位无符号整型。
INT1616位整型。
UINT1616位无符号整型。
UINT3232位无符号整型。
INT6464位整型。
DOUBLE6464位双精度浮点型。
BOOL布尔型。

父主题: 通用数据结构

VisionDataFormat

功能

图像数据格式排布形式。

结构定义

enum class VisionDataFormat {
NCHW = 0,
NHWC = 1
};

参数说明

参数名说明
NCHW图像数据按NCHW格式排布。
NHWC图像数据按NHWC格式排布。

父主题: 通用数据结构

在线提单