#ifndef IMAGEUTIL_H #define IMAGEUTIL_H #include <QImage> #include <QBuffer> #include "opencv2/opencv.hpp" class ImageUtil { public: ImageUtil(); static QImage MatImageToQImage(const cv::Mat &src); // static QImage UcharToQImage(unsigned char* data, int width, int height, QImage::Format format); static cv::Mat ucharToMat(unsigned char * data, int row, int col); static cv::Mat QImageToMat(QImage image); // static QString QImageToBase64(QImage image); // static cv::Mat MatImageRect(const cv::Mat &src, cv::Rect rect, int delta); }; #endif // IMAGEUTIL_H