ImageSize
CropResizePasteConfig
功能
抠图坐标及贴图坐标。
结构定义
struct CropResizePasteConfig {
// CROP CONFIG
uint32_t cropLeft;
uint32_t cropRight;
uint32_t cropTop;
uint32_t cropBottom;
// PASTE CONFIG
uint32_t pasteLeft;
uint32_t pasteRight;
uint32_t pasteTop;
uint32_t pasteBottom;
// RESIZE CONFIG
uint32_t interpolation;
};
参数说明
| 参数名 | 说明 |
|---|---|
| cropLeft | 抠图坐标左边。 |
| cropRight | 抠图坐标右边。 |
| cropTop | 抠图坐标上边。 |
| cropBottom | 抠图坐标下边。 |
| pasteLeft | 贴图坐标左边。 |
| pasteRight | 贴图坐标右边。 |
| pasteTop | 贴图坐标上边。 |
| pasteBottom | 贴图坐标下边。 |
| interpolation | 指定缩放算子,取值范围: - “0”:默认值,华为自研的最近邻插值算法。 - “1”:业界通用的Bilinear算法,当前不支持。 - “2”:业界通用的Nearest neighbor算法,当前不支持。 |
父主题: 通用数据结构
ImageConstrainInfo
功能
图片对齐相关参数。
结构定义
struct ImageConstrainInfo {
uint32_t minWidthStride;
uint32_t maxWidthStride;
uint32_t minHeightStride;
uint32_t maxHeightStride;
uint32_t widthStrideAlign;
uint32_t heightStrideAlign;
uint32_t widthAlign;
uint32_t heightAlign;
float ratio;
uint32_t pixelBit;
};
参数说明
| 参数名 | 说明 |
|---|---|
| minWidthStride | 宽对齐最小值。 |
| maxWidthStride | 宽对齐最大值。 |
| minHeightStride | 高对齐最小值。 |
| maxHeightStride | 高对齐最大值。 |
| widthStrideAlign | 宽对齐的对齐方式。 |
| heightStrideAlign | 高对齐的对齐方式。 |
| widthAlign | 宽对齐方式。 |
| heightAlign | 高对齐方式。 |
| ratio | 比例。 |
| pixelBit | 像数点数据。 |
父主题: 通用数据结构
ImageSize
功能
图片尺寸信息。
结构定义
namespace MxBase{
struct ImageSize {
size_t height;
size_t width;
ImageSize() = default;
ImageSize(size_t height, size_t width)
{
this->width = width;
this->height = height;
}
}
namespace MxTools{
struct ImageSize {
size_t height;
size_t width;
size_t area;
ImageSize(int height, int width)
{
this->width = static_cast<size_t>(width);
this->height = static_cast<size_t>(height);
this->area = static_cast<size_t>(height * width);
}
}
参数说明
| 参数名 | 说明 |
|---|---|
| height | 图片的高。 |
| width | 图片的宽。 |
父主题: 通用数据结构
DynamicInfo
功能
模型支持的类型。
结构定义
struct DynamicInfo {
DynamicType dynamicType = DYNAMIC_BATCH;
size_t batchSize;
ImageSize imageSize = {};
std::vector<std::vector<uint32_t>> shape = {};
};
参数说明
| 参数名 | 说明 |
|---|---|
| dynamicType | 动态类型描述。 |
| batchSize | batch大小。 |
| imageSize | 图像大小。 |
| shape | 动态Batch的形状。 |
父主题: 通用数据结构
RoiBox
功能
定义裁剪框。
结构定义
struct RoiBox {
float x0;
float y0;
float x1;
float y1;
};
参数说明
| 参数名 | 说明 |
|---|---|
| x0 | 左上角横坐标。 |
| y0 | 左上角纵坐标。 |
| x1 | 右下角横坐标。 |
| y1 | 右下角纵坐标。 |
父主题: 通用数据结构
TextObjDetectInfo
功能
定义检测框的四个坐标点和置信度
结构定义
struct TextObjDetectInfo {
float x0;
float y0;
float x1;
float y1;
float x2;
float y2;
float x3;
float y3;
float confidence;
};
参数说明
| 参数名 | 说明 |
|---|---|
| x0 | 检测框其中一个横坐标。 |
| y0 | 检测框其中一个纵坐标。 |
| x1 | 检测框其中一个横坐标。 |
| y1 | 检测框其中一个纵坐标。 |
| x2 | 检测框其中一个横坐标。 |
| y2 | 检测框其中一个纵坐标。 |
| x3 | 检测框其中一个横坐标。 |
| y4 | 检测框其中一个纵坐标。 |
| confidence | 置信度。 |
父主题: 通用数据结构
在线提单