Hello people. I used the algorithm below to detect the face of the people, but would like to save the cropped face, how can I do this?
A = imread ('marcelo.jpg');
FaceDetector = vision.CascadeObjectDetector();
BBOX = step(FaceDetector, A);
B = insertObjectAnnotation (A, 'rectangle', BBOX, 'Face'); imshow(B), title('Detected Faces');

 채택된 답변

Image Analyst
Image Analyst 2016년 11월 2일

0 개 추천

Try putting (the badly-named) A and the bounding box into imcrop():
croppedImage = imcrop(A, BBOX);

댓글 수: 2

Valmir Junior
Valmir Junior 2016년 11월 19일
Great worked thank you very much.
Would you kindly help me with another question?
I performed the delimitation of the face with his help, found the position of the eyes and through the position of the eyes aligned the image with the component imrotate.
I need now to delimit the image a little above the line of the eyes and also to delimit in the horizontal because when the alignment was done, the image was left unadjusted. Follows an image represented. Can you help me? Thanks in advance
rosto = (imrotate(rosto,(180/pi)*atan((BBREye(2)-BBLEye(2))/(BBREye(1)-BBLEye(1))))); imwrite(rosto, strcat('rotacionada.jpg'));
Image Analyst
Image Analyst 2016년 11월 20일
imrotate has options where you can expand the canvass, or crop the image if the corners go outside the canvass. Perhaps you want the cropping option instead of the expand the canvass option.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

질문:

2016년 11월 2일

댓글:

2016년 11월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by