1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #pragma once
- #include <string>
- #include <vector>
- /**
- * @enum image_format_t
- * @brief 图像格式枚举
- *
- * 该枚举定义了支持的图像格式,包括 YUV420SPNV21 和 YUV420SPNV12,后续可再添加。
- */
- enum image_format_t
- {
- YUV420SPNV21 = 1, ///< YYYY ... VUVUVUVU ... FOR EEASY
- YUV420SPNV12 = 2 ///< YYYY ... UVUVUVUV ... FOR AXURE
- };
- /**
- * @struct frame_t
- * @brief 图片帧结构体
- */
- typedef struct
- {
- void *pVir; ///< 虚拟指针
- void *pVir_UV; ///< UV虚拟指针
- unsigned int pPhy; ///< 物理地址
- unsigned int pPhy_UV; ///< UV物理地址
- int w; ///< 帧宽度
- int h; ///< 帧高度
- int fmt; ///< 帧格式
- } frame_t;
- /**
- * @struct BoundingBox
- * @brief FOR 芯片合作伙伴 边界框结构体
- */
- typedef struct
- {
- float x1; ///< x坐标
- float y1; ///< y坐标
- float x2; ///< 宽度
- float y2; ///< 高度
- float detect_confidence; ///< 置信度
- std::string category; ///< 类别信息
- } BoundingBox;
- // 算法内部使用结构构体
- struct Result
- {
- frame_t frame;
- std::vector<BoundingBox> bbox;
- };
- /**
- * @struct BoundingBox_Res
- * @brief FOR 嵌入式同事 用于给C代码的推理结果边界框结构体
- *
- * 该结构体用于表示推理模型输出的边界框信息,包括位置坐标、宽度、高度、检测置信度和类别信息。
- */
- typedef struct
- {
- int x1; /**< x坐标 */
- int y1; /**< y坐标 */
- int x2; /**< 宽度 */
- int y2; /**< 高度 */
- float detect_confidence; /**< 检测置信度 */
- char *category; /**< 类别信息 */
- } BoundingBox_C;
|