cotton_double/img_utils.h
2024-12-18 16:41:24 +08:00

28 lines
559 B
C++

// utils.h
#ifndef IMG_UTILS_H
#define IMG_UTILS_H
#include <QPixmap>
#include <QImage>
#include <opencv2/opencv.hpp>
#include <Mil.h>
#include <camera.h>
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