-
Notifications
You must be signed in to change notification settings - Fork 3
/
findEdge.m
44 lines (44 loc) · 935 Bytes
/
findEdge.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
function [EdgeL EdgeR] = findEdge(input,XY)
[y x]=size(input);
output =zeros(y,x);
output2=zeros(y,x);
if XY>0,
for j=1:x;
for i=1:y;
if input(i,j)>0,
output(i,j)=1;
break;
end;
end;
end;
for j=1:x;
for tempi=1:y;
i=y-tempi+1;
if input(i,j)>0,
output2(i,j)=1;
break;
end;
end;
end;
else
for i=1:y;
for j=1:x;
if input(i,j)>0,
output(i,j)=1;
break;
end;
end;
end;
for i=1:y;
for tempj=1:x;
j=x-tempj+1;
if input(i,j)>0,
output2(i,j)=1;
break;
end;
end;
end;
end;
EdgeR=checkForGaps(output2, XY); % ïåðåâ³ðÿºì ÷è íåìà ðîçðèâ³â â ë³í³¿, ÿê º - çàïîâíþºìî ¿õ
EdgeL=checkForGaps(output, XY);
end