// utils.h #ifndef IMG_UTILS_H #define IMG_UTILS_H #include #include #include #include #include extern MIL_ID MilSystem; class ImageUtils { public: ImageUtils(); // 构造函数 // 将 cv::Mat 转换为 QPixmap 的静态函数 static QPixmap mat2QPixmap(const cv::Mat& mat); // 将 MIL_ID 转换为 cv::Mat 的静态函数 static cv::Mat mil2Mat(const MIL_ID mil_img); static void convert_to_uint8(const MIL_ID& input_img, MIL_ID& output_img); }; #endif // IMG_UTILS_H