How to resize an image for face detection?

2 visualizaciones (últimos 30 días)
Ana
Ana el 8 de Jul. de 2014
Respondida: Michael scheinfeild el 9 de Jul. de 2014
Hi all,
I'm still new in Image processing. I just want to know:
1) What is the actual size for face detection function?
2) How to resize the image?
Because i got the warning that mentioned "Image is too big to fit on screen; displaying at 25% "
This is the normal code to process the image:
faceDetector = vision.CascadeObjectDetector;
I = imread('detectface.jpg');
bboxes = step(faceDetector, I);
IFaces = insertObjectAnnotation(I, 'rectangle', bboxes, 'Face');
figure, imshow(IFaces), title('Detected faces');

Respuesta aceptada

Anand
Anand el 8 de Jul. de 2014
The vision.CascadeObjectDetector does not rely on you providing an image at a particular size.
That warning is only related to the image display. It is indicating that the image is too big for your monitor, and so MATLAB is displaying the image at a smaller size. This does not affect the face detection.
If you find that the faces you're looking for are not being detected correctly, I would suggest playing around with the MinSize, MaxSize and ScaleFactor parameters.
  1 comentario
Ana
Ana el 9 de Jul. de 2014
Yeah. The current code do not detect the face correctly.

Iniciar sesión para comentar.

Más respuestas (2)

Image Analyst
Image Analyst el 8 de Jul. de 2014
I don't know what you mean by the size of a function . To get the size of an image, you can do
[rows, columns, numberOfColorChannels] = size(I);
though I recommend you not use I for the image variable. It looks too much like l (lower case "L") or 1 (the number).
You can resize an image with the imresize() function.

Michael scheinfeild
Michael scheinfeild el 9 de Jul. de 2014
its better to resize all faces to same size like 128*64

Categorías

Más información sobre Computer Vision with Simulink en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by