How can i create a big BoundingBox from many small BoundingBoxes for Face Detection
Mostra commenti meno recenti
I have used a pre-trained face detection model https://www.ics.uci.edu/~xzhu/face/ and i have the following results

My question is how can i get a big bounding box to extract the detected face , like this:

You can download the code and images from here: https://www.ics.uci.edu/~xzhu/face/face-release1.0-basic.zip
% compile.m should work for Linux and Mac.
% To Windows users:
% If you are using a Windows machine, please use the basic convolution (fconv.cc).
% This can be done by commenting out line 13 and uncommenting line 15 in
% compile.m
compile;
% load and visualize model
% Pre-trained model with 146 parts. Works best for faces larger than 80*80
load face_p146_small.mat
% % Pre-trained model with 99 parts. Works best for faces larger than 150*150
% load face_p99.mat
% % Pre-trained model with 1050 parts. Give best performance on localization, but very slow
% load multipie_independent.mat
disp('Model visualization');
visualizemodel(model,1:13);
disp('press any key to continue');
pause;
% 5 levels for each octave
model.interval = 5;
% set up the threshold
model.thresh = min(-0.65, model.thresh);
% define the mapping from view-specific mixture id to viewpoint
if length(model.components)==13
posemap = 90:-15:-90;
elseif length(model.components)==18
posemap = [90:-15:15 0 0 0 0 0 0 -15:-15:-90];
else
error('Can not recognize this model');
end
ims = dir('images/*.jpg');
for i = 1:length(ims),
fprintf('testing: %d/%d\n', i, length(ims));
im = imread(['images/' ims(i).name]);
clf; imagesc(im); axis image; axis off; drawnow;
tic;
bs = detect(im, model, model.thresh);
bs = clipboxes(im, bs);
bs = nms_face(bs,0.3);
dettime = toc;
% show highest scoring one
figure,showboxes(im, bs(1),posemap),title('Highest scoring detection');
% show all
%figure,showboxes(im, bs,posemap),title('All detections above the threshold');
fprintf('Detection took %.1f seconds\n',dettime);
disp('press any key to continue');
pause;
close all;
end
disp('done!');
I think that the cordinates of the small bounding boxes are given by:
*bs.xy = *
313 209 352 248
305 209 344 248
305 209 344 248
321 209 360 248
329 209 368 248
313 193 352 232
313 177 352 216
313 161 352 200
313 153 352 192
289 153 328 192
281 153 320 192
273 153 312 192
281 145 320 184
273 145 312 184
265 153 304 192
249 137 288 176
257 129 296 168
273 121 312 160
289 129 328 168
305 137 344 176
337 153 376 192
345 153 384 192
353 153 392 192
345 145 384 184
353 145 392 184
361 153 400 192
377 137 416 176
369 129 408 168
353 129 392 168
...
385 225 424 264
385 209 424 248
393 185 432 224
393 161 432 200
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Introduction to Installation and Licensing in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!