%SCRIPT_ConvertShapeBasedObjectsToC1_AdditionalFilters
%
Root = '/cbcl/scratch01/bileschi/PrecomputedFeatures/StreetScenes/AppearanceDetector';
Template = 'AppearanceData_128x128_%s_f%.3d.mat';
NewTemplate = 'AppearanceData_C1regular_%s_f%.3d.mat';
variablename = 'grayX';

savename = '/cbcl/scratch01/bileschi/SCRIPT_ConvertShapeBasedObjectsToC1_parallel_globalvar.mat';
%load(savename);%-->myIdx;
%PROCEDURE_ResetMyIdx(savename);
myIdx = PROCEDURE_IncrementMyIdx(savename);

sourceIdx = myIdx;
objidx = 1;
while((myIdx < 11) && (myIdx > 4))
  myIdx = PROCEDURE_IncrementMyIdx(savename);
end
if(myIdx > 10)
  objidx = 2;
  sourceIdx = sourceIdx - 10;
end
if(myIdx > 18)
  objidx = 3;
  sourceIdx = sourceIdx - 8;
end
if(myIdx > 20)
  fprintf('job completely allocated \n');
else
  fprintf('ProcessNumber %d Object %d sourceIdx %d starting...\n', myIdx, objidx, sourceIdx);
  PROCEDURE_ShapeBasedObjectsToC1(Root,Template, NewTemplate, sourceIdx, variablename, objidx);
end
