Line | |
---|
1 | function INC = motion_incidence(fo,nframes,npoints) |
---|
2 | % Each column is a point. Rows 2i and 2i+1 are the x and y |
---|
3 | % coordinates of the point in frame i. |
---|
4 | |
---|
5 | INC = ones(2*nframes,npoints); |
---|
6 | for i = 1:npoints |
---|
7 | % There's got to be an easy way to do this without looping. |
---|
8 | rn = rand; |
---|
9 | if rn < 2/3 |
---|
10 | ol = occlusion_length(fo*nframes,nframes); |
---|
11 | if rn < 1/3 |
---|
12 | INC((1+2*nframes-2*ol):(2*nframes),i) = zeros(2*ol,1); |
---|
13 | else |
---|
14 | INC(1:2*ol,i) = zeros(2*ol,1); |
---|
15 | end |
---|
16 | else |
---|
17 | ol1 = occlusion_length(fo*nframes/2,nframes/2); |
---|
18 | ol2 = occlusion_length(fo*nframes/2,nframes/2); |
---|
19 | ol = ol1+ol2; |
---|
20 | INC([1:2*ol1,(1+2*nframes-2*ol2):(2*nframes)],i) = zeros(2*ol,1); |
---|
21 | end |
---|
22 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.