Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions code/codes/MTCNNv1/generateBoundingBox.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,17 @@
%use heatmap to generate bounding boxes
stride=2;
cellsize=12;
boundingbox=[];
map=map';
dx1=reg(:,:,1)';
dy1=reg(:,:,2)';
dx2=reg(:,:,3)';
dy2=reg(:,:,4)';
dx1=reg(:,:,1);
dy1=reg(:,:,2);
dx2=reg(:,:,3);
dy2=reg(:,:,4);
[y x]=find(map>=t);
a=find(map>=t);
if size(y,1)==1
y=y';x=x';score=map(a)';dx1=dx1';dy1=dy1';dx2=dx2';dy2=dy2';
else
score=map(a);
end
score=map(a);
reg=[dx1(a) dy1(a) dx2(a) dy2(a)];
if isempty(reg)
reg=reshape([],[0 3]);
end
boundingbox=[y x];
boundingbox=[x y];
boundingbox=[fix((stride*(boundingbox-1)+1)/scale) fix((stride*(boundingbox-1)+cellsize-1+1)/scale) score reg];
end