I have directory which has many images , i want to perform face detection and cropping process on these images. kindly guide me, how to do this??

3 ビュー (過去 30 日間)
here is my code for single image, i want to perform this task on many images.
I=imread('E:\a.jpg');
figure(1),imshow(I);
FaceDetect = vision.CascadeObjectDetector;
BB = step(FaceDetect,I);
figure(2),imshow(I);
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',3,'LineStyle','- ','EdgeColor','r');
end
for i = 1:size(BB,1)
J= imcrop(I,BB(i,:));
% figure(3),subplot(5,5,i);imshow(J);
fname = sprintf('b_cropped_%d.jpg', i);
fpath = fullfile('E:\face', fname);
imwrite(J, fpath)
% imwrite(J,'E:\g_cropped.jpg')
end

回答 (1 件)

Image Analyst
Image Analyst 2017 年 11 月 20 日
  1 件のコメント
saeeda saher
saeeda saher 2017 年 11 月 29 日
I read this, but could not find any solution. kindly help me by editing my provided code. thanks

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by