-
Notifications
You must be signed in to change notification settings - Fork 0
/
filteringSecond.m
80 lines (52 loc) · 1.73 KB
/
filteringSecond.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
function candS=filteringSecond(ScandS,SallInf,SobstacleLocation)
tempposPointCellNum=0;
posPointCellNum=[];
for iu=1:size(ScandS,2)-1
for jun=1:size(ScandS{1,iu},1)
coordi=ScandS{1,iu}(jun,1:2);
p1=[coordi(1,1)+1 coordi(1,2)];
p2=[coordi(1,1) coordi(1,2)+1];
p3=[coordi(1,1)-1 coordi(1,2)];
p4=[coordi(1,1) coordi(1,2)-1];
posSet=[p1;p2;p3;p4];
for pt=1:size(posSet,1)
for pw=1:size(SobstacleLocation,1)
te=(posSet(pt,1:2)==SobstacleLocation(pw,:));
te=te(1,1)*te(1,2);
if te==1
posSet(pt,3)=1;
end
end
end
posPointCellNum=[];
for pt=1:size(posSet,1)
for pw=1:size(SallInf,1)
temp=(posSet(pt,1:2)== SallInf{pw,1});
temp=temp(1,1)*temp(1,2);
if temp==1
tempposPointCellNum=SallInf{pw,7};
posPointCellNum=[posPointCellNum;tempposPointCellNum];
end
end
end
c=intersect(posPointCellNum,ScandS{1,iu+1}(:,7));
if size(c,1)==0
ScandS{1,iu}(jun,:)=0;
end
end
end
tempLine=0;
each=[];
total=[];
for sci=1:size(ScandS,2)
each=[];
for on=1:size(ScandS{1,sci},1)
if sum(ScandS{1,sci}(on,:))~=0
tempLine=ScandS{1,sci}(on,:);
each=[each;tempLine];
end
end
total=[total,{each}];
end
candS=total;
return