function PROCEDURE_BuildNegativeBBoxsInParts(Positivebboxfilename,partno,ofhowmanyparts,objname);
%
%intent, generate 6 negatives for each positive bbox
%

if(nargin < 4)
  objname = 'car';
end
TTS.Train = 1:3547;
TTS.Test = [];
saveroot = '/cbcl/scratch01/bileschi/PrecomputedFeatures/StreetScenes/AppearanceDetector'
load(Positivebboxfilename);%-->pBBoxs,pIdxs,TTS
pBBoxs = round(pBBoxs);
ntodo = length(pIdxs);
nperpart = ceil(ntodo / ofhowmanyparts);
whichdoido = (nperpart*(partno-1)):(nperpart*(partno)) + 1;
whichdoido = intersect(whichdoido,1:ntodo);
myBBoxs = pBBoxs(whichdoido,:);
[nBBoxs_fragment,nIdxs_fragment] = ...
  GenerateRandNegativeBBoxSet(myBBoxs, TTS.Train,objname,10);
savename = fullfile(saveroot,sprintf('negative_%s_bbox_fragment%.2d.mat',objname,partno));
save(savename,'nBBoxs_fragment','nIdxs_fragment');
