Ask Your Question
0

How do i resize my training images in fisher faces ?

asked 2016-02-01 09:59:06 -0600

mano gravatar image

updated 2016-02-02 10:24:57 -0600

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

edit retag flag offensive close merge delete

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 ( 2016-02-02 06:42:55 -0600 )edit

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

mano gravatar imagemano ( 2016-02-02 10:19:00 -0600 )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 ( 2016-02-03 03:57:15 -0600 )edit
1

Thank you .

mano gravatar imagemano ( 2016-02-03 06:10:09 -0600 )edit

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

mano gravatar imagemano ( 2016-02-03 12:27:48 -0600 )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 ( 2016-02-03 15:28:40 -0600 )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 ( 2016-03-21 03:18:35 -0600 )edit

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

StevenPuttemans gravatar imageStevenPuttemans ( 2016-03-21 04:08:29 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-08 06:59:37 -0600

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

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-02-01 09:59:06 -0600

Seen: 1,709 times

Last updated: Feb 02 '16