Routine explanation 07-Face-Detection->face_recognition face recognition

Video tutorial 19 - Distinguishing different faces:https://singtown.com/learn/50033/

Face recognition with LBP features.

AT&T faces Database:\ The catalogue contains a set of faces photographed at Olivetti's research laboratory in Cambridge, England, between April 1992 and April 1994

There are 10 different images for 40 different subjects. For some subjects, the images were taken at different times, with slightly varying lighting, facial expressions (eyes open/closed, smiling/not smiling) and facial details (glasses/no glasses). All images are taken against a dark, uniform background, and the subject is in the top right, front position (with tolerance for some side movements).

These files are in PGM format and can be easily viewed using the "xv" program. Each image is 92x112, 8-bit grayscale. The images are divided into 40 directories (one for each topic), named: sX

Where X represents the topic number (between 1 and 40). In each directory, there are 10 different images for the selected theme, named Y.gm

Where Y represents images of a particular topic (between 1 and 10).

Credit the Olivetti Research Laboratory for using these images.\ A handy reference is facial recognition work using some of these images:

F. Samaria and A. Harter\ "Parameterization of stochastic models for Face Recognition"\ 2nd IEEE Workshop on Computer Vision Applications\ ----------------- Sarasota (Florida), December 1994.

# 用LBP特征进行人脸识别。
# 见 Timo Ahonen's "Face Recognition with Local Binary Patterns".
#
# 运行示例之前:
# 1) 下载AT&T faces数据库http://www.cl.cam.ac.uk/Research/DTG/attarchive/pub/data/att_faces.zip
# 2) 提取并复制orl_faces目录到SD卡根目录。
#
# NOTE: This is just a PoC implementation of the paper mentioned above, it does Not work well in real life conditions.
# 注意:这只是上面提到的论文的一个PoC实现,在现实生活中并不适用。

import sensor, time, image

SUB = "s2"
NUM_SUBJECTS = 5
NUM_SUBJECTS_IMGS = 10

img = image.Image("orl_faces/%s/1.pgm"%(SUB))
d0 = img.find_lbp((0, 0, img.width(), img.height()))
img = None

print("")
for s in range(1, NUM_SUBJECTS+1):
    dist = 0
    for i in range(2, NUM_SUBJECTS_IMGS+1):
        img = image.Image("orl_faces/s%d/%d.pgm"%(s, i))
        d1 = img.find_lbp((0, 0, img.width(), img.height()))
        dist += image.match_descriptor(d0, d1)
    print("Average dist for subject %d: %d"%(s, dist/NUM_SUBJECTS_IMGS))

Singtown Technology OpenMV official Chinese document function explanation:

results matching ""

    No results matching ""