-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrecover.m
More file actions
31 lines (29 loc) · 815 Bytes
/
recover.m
File metadata and controls
31 lines (29 loc) · 815 Bytes
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
function [ output ] = recover( I, A, d )
%RECOVER Summary of this function goes here
% Detailed explanation goes here
[height, width, nch] = size(I);
value = zeros(height, width);
output = zeros(height, width, nch);
for i = 1:1:height
for j = 1:1:width
tmp = 2.718281828459^(-d(i, j));
if tmp > 0.1
max = tmp;
else
max = 0.1;
end
if max < 0.9
value(i, j) = max;
else
value(i, j) = 0.9;
end
end
end
for c = 1:1:nch
for i = 1:1:height
for j = 1:1:width
output(i, j, c) = (I(i, j, c) - A(c)) / value(i, j) + A(c);
end
end
end
end