-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshort_main.asv
41 lines (36 loc) · 1.22 KB
/
short_main.asv
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
%% main script
addpath 'helper_function'
addpath 'ctrlin'
[I, M, G, rgbI] = openfile('DRIVE', 'test');
% [I, M, G, rgbI] = openfile('STARE', 'labels-vk');
thres = 0.65; sigma = 0; max_L = 15;
w = 15;
for i = 1:size(I,3)
% get current instance
im = I(:,:,i); cmask = M(:,:,i); vmask = G(:,:,i);
% %% preprocessing
[img, img_raw, pmask] = vessel_preproc(im, cmask);
img = imtophat(1-img,strel('disk',12));
[tx, ty, gmag_norm] = get_tangent(img);
[tx_new, ty_new] = ETF(tx,ty,gmag_norm,img);
[tx_new, ty_new] = ETF(tx_new,ty_new,gmag_norm,img);
% % reverse tx ty
% [rtx_new, rty_new] = ETF(-tx,-ty,gmag_norm,img);
% [rtx_new, rty_new] = ETF(rtx_new,rty_new,gmag_norm,img);
[R_combined, R_theta, rmask] = detect_lines(img, pmask, cmask, w, max_L, thres, sigma);
startP = [181,303;
222,346;
191,306;
403,466];
endP = [148,259;
219,377;
209,289;
370,476];
s = ctrlin_trace(img, tx_new, ty_new, startP(2,:), endP(2,:), 3, 10);
exu = exudates_detection(im, cmask);
figure
subplot(1,2,1);
imshow(im,[])
subplot(1,2,2);
imshow(exu)
end