-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcreateRectangles.m
More file actions
81 lines (64 loc) · 2.36 KB
/
Copy pathcreateRectangles.m
File metadata and controls
81 lines (64 loc) · 2.36 KB
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
81
function cell_inc=createRectangles(lengthToSearch,othk, lenIncrStep, nBands,sz)
% creates rectangular filters at each integer angle: 360 filters in total.
% filters are created with varying lengths to use in different steps of the
% algorithm
%INPUT:
%lengthToSearch: filter length,
%othk: filter width,
%lenIncrStep: number of increments,
%nBands: number of orientation which is used in algorithm,
%sz: size of input.
cell_idx=cell(nBands/2,1);
cell_inc=cell(lenIncrStep,1);
for s=1: lenIncrStep
length = lengthToSearch + 4.0*((s-1.0)*lengthToSearch)/lenIncrStep;
thk= othk + 1*(s*othk)/(lenIncrStep);
for idx =0: nBands/2-1
length = length/(1.0+ 1.0*idx/nBands)^2;
sec=cell(360,1);
t=1;
for i=91:179
dd=[tand(i) 1]; dr = sqrt(dot(dd', dd));
rectangle=getRectangle_alt(sz/2,dd,dr,length,thk,sz);
%figure; imshow(rectangle,[]);
sec{t}=rectangle;
t=t+1;
end
rectangle=getRectangle_alt(sz/2, [0 length], length,length, thk, sz);
sec{t}=rectangle;
t=t+1;
for i=1:89
dd=[tand(i) 1]; dr = sqrt(dot(dd', dd));
rectangle=getRectangle_alt(sz/2,dd,dr,length,thk,sz);
%figure; imshow(rectangle,[]);
sec{t}=rectangle;
t=t+1;
end
rectangle=getRectangle_alt(sz/2, [length 0], length,length, thk, sz);
sec{t}=rectangle;
t=t+1;
for i=91:179
dd=[-tand(i) -1]; dr = sqrt(dot(dd', dd));
rectangle=getRectangle_alt(sz/2,dd,dr,length,thk,sz);
%figure; imshow(rectangle,[]);
sec{t}=rectangle;
t=t+1;
end
rectangle=getRectangle_alt(sz/2, [0 -length], length,length, thk, sz);
sec{t}=rectangle;
t=t+1;
for i=1:89
dd=[-tand(i) -1]; dr = sqrt(dot(dd', dd));
rectangle=getRectangle_alt(sz/2,dd,dr,length,thk,sz);
%figure; imshow(rectangle,[]);
sec{t}=rectangle;
t=t+1;
end
rectangle=getRectangle_alt(sz/2, [length 0], length,length, thk, sz);
sec{t}=rectangle;
cell_idx{idx+1}=sec;
end
cell_inc{s}=cell_idx;
end
% Created by Cihan Kayasandik
%August 2017