function PROC_RecordObjectSpecificS2Centroids;
%
%intent: choose object specific centroids

sizes = [4;8;12;16;20];
nPerSize = 70;
sizes = sort(repmat(sizes,[nPerSize,1]));
yxSizes = [sizes,sizes];

objname = 'car';

[BBoxs, SSIdxs] = GetBBoxAndSSIdxs(objname);
savename = sprintf('%s_ObjSpecificS2Centroid_70x5.mat',objname);
fprintf('Got all the inputs\n');
whos
[caS2Centroid,SourceLocations,caRGBCentroid] = ObjectSpecificCentroids(yxSizes, BBoxs, SSIdxs ,savename);

function [BBox, Idx] = GetBBoxAndSSIdxs(objname)
Root = '/cbcl/scratch01/bileschi/PrecomputedFeatures/StreetScenes/AppearanceDetector';
l = dir(fullfile(Root, sprintf('AppearanceData_128x128_%s*',objname)));
n = length(l);
BBox = [];
Idx =[];
for i = 1:n
   load(fullfile(Root,l(i).name));%--> myIdx, myBBox, y
   f = find(y == 1);
   myIdx = myIdx(f);
   myBBox = myBBox(f,:);
   BBox = [BBox;myBBox];
   Idx = [Idx,myIdx];
end

