summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 761644a)
raw | patch | inline | side by side (parent: 761644a)
author | Manu Mathew <mathmanu@users.noreply.github.com> | |
Thu, 23 Mar 2017 03:54:17 +0000 (09:24 +0530) | ||
committer | Manu Mathew <mathmanu@users.noreply.github.com> | |
Thu, 23 Mar 2017 03:54:17 +0000 (09:24 +0530) |
detector/acfDetect.m | patch | blob | history | |
detector/acfJacintoTrainTest.m | patch | blob | history | |
detector/acfTrain.m | patch | blob | history |
diff --git a/detector/acfDetect.m b/detector/acfDetect.m
index 247c6ac3e564d47bb504b1c2b402d21ee11d55bf..0fa4b06ad69d69fc925cdf254acdbf0177d461ec 100644 (file)
--- a/detector/acfDetect.m
+++ b/detector/acfDetect.m
imreadf=opts.imreadf; imreadp=opts.imreadp;
shrink=pPyramid.pChns.shrink; pad=pPyramid.pad;
separate=nDs>1 && isfield(pNms,'separate') && pNms.separate;
+if isfield(opts,'detOffset'), detOffset=opts.detOffset; else, detOffset=0; end
+
% read image and compute features (including optionally applying filters)
if(all(ischar(I))), I=feval(imreadf,I,imreadp{:}); end
P=chnsPyramid(I,pPyramid); bbs=cell(P.nScales,nDs);
modelDsPad=opts.modelDsPad; modelDs=opts.modelDs;
bb = acfDetect1(P.data{i},Ds{j}.clf,shrink,...
modelDsPad(1),modelDsPad(2),opts.stride,opts.cascThr, opts.detThr);
- shift=(modelDsPad-modelDs)/2-pad;
+ shift=(modelDsPad-modelDs)/2-pad+detOffset;
bb(:,1)=(bb(:,1)+shift(2))/P.scaleshw(i,2);
bb(:,2)=(bb(:,2)+shift(1))/P.scaleshw(i,1);
bb(:,3)=modelDs(2)/P.scales(i);
index dad694c6304aac48caf68b29701dfeeda21fe0f3..f78c2532e1f2f553e4b4ba980a666d7b5e3d3389 100644 (file)
opts.cascThr=-1; %default: -1
opts.detThr=0; %default: -1
opts.cascCal=0; %default: 0.005 or 0.01(below)
+ opts.detOffset=0; %position offset for detection. default: 0 is best for quality.
%opts.adjustPyramidPad=0; %pyramid padding adjustment in acfTrain(). Pyramid padding is better for accuracy.
%opts.pPyramid.pad=[0,0]; %default: ceil((opts.modelDsPad-opts.modelDs)/shrink/2)*shrink;
diff --git a/detector/acfTrain.m b/detector/acfTrain.m
index ee799ab3c4e55247b9695fd44a68107644f3765c..a61d1fd054dcfc34a178c7b9a6a4f90f07576a8a 100644 (file)
--- a/detector/acfTrain.m
+++ b/detector/acfTrain.m
'posImgDir','', 'negImgDir','', 'posWinDir','', 'negWinDir','', ...
'imreadf',@imread, 'imreadp',{}, 'pLoad',{}, 'nPos',inf, 'nNeg',5000, ...
'nPerNeg',25, 'nAccNeg',10000, 'pJitter',{}, 'winsSave',0, 'detThr',-1 ...
- 'bsOlap',0.1, 'adjustPyramidPad',1};
+ 'bsOlap',0.1, 'adjustPyramidPad',1, 'detOffset',0};
opts = getPrmDflt(varargin,dfs,1);
% fill in remaining parameters
p=chnsPyramid([],opts.pPyramid); p=p.pPyramid;