Ask Your Question
0

How do i resize my training images in fisher faces ?

asked Feb 1 '16

mano gravatar image

updated Feb 2 '16

I got an error saying In the Fisherfaces method all input samples (training images) must be of equal size! Expected 18769 pixels, but was 21316 pixels. in function train

Preview: (hide)

Comments

2

How about you just resize all the images to standard dimensions you define? Did you even take a look at the documentation? Also remarks like Please provide the code in python will not work on this forum, instead people will tend to completely ignore your question.

StevenPuttemans gravatar imageStevenPuttemans (Feb 2 '16)edit

I dont know how to resize those images I am new to python and opencv .

mano gravatar imagemano (Feb 2 '16)edit

My question is then, why in the world would you start programming face recognition if resizing images is still a difficult task? I suggest you start with the python tutorials step by step to get the hang of programming OpenCV in the Python languages.

StevenPuttemans gravatar imageStevenPuttemans (Feb 3 '16)edit
1

Thank you .

mano gravatar imagemano (Feb 3 '16)edit

Can you please atleast tell me why the training images need to be of equal size in fisherfaces ?

mano gravatar imagemano (Feb 3 '16)edit
1

The paper on fisher faces clearly states that you need equal sized face descriptors. That is only possible with equally sized images!

StevenPuttemans gravatar imageStevenPuttemans (Feb 3 '16)edit

Sorry . I figured it out why i was getting that error . I used to detect faces in training images and then add it to the recognizer.train function . since the size of faces detected used to differ I was getting that error . even though size of images used to be same

mano gravatar imagemano (Mar 21 '16)edit

Like said before, after detection you need to rescale to a single uniform scale to achieve a working person recognizer!

StevenPuttemans gravatar imageStevenPuttemans (Mar 21 '16)edit

1 answer

Sort by » oldest newest most voted
0

answered Feb 8 '17

You can use, "cv2.resize(image, (height, width))" this function to resize the training images just before you feed it to the recognizer

Preview: (hide)

Question Tools

1 follower

Stats

Asked: Feb 1 '16

Seen: 1,721 times

Last updated: Feb 02 '16