Home > track > staticCellProb.m

staticCellProb

PURPOSE ^

SYNOPSIS ^

function frames = staticCellProb(frames)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function frames = staticCellProb(frames)
0002 static_dist = 3;
0003 
0004 % For each frame
0005 for fr = 2: length(frames)-1
0006     for ce = 1: frames(fr).nCells        
0007         count = 1;
0008         
0009         % Search previous
0010         prev_fr = fr - 1;     
0011         curr_frame = frames(fr);
0012         curr_cell = frames(fr).Cells(ce).Id;
0013         static  =1;
0014         while static==1 && prev_fr>=1
0015             prev_frame = frames(prev_fr);
0016             prev_table = get_dtable(curr_frame,prev_frame);
0017             [prev_dist prev_index] = min(prev_table(curr_cell,:));
0018             if (prev_dist <= static_dist)
0019                 count = count +1 ;
0020                 curr_frame = prev_frame;
0021                 prev_fr =prev_fr - 1;
0022                 curr_cell = prev_frame.Cells(prev_index).Id;
0023             else
0024                 static = 0 ;
0025             end
0026         end
0027         
0028         % Search next
0029         next_fr = fr+1;
0030         curr_frame = frames(fr);
0031         curr_cell = frames(fr).Cells(ce).Id;
0032         static = 1;
0033         while static==1 && next_fr<=(length(frames)-1)
0034             next_frame = frames(next_fr);
0035             next_table = get_dtable(curr_frame,next_frame);
0036             [next_dist next_index] = min(next_table(curr_cell,:));
0037             if (next_dist <=static_dist)
0038                 count = count + 1;
0039                 curr_frame = next_frame;
0040                 next_fr = next_fr + 1;
0041                 curr_cell = next_frame.Cells(next_index).Id;
0042             else
0043                 static =0;
0044             end
0045         end
0046         
0047         frames(fr).Cells(ce).Status= count;
0048     end
0049 end
0050

Generated on Thu 17-Mar-2011 14:45:51 by m2html © 2005