0081 <span class="comment">%seek to StartFrame for initial background calculation</span>
0082 seek(video, StartFrame);
0083 
0084 mask = ellipse.mask;
0085 
0086 disp(<span class="string">'Calculating background...'</span>)
0087 background = zeros(height, width);
0088 <span class="keyword">for</span> bframe = 1:NBackFrames; 
0089     img = getframe(video);
0090     current = mask.*double(img(:,:,1));  <span class="comment">%just take first color matrix and mask out unwanted portions</span>
0091     backgrou