function [corner_count,edge_count,unif_count,classif,ncorners,nedges,nunifs]=runframes(filename,t1,t2,circsize)

%[corner_count,edge_count,unif_count,class,ncorners,nedges,nuinfs]=runframes('filename',t1,t2,circsize)

%get movie & initialize matrices
filename=filename;
t1=t1;
t2=t2;
circsize=circsize;
movie=aviread(filename);
nframes=size(movie,2);
corner_count=zeros(size(movie(1,1).cdata,1),size(movie(1,1).cdata,2));
edge_count=zeros(size(corner_count));
unif_count=zeros(size(corner_count));

%increment counters
for k=1:nframes
    I=movie(1,k).cdata;
    [corners,edges,imcenter]=vharris(I,t1,t2,circsize);
    for i=1:size(I,1)
        for j=1:size(I,2)
            if sqrt((i-imcenter(1,1))^2+(j-imcenter(1,2))^2)<(circsize/2) & corners(i,j)==1
                corner_count(i,j)=corner_count(i,j)+1;
            elseif sqrt((i-imcenter(1,1))^2+(j-imcenter(1,2))^2)<(circsize/2) & edges(i,j)==1
                edge_count(i,j)=edge_count(i,j)+1;
            elseif sqrt((i-imcenter(1,1))^2+(j-imcenter(1,2))^2)<(circsize/2) & corners(i,j)==0 & edges(i,j)==0
                unif_count(i,j)=unif_count(i,j)+1;
            end
        end
    end
end

%classify as corner, edge or uniform
classif=zeros(size(corner_count));
ncorners=0;
nedges=0;
nunifs=0;

for i=1:size(classif,1)
        for j=1:size(classif,2)
            if sqrt((i-imcenter(1,1))^2+(j-imcenter(1,2))^2)<(circsize/2) & corner_count(i,j)>0 & corner_count(i,j)<nframes
                classif(i,j)=1;
                ncorners=ncorners+1;
            elseif sqrt((i-imcenter(1,1))^2+(j-imcenter(1,2))^2)<(circsize/2) & corner_count(i,j)==0 & edge_count(i,j)>0 & edge_count(i,j)<nframes
                classif(i,j)=2;
                nedges=nedges+1;
            elseif sqrt((i-imcenter(1,1))^2+(j-imcenter(1,2))^2)<(circsize/2) & (corner_count(i,j)==0 | corner_count(i,j)==nframes) & (edge_count(i,j)==0 | edge_count(i,j)==nframes)
                classif(i,j)=3;
                nunifs=nunifs+1;
            else classif(i,j)=NaN;
            end
        end
end