-
Notifications
You must be signed in to change notification settings - Fork 0
/
deHaze.h
51 lines (47 loc) · 1.39 KB
/
deHaze.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once
#include <iostream>
#include <opencv2\opencv.hpp>
#include <queue>
#include <intrin.h>
using namespace std;
using namespace cv;
class deHaze
{
public:
int AR, AG, AB;
Mat srcImg;
Mat darkChannelImg;
Mat roughtT;
Mat findedT;
Mat deHazeImg;
deHaze();
bool load(Mat img);
void guidedFilter1Channel(Mat src, Mat guideImg, Mat& dst, int filterWindowSize, float eps = 0.001);
void guidedFilter3Channel(Mat src, Mat floatB, Mat floatG,Mat floatR, Mat& dst, int filterWindowSize ,float eps = 0.001);
Mat hazeRemoval(int darkWindowSize, int filterWindowSize);
Mat practicalHazeRemoval(int darkWindowSize, int filterWindowSize);
Mat fastHazeRemoval(int darkWindowSize, int filterWindowSize);
Mat superFastHazeRemoval(int darkWindowSize, int filterWindowSize);
~deHaze();
private:
inline int scaleRGB(int a);
void darkChannelProcess(Mat src, Mat& dst, int darkWindowSize);
void streamMinFilter(Mat src, Mat& dst,int darkWindowSize);
void picMinFilter(Mat src, Mat& dst, int darkWindowSize);
void getGlobalAtmosphericLight(Mat darkChannelSrc,int& Ar, int& Ag, int& Ab);
void getRoughT(Mat normB, Mat normG, Mat normR, Mat& dst, int Ar, int Ag, int Ab);
void fastRoughtT(Mat src, Mat &dst, int Ar, int Ag, int Ab);
void imgRecover(Mat src, Mat tFined, Mat& dst, int globalA);
};
inline int deHaze::scaleRGB(int a)
{
if (a < 0)
{
return 0;
}
if (a > 255)
{
return 255;
}
return a;
}