Im doing project on Face detection & Expression recognition and I have used viola Jones tool for face detection and Im saving detected face image in a folder how to extract facial feature using Artificial Neural network&MLP need help & guidance

1 view (last 30 days)
can someone help me with sample code and guidance for feature extraction and train the image Im Copying my code here
%Im using Web cam to capture Image as input and viola Jones vision toolbox for face Detection % camlist=webcamlist;
clear
cam=webcam(1);
preview(cam);
img=snapshot(cam);
image(img);
for idx=1:10
img=snapshot(cam);
image(img);
end
clear cam
A=img;
FaceDetector=vision.CascadeObjectDetector();
bboxes=step(FaceDetector,A);
B=insertObjectAnnotation(A,'rectangle',bboxes,'Face'); imshow(B),title('Faces on the image');
%bellow section is to crop the facial part and save in a folder %counter=1; for i = 1:size(bboxes,1) J = imcrop(B,bboxes(i,:)); figure(3),subplot(2,2,i); imshow(J); end savenam=strcat('D:\Matlab_prblms\' ,num2str(counter), '.jpg'); %this is where and what your image will be saved baseDir = 'D:\Matlab_prblms\detected_faces\'; % baseName = 'image_'; newName = [baseDir num2str(counter) '.tif']; handles.face=J; while exist(newName,'file') counter = counter + 1; newName= [baseDir num2str(counter) '.tif']; end imshow(J); fac=imresize(J,[64,64]); % fac=imresize(J,[150,172]); imshow(fac); imwrite(fac,newName);

Answers (0)

Community Treasure Hunt

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

Start Hunting!