I have directory, there are many images in this directory, I want to detect the face from images, and create the directories of image name store only the faces on that directory. How to do this, kindly help me
2 次查看(过去 30 天)
显示 更早的评论
myDir = 'C:\myImages\';
this is the name of directory which contains many images. i want to detect the faces from images and want to crop the face from image and save it like: For example. There is one image name 1.jpg, create the directory name 1 and inside directory there should faces stored which were present in the image 1.jpg.
6 个评论
Image Analyst
2017-11-30
Remants of original discussion(before they also get deleted):
myDir = 'C:\myImages\';
this is the name of directory which contains many images. i want to detect the faces from images and want to crop the face from image and save it like: For example. There is one image name 1.jpg, create the directory name 1 and inside directory there should faces stored which were present in the image 1.jpg.
回答(1 个)
Image Analyst
2017-11-18
"i have done till face detection and cropping, but i am facing difficulty to save the cropped face "
OK, good that you've already done that, because that's the hardest part.
To save the cropped image, simply call imwrite:
baseFileName = sprintf('Face#%d.png', currentFaceIndex);
fullFileName = fullfile(outputFolder, baseFileName);
imwrite(croppedImage, fullFileName);
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!