-
Notifications
You must be signed in to change notification settings - Fork 4
/
lesion_detection.m
49 lines (35 loc) · 1.12 KB
/
lesion_detection.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
38
39
40
41
42
43
44
45
46
47
48
49
clear all;
clc;
%% input datastore
cleanfilename = 'C:\1_project_implementation\DRIVEdataset\images\*.tif'
ds1 = imageDatastore(cleanfilename);
maskfilename1 = 'C:\1_project_implementation\BV\*.png';
ds2 = imageDatastore(maskfilename1);
% BV = imcomplement(BV);
% figure, imshow(BV);title('BV');
count = 1;
%%
while hasdata(ds1)
origImg = readimage(ds1,count);
gray = rgb2gray(origImg);
figure, imshow(gray);title('gray');
Ig = origImg(:,:,2);
BV = readimage(ds2,count);
% his = histeq(gray,5000);
% figure, imshow(his);title('Bw');
%% local contrast
edgeThreshold = 0.4;
amount = 0.5;
C = localcontrast(Ig, edgeThreshold, amount); %localcontrast : Edge-aware local contrast manipulation of images
% figure, imshow(C);title('Ig local contrast');
%%
OT = otsuthresholding_(C,count);
figure;
subplot(1,2,1) ;
imshow(origImg);
title('Original Image');
subplot(1,2,2) ;
imshow(OT);
title('lesion extraction');
count=count+1;
end