You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.2 KiB
C++

#pragma once
#include <opencv2/opencv.hpp>
using namespace cv;
class DarkChannelDehaze
{
public:
DarkChannelDehaze(void);
~DarkChannelDehaze(void);
void Init(int width, int height);
void doDehaze(const Mat& src, Mat& dst);
protected:
void calcDarkChannel(const Mat& src,Mat& dark);
cv::Mat guidedFilter(cv::Mat I,cv::Mat ip,int rid,double eps);
cv::Mat calDev(Mat src, Rect img_rect);
protected:
double A1;
double A2;
double A3;
double A_final;
double td;
protected:
int block;//=7;
int w1;//=80;
double w;//=0.8;
//Mat *src;//=NULL;
//Mat *dst;//=NULL;
//Mat *dst1=NULL;
//Mat *dst2=NULL;
//Mat *dst3=NULL;
cv::Mat imgroi1;
cv::Mat imgroi2;
cv::Mat imgroi3;
cv::Mat roidark;
cv::Mat median1;
cv::Mat median2;
cv::Mat median3;
cv::Mat gau;
std::vector<cv::Mat> dsts;
cv::Mat toushelv;//=NULL;
Mat g1;//=NULL;
Mat j2;//=NULL;
Mat j3;//=NULL;
cv::Mat pinghua;
Mat I;//=NULL;
Mat Gau;
Mat ip;//=NULL;
Mat la;
double min_dark;
double max_dark;
CvPoint min_loc;
CvPoint max_loc;
double A_dst1;
double dst1_min;
double A_dst2;
double dst2_min;
double A_dst3;
double dst3_min;
double Amax;
cv::Mat dcc;
cv::Mat dc;
cv::Rect ROI_rect;
Mat Adcc;
cv::Mat dstpinghua,Ihalf;
//Mat dc;
int hei;
int wid;
};