%SCRIPT_GetAppearanceLevelTrainData
%
%intent:  Extract training data for appearance based object detectors

HelpTextInfo = help('SCRIPT_GetAppearanceLevelTrainData');
cd /cbcl/scratch01/bileschi/PrecomputedFeatures/StreetScenes/AppearanceDetector
load('CAfilelist_FilterSS');%-->CAfilelist
load('/cbcl/scratch01/bileschi/PrecomputedFeatures/StreetScenes/DataFractures/SSFracture_Even_01');
%-->DataFracture
%TrainIndicies = DataFracture.Train_Obj;
TrainIndicies = 1:3547;
resolution = [16 16];
MAXRETURN = 3000;

obj = 'pedestrian';
[X,y,N, ExtractedLocations] = ...
SobelObjectDetector_GetTrainData(CAfilelist,TrainIndicies,resolution,obj,MAXRETURN);
savefile = sprintf('SobelAppearanceTrainData6_%s.mat',obj);
save(savefile,'X','y','N','ExtractedLocations','resolution','HelpTextInfo');

obj = 'car';
[X,y,N, ExtractedLocations] = ...
SobelObjectDetector_GetTrainData(CAfilelist,TrainIndicies,resolution,obj,MAXRETURN);
savefile = sprintf('SobelAppearanceTrainData6_%s.mat',obj);
save(savefile,'X','y','N','ExtractedLocations','resolution','HelpTextInfo');

obj = 'bicycle';
[X,y,N, ExtractedLocations] = ...
SobelObjectDetector_GetTrainData(CAfilelist,TrainIndicies,resolution,obj,MAXRETURN);
savefile = sprintf('SobelAppearanceTrainData6_%s.mat',obj);
save(savefile,'X','y','N','ExtractedLocations','resolution','HelpTextInfo');

obj = 'sidewalk';
[X,y,N, ExtractedLocations] = ...
SobelObjectDetector_GetTrainData(CAfilelist,TrainIndicies,resolution,obj,MAXRETURN);
savefile = sprintf('SobelAppearanceTrainData6_%s.mat',obj);
save(savefile,'X','y','N','ExtractedLocations','resolution','HelpTextInfo');

obj = 'tree';
[X,y,N, ExtractedLocations] = ...
SobelObjectDetector_GetTrainData(CAfilelist,TrainIndicies,resolution,obj,MAXRETURN);
savefile = sprintf('SobelAppearanceTrainData6_%s.mat',obj);
save(savefile,'X','y','N','ExtractedLocations','resolution','HelpTextInfo');

obj = 'store';
[X,y,N, ExtractedLocations] = ...
SobelObjectDetector_GetTrainData(CAfilelist,TrainIndicies,resolution,obj,MAXRETURN);
savefile = sprintf('SobelAppearanceTrainData6_%s.mat',obj);
save(savefile,'X','y','N','ExtractedLocations','resolution','HelpTextInfo');

obj = 'sky';
[X,y,N, ExtractedLocations] = ...
SobelObjectDetector_GetTrainData(CAfilelist,TrainIndicies,resolution,obj,MAXRETURN);
savefile = sprintf('SobelAppearanceTrainData6_%s.mat',obj);
save(savefile,'X','y','N','ExtractedLocations','resolution','HelpTextInfo');

obj = 'building';
[X,y,N, ExtractedLocations] = ...
SobelObjectDetector_GetTrainData(CAfilelist,TrainIndicies,resolution,obj,MAXRETURN);
savefile = sprintf('SobelAppearanceTrainData6_%s.mat',obj);
save(savefile,'X','y','N','ExtractedLocations','resolution','HelpTextInfo');

obj = 'road';
[X,y,N, ExtractedLocations] = ...
SobelObjectDetector_GetTrainData(CAfilelist,TrainIndicies,resolution,obj,MAXRETURN);
savefile = sprintf('SobelAppearanceTrainData6_%s.mat',obj);
save(savefile,'X','y','N','ExtractedLocations','resolution','HelpTextInfo');

