diff options
author | JinweiClarkChao <[email protected]> | 2015-08-25 12:27:20 +0800 |
---|---|---|
committer | JinweiClarkChao <[email protected]> | 2015-08-25 16:49:49 +0800 |
commit | f07885c1eb4c98dc52704517623b2e7df1ed616d (patch) | |
tree | acc14792523ff5bbb464882e548b96752c2d6886 /DCP/dcp.cpp | |
parent | de74f5fa499b82390bce432251609d18d9ce5fd8 (diff) | |
download | Dehaze-f07885c1eb4c98dc52704517623b2e7df1ed616d.tar.gz |
initial complete
Diffstat (limited to 'DCP/dcp.cpp')
-rw-r--r-- | DCP/dcp.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/DCP/dcp.cpp b/DCP/dcp.cpp index df4aad9..4e100c6 100644 --- a/DCP/dcp.cpp +++ b/DCP/dcp.cpp | |||
@@ -1,5 +1,8 @@ | |||
1 | #include "dcp.h" | 1 | #include "dcp.h" |
2 | 2 | ||
3 | #include <iostream> | ||
4 | using namespace std; | ||
5 | |||
3 | void dehaze(IplImage *recover, IplImage *input) | 6 | void dehaze(IplImage *recover, IplImage *input) |
4 | { | 7 | { |
5 | int height = input->height; | 8 | int height = input->height; |
@@ -11,8 +14,16 @@ void dehaze(IplImage *recover, IplImage *input) | |||
11 | 14 | ||
12 | int darkchannelradius = MIN(width, height) * 0.02; | 15 | int darkchannelradius = MIN(width, height) * 0.02; |
13 | 16 | ||
14 | CalcDarkChannel(darkchannel, input, darkchannelradius); | 17 | |
15 | |||
16 | 18 | ||
19 | double Airlight[3] = { 0.0, 0.0, 0.0 }; | ||
20 | CalcDarkChannel(darkchannel, input, darkchannelradius); | ||
21 | |||
22 | CalcAirlight(darkchannel, input, Airlight); | ||
23 | |||
24 | CalcTransmission(transmission, input, Airlight, darkchannelradius); | ||
25 | GuidedFilterColor(refine_transmission, input, transmission, 1e-6, 60); | ||
26 | CalcRecover(recover, input, refine_transmission, Airlight); | ||
17 | 27 | ||
28 | |||
18 | } | 29 | } |