
function [pstat,sizes] = plotdogs(images)
%% images is a cell array of images

function A = close(p1,p2)
   A = 0;
   if (norm(p1-p2) < 2)
     A = 1;
   end;
end

function common = countCommon(P1,P2),
    common = 0;
    for p1=P1',
      for p2=P2',
	if close(p1,p2),
	  common = common + 1;
	  break;
	end;
      end;
    end;
end

pstat = [];
sizes = [];

for i=1:length(images),
  img = images{i};
  P{i} = rundog(imresize(img,[256 256])); 
  pstat(i,1) = size(P{i},1)
  pstat(i,2) = countCommon(P{1},P{i})

  sizes = [sizes; size(img)];
end;

figure(1);
bar(pstat);
figure(2);
plot(sizes(:,1)/256, pstat(:,2)/pstat(1,1));

end


