-
Notifications
You must be signed in to change notification settings - Fork 0
/
img_transform.m
39 lines (35 loc) · 1.18 KB
/
img_transform.m
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
classdef img_transform
methods
function processed_img = histogram_equalisation(~, img, show)
hsv_im = rgb2hsv(img);
hist_hsv = histeq(hsv_im(:, :, 3));
hsv_im(:, :, 3) = hist_hsv;
processed_img = hsv2rgb(hsv_im);
if show==1
figure;
subplot(2, 1, 1);
imshow(img);
title('Original Image');
subplot(2, 1, 2);
imshow(processed_img);
title('Processed Image');
end
end
function processed_img = cla_histogram_equalisation(~, img, numTiles, show)
lab_im = rgb2lab(img);
L = lab_im(:,:,1)/100;
L = adapthisteq(L,'NumTiles',numTiles,'ClipLimit',0.005);
lab_im(:,:,1) = L*100;
processed_img = lab2rgb(lab_im,'OutputType','uint8');
if show==1
figure;
subplot(2, 1, 1);
imshow(img);
title('Original Image');
subplot(2, 1, 2);
imshow(processed_img);
title('Processed Image');
end
end
end
end