aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinweiClarkChao <[email protected]>2015-08-25 16:03:05 +0800
committerJinweiClarkChao <[email protected]>2015-08-25 16:49:50 +0800
commit66efed8b335610f9eae59fd3f52eccaffd7a6e0b (patch)
treea65d3ad57aa75d072b5f543fd5ea5c0a18a5c1ab /DCP/dcp.cpp
parentf07885c1eb4c98dc52704517623b2e7df1ed616d (diff)
downloadDehaze-66efed8b335610f9eae59fd3f52eccaffd7a6e0b.tar.gz
fix
Diffstat (limited to 'DCP/dcp.cpp')
-rw-r--r--DCP/dcp.cpp39
1 files changed, 27 insertions, 12 deletions
diff --git a/DCP/dcp.cpp b/DCP/dcp.cpp
index 4e100c6..716759c 100644
--- a/DCP/dcp.cpp
+++ b/DCP/dcp.cpp
@@ -1,7 +1,4 @@
1#include "dcp.h" 1#include "dcp_core.h"
2
3#include <iostream>
4using namespace std;
5 2
6void dehaze(IplImage *recover, IplImage *input) 3void dehaze(IplImage *recover, IplImage *input)
7{ 4{
@@ -12,18 +9,36 @@ void dehaze(IplImage *recover, IplImage *input)
12 IplImage *transmission = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); 9 IplImage *transmission = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1);
13 IplImage *refine_transmission = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1); 10 IplImage *refine_transmission = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 1);
14 11
15 int darkchannelradius = MIN(width, height) * 0.02; 12 int darkchannelradius = cvRound(MIN(width, height) * 0.02);
16
17
18
19 double Airlight[3] = { 0.0, 0.0, 0.0 }; 13 double Airlight[3] = { 0.0, 0.0, 0.0 };
14
15 TicToc t;
16 t.tic();
17 printf("CalcDarkChannel...");
20 CalcDarkChannel(darkchannel, input, darkchannelradius); 18 CalcDarkChannel(darkchannel, input, darkchannelradius);
21 19 t.toc();
20
21 t.tic();
22 printf("CalcAirlight...");
22 CalcAirlight(darkchannel, input, Airlight); 23 CalcAirlight(darkchannel, input, Airlight);
23 24 t.toc();
25
26 t.tic();
27 printf("CalcTransmission...");
24 CalcTransmission(transmission, input, Airlight, darkchannelradius); 28 CalcTransmission(transmission, input, Airlight, darkchannelradius);
29 t.toc();
30
31 t.tic();
32 printf("GuidedFilterColor...");
25 GuidedFilterColor(refine_transmission, input, transmission, 1e-6, 60); 33 GuidedFilterColor(refine_transmission, input, transmission, 1e-6, 60);
26 CalcRecover(recover, input, refine_transmission, Airlight); 34 t.toc();
27 35
28 36 t.tic();
37 printf("CalcRecover...");
38 CalcRecover(recover, input, refine_transmission, Airlight);
39 t.toc();
40
41 cvReleaseImage(&refine_transmission);
42 cvReleaseImage(&transmission);
43 cvReleaseImage(&darkchannel);
29} 44}
Powered by cgit v1.2.3 (git 2.41.0)