Ask Your Question
0

Local Binary Patterns Histograms Regions

asked 2016-12-11 09:04:06 -0600

Kelvin gravatar image

I know that the representation proposed by Ahonen et. al. is to divide the LBP image into x local regions and extract a histogram from each region.

How many regions OpenCV uses to extract these histograms? Is this a fixed number of regions or can I define this as a parameter?

I am using the LBPH function on Python, for example:

lbph = cv2.face.createLBPHFaceRecognizer()
lbph.train(trainingImages, np.array(labels))
subject, confidence = lbph.predict( image )

Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2016-12-11 10:18:46 -0600

berak gravatar image

updated 2016-12-11 10:54:13 -0600

as you can see from the c++ manuals, a default grid count of 8 is used.

yes, you can change it, (like any other argument used there):

# use "named" args, if skipping defaults
lbph = cv2.face.createLBPHFaceRecognizer( grid_x=9, grid_y=9 )

using a larger number will make your histograms more "sparse", a smaller more "dense".

edit flag offensive delete link more

Comments

Thank you so much @berak.

Kelvin gravatar imageKelvin ( 2016-12-11 10:39:11 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-11 09:04:06 -0600

Seen: 544 times

Last updated: Dec 11 '16