how to crop face from many number of frames(video)?I just croped 3 faces from single frame.Here is my code.Also show me how to save cropped faces from each frame in array?

1 view (last 30 days)
clc; clear all; obj=VideoReader('vtu.avi');
img = read(obj,1); figure(1),imshow(img);
FaceDetect = vision.CascadeObjectDetector;
BB = step(FaceDetect,img);
figure(2),imshow(img);
end
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',3,'LineStyle','-','EdgeColor','r');
end for i = 1:size(BB,1) J= imcrop(img,BB(i,:)); figure(3),subplot(2,2,i);imshow(J); end

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!