aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'DCP/darkchannel.cpp')
-rw-r--r--DCP/darkchannel.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/DCP/darkchannel.cpp b/DCP/darkchannel.cpp
index ab5a365..64d9963 100644
--- a/DCP/darkchannel.cpp
+++ b/DCP/darkchannel.cpp
@@ -25,14 +25,10 @@ void CalcDarkChannel(IplImage *darkchannel, IplImage *input, int radius)
25 st_row = i - radius, ed_row = i + radius; 25 st_row = i - radius, ed_row = i + radius;
26 st_col = j - radius, ed_col = j + radius; 26 st_col = j - radius, ed_col = j + radius;
27 27
28 if (st_row < 0) 28 st_row = st_row < 0 ? 0 : st_row;
29 st_row = 0; 29 ed_row = ed_row >= height ? (height - 1) : ed_row;
30 if (ed_row >= height) 30 st_col = st_col < 0 ? 0 : st_col;
31 ed_row = height - 1; 31 ed_col = ed_col >= width ? (width - 1) : ed_col;
32 if (st_col < 0)
33 st_col = 0;
34 if (ed_col >= width)
35 ed_col = width - 1;
36 32
37 int cur = 0; 33 int cur = 0;
38 int min = 300; 34 int min = 300;
Powered by cgit v1.2.3 (git 2.41.0)