Files
HPPA/HPPA/imageProcessor.h
2026-04-02 10:34:57 +08:00

41 lines
1.2 KiB
C++

#pragma once
#ifndef IMAGEPROCESSOR
#define IMAGEPROCESSOR
#include <opencv2/opencv.hpp>//包含了所有东西,编译很慢
//#include <opencv2/core/core.hpp>
//#include <opencv2/highgui/highgui.hpp>
#include "QObject"
#include "QImage"
class ImageProcessor
{
public:
ImageProcessor();
~ImageProcessor();
QImage Mat2QImage(cv::Mat cvImg);//https://www.cnblogs.com/annt/p/ant003.html
//envi 2%拉伸原理:
//gdal版本 → https://blog.csdn.net/HB_Programmer/article/details/82020703?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control
//opencv版本 → https://blog.csdn.net/qq_41824159/article/details/105469986
cv::Mat CStretchDeal(const cv::Mat img, const uint minnum, const uint maxnum);
uint MaxRatio(const std::vector<cv::Point2f> data, const float ratio);
uint MinRatio(const std::vector<cv::Point2f> data, const float ratio);
std::vector<cv::Point2f> CHistogram(const cv::Mat img);
cv::Mat CStretch(const cv::Mat img, const float ratio);
protected:
private:
public slots:
signals:
};
#endif