[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN105608448B - A method and device for extracting LBP features based on facial key points - Google Patents

A method and device for extracting LBP features based on facial key points Download PDF

Info

Publication number
CN105608448B
CN105608448B CN201610093896.1A CN201610093896A CN105608448B CN 105608448 B CN105608448 B CN 105608448B CN 201610093896 A CN201610093896 A CN 201610093896A CN 105608448 B CN105608448 B CN 105608448B
Authority
CN
China
Prior art keywords
area
region
preset value
face
key point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201610093896.1A
Other languages
Chinese (zh)
Other versions
CN105608448A (en
Inventor
冯谨强
高伟杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Group Co Ltd
Original Assignee
Hisense Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Group Co Ltd filed Critical Hisense Group Co Ltd
Priority to CN201610093896.1A priority Critical patent/CN105608448B/en
Publication of CN105608448A publication Critical patent/CN105608448A/en
Application granted granted Critical
Publication of CN105608448B publication Critical patent/CN105608448B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种基于脸部关键点的LBP特征提取方法和装置,本发明涉及图像处理及模式识别技术领域,旨在解决同一人、不同人脸姿态下,提取的脸部同一关键点的LBP特征差别较大的问题,进而提高人脸识别准确率。该方法根据脸部图像的关键点确定该脸部图像的人脸姿态,进而根据该脸部图像的人脸姿态修正不同脸部关键点所对应的椭圆邻域半径,建立了椭圆邻域半径与该脸部图像的人脸姿态之间的对应关系,从而避免了同一个人不同人脸姿态下,脸部图像局部缩放比例不同,导致同一关键点提取的LBP特征差别较大的问题,提高了不同人脸姿态下基于脸部关键点的LBP特征提取的有效性,进而提高了人脸识别准确率。

The invention discloses a method and device for extracting LBP features based on facial key points. The invention relates to the technical field of image processing and pattern recognition, and aims to solve the problem of extracting the same key point of the face under the same person and different face poses. The problem of large differences in LBP features can improve the accuracy of face recognition. This method determines the face pose of the face image according to the key points of the face image, and then corrects the ellipse neighborhood radius corresponding to different face key points according to the face pose of the face image, and establishes the relationship between the ellipse neighborhood radius and The corresponding relationship between the face poses of the face image avoids the problem that the local zoom ratio of the face image is different under different face poses of the same person, resulting in a large difference in the LBP features extracted from the same key point, and improves the accuracy of different face images. The effectiveness of LBP feature extraction based on facial key points under face pose, thereby improving the accuracy of face recognition.

Description

一种基于脸部关键点的LBP特征提取方法和装置A method and device for extracting LBP features based on facial key points

技术领域technical field

本发明涉及图像处理及模式识别技术领域,尤其涉及一种基于脸部关键点的LBP特征提取方法和装置。The invention relates to the technical fields of image processing and pattern recognition, in particular to a method and device for extracting LBP features based on facial key points.

背景技术Background technique

人脸识别技术是通过分析脸部器官的位移形状和位置关系来进行身份鉴别的,是一种重要的生物识别技术,广泛应用于安防、门禁以及监控等领域。人脸识别技术的主要算法包括基于几何特征的模板匹配的人脸识别方法、基于几何特征的人脸识别方法、基于样本学习的人脸识别方法以及基于纹理特征的人脸识别方法。其中,基于人脸纹理特征的人脸识别方法主要依靠LBP(Local Binary Pattern)即局部二值模式进行脸部特征提取。Face recognition technology is to identify the identity by analyzing the displacement shape and positional relationship of facial organs. It is an important biometric technology and is widely used in security, access control, monitoring and other fields. The main algorithms of face recognition technology include face recognition methods based on template matching based on geometric features, face recognition methods based on geometric features, face recognition methods based on sample learning, and face recognition methods based on texture features. Among them, the face recognition method based on facial texture features mainly relies on LBP (Local Binary Pattern), that is, local binary pattern for facial feature extraction.

基于LBP的脸部特征提取方法主要包括两种,一种是针对整个脸部图像进行分块,对每一块图像进行多尺度的LBP特征提取,归一化后将所有块的LBP特征组合得到整个脸部的LBP特征;另一种是以脸部关键点(示例的,眼球、鼻子、嘴角、眉毛等)为中心,提取其周围一定区域的LBP特征,归一化后将所有关键点的LBP特征,组合得到整个脸部的LBP特征。然而,上述两种基于LBP的脸部特征提取方法,对同一个人不同姿态的脸部图像,均是以某点为中心点,采集某个固定半径圆型邻域内的若干个采样点的像素值,进而对该若干个采样点的像素值与中心点像素值进行比较,得到该中心点的LBP特征值。因此,现有的基于LBP的脸部特征提取方法,没有考虑姿态变化所引起的脸部图像缩放比例的不同,导致同一个人不同姿态下的脸部图像,针对其同一位置的中心点,所提取的相同半径的圆形邻域内若干个采样点的像素值不同,导致该中心点的LBP特征相差较大,进而导致人脸识别不准确。The face feature extraction method based on LBP mainly includes two types, one is to divide the entire face image into blocks, perform multi-scale LBP feature extraction on each block image, and combine the LBP features of all blocks after normalization to obtain the whole face image. The LBP feature of the face; the other is based on the key points of the face (for example, eyeballs, nose, corners of the mouth, eyebrows, etc.), extracting the LBP features of a certain area around it, and normalizing the LBP of all key points The features are combined to obtain the LBP features of the entire face. However, the above two facial feature extraction methods based on LBP, for the facial images of the same person with different postures, all use a certain point as the center point to collect the pixel values of several sampling points in a circular neighborhood with a fixed radius , and then compare the pixel values of the several sampling points with the pixel values of the center point to obtain the LBP feature value of the center point. Therefore, the existing facial feature extraction method based on LBP does not consider the difference in facial image scaling caused by posture changes, resulting in the facial images of the same person under different postures, for the central point of the same position, the extracted The pixel values of several sampling points in the circular neighborhood of the same radius are different, resulting in a large difference in the LBP features of the center point, which in turn leads to inaccurate face recognition.

示例的,如附图1和附图2所示,图1和图2所示分别为同一个人正脸和左侧脸时的脸部图像,对于其嘴角处同一中心点A的LBP特征提取,首先提取图1、图2所示半径为R的圆形邻域内N个采样点的像素值,参考图1和图2所示,由于左侧脸时,半径为R的圆形邻域内N个采样点中的部分采样点超出了人脸范围,导致图1、图2所示同一中心点A的相同圆形邻域内N个采样点的像素值差别较大,进而导致图1、图2所提出处的同一中心点A的LBP特征差别较大,进而导致图1、图2所示脸部图像无法识别为同一人,引起人脸识别不准确。Exemplary, as shown in accompanying drawing 1 and accompanying drawing 2, shown in Fig. 1 and Fig. 2 is the face image of the same person's front face and left side face respectively, for the LBP feature extraction of the same central point A at the corner of its mouth, First, extract the pixel values of N sampling points in the circular neighborhood with radius R shown in Figure 1 and Figure 2. Referring to Figure 1 and Figure 2, due to the left face, N sampling points in the circular neighborhood with radius R Some of the sampling points exceed the range of the face, resulting in a large difference in the pixel values of the N sampling points in the same circular neighborhood of the same center point A shown in Figure 1 and Figure 2, which in turn leads to the The LBP features of the same center point A at the proposed location are quite different, which leads to the fact that the facial images shown in Figure 1 and Figure 2 cannot be recognized as the same person, resulting in inaccurate face recognition.

发明内容Contents of the invention

本发明实施例提供一种基于LBP的脸部特征提取方法和装置,旨在解决同一人不同人脸姿态下,提取的脸部同一关键点的LBP特征差别较大的问题,进而提高人脸识别准确率。The embodiment of the present invention provides a face feature extraction method and device based on LBP, which aims to solve the problem that the extracted LBP features of the same key point of the face are quite different under different face postures of the same person, thereby improving face recognition. Accuracy.

本发明提供的具体技术方案如下:The concrete technical scheme that the present invention provides is as follows:

一种基于脸部关键点的LBP特征提取方法,包括:A method for extracting LBP features based on facial key points, comprising:

基于待处理脸部图像的关键点,估计所述脸部图像的人脸姿态;Estimating the facial pose of the facial image based on key points of the facial image to be processed;

根据所述脸部图像的人脸姿态,修正所述关键点对应的椭圆邻域半径;Correcting the radius of the ellipse neighborhood corresponding to the key point according to the face pose of the face image;

对所述脸部图像采用所述椭圆邻域半径对所述关键点进行LBP特征提取。Using the ellipse neighborhood radius to perform LBP feature extraction on the key points on the face image.

进一步的,所述基于待处理脸部图像的关键点,估计所述脸部图像的人脸姿态,包括:Further, the estimation of the facial pose of the facial image based on the key points of the facial image to be processed includes:

获取所述脸部图像竖直方向上的第一竖直距离和第二竖直距离,其中,所述第一竖直距离和所述第二竖直距离沿竖直方向自上向下分布;Obtaining a first vertical distance and a second vertical distance in the vertical direction of the facial image, wherein the first vertical distance and the second vertical distance are distributed from top to bottom in the vertical direction;

所述第一竖直距离与所述第二竖直距离之间的比值大于第一阈值,则所述脸部图像的人脸姿态为低头;或所述第一竖直距离与所述第二竖直距离之间的比值小于第一阈值,则所述脸部图像的人脸姿态为仰头。If the ratio between the first vertical distance and the second vertical distance is greater than a first threshold, then the facial posture of the facial image is head down; or the first vertical distance and the second vertical distance If the ratio between the vertical distances is smaller than the first threshold, the facial posture of the facial image is head up.

进一步的,所述基于待处理脸部图像的关键点,估计所述脸部图像的人脸姿态,还包括:Further, the estimation of the facial pose of the facial image based on the key points of the facial image to be processed further includes:

获取所述脸部图像水平方向上的第一水平距离和第二水平距离,其中,所述第一水平距离和所述第二水平距离沿水平方向自左向右分布;Obtaining a first horizontal distance and a second horizontal distance in the horizontal direction of the facial image, wherein the first horizontal distance and the second horizontal distance are distributed from left to right along the horizontal direction;

所述第一水平距离与所述第二水平距离之间的比值大于第二阈值,则所述脸部图像的人脸姿态为右侧头;或所述第一水平距离与所述第二水平距离之间的比值小于第二阈值,则所述脸部图像的人脸姿态为左侧头。If the ratio between the first horizontal distance and the second horizontal distance is greater than a second threshold, then the face posture of the facial image is the right head; or the first horizontal distance and the second horizontal distance If the ratio between the distances is smaller than the second threshold, the face pose of the face image is the left head.

优选的,所述根据所述脸部图像的人脸姿态,修正所述关键点对应的椭圆邻域半径,包括:Preferably, the modifying the radius of the ellipse neighborhood corresponding to the key point according to the facial pose of the facial image includes:

若所述人脸姿态为正脸,所述椭圆邻域的横轴等于第一预设值,所述椭圆邻域的纵轴等于第一预设值;或若所述人脸姿态为仰头或低头,所述椭圆邻域的横轴等于第一预设值,所述椭圆邻域的纵轴等于第一预设值与第一预设权重的乘积;或若所述人脸姿态为左侧头或右侧头,所述椭圆邻域的横轴等于第一预设值与第二预设权重的乘积,所述椭圆邻域的纵轴等于第一预设值。If the face posture is a front face, the horizontal axis of the ellipse neighborhood is equal to the first preset value, and the vertical axis of the ellipse neighborhood is equal to the first preset value; or if the face posture is head-up Or lower your head, the horizontal axis of the ellipse neighborhood is equal to the first preset value, and the vertical axis of the ellipse neighborhood is equal to the product of the first preset value and the first preset weight; or if the facial posture is left For a side head or a right head, the horizontal axis of the ellipse neighborhood is equal to the product of the first preset value and the second preset weight, and the vertical axis of the ellipse neighborhood is equal to the first preset value.

优选的,所述脸部图像包括第一区域、第二区域、第三区域和第四区域,其中,所述第一区域、所述第二区域、所述第三区域和所述第四区域沿顺时针分布,且所述第一区域位于所述第四区域竖直方向上。Preferably, the face image includes a first area, a second area, a third area and a fourth area, wherein the first area, the second area, the third area and the fourth area Distributed clockwise, and the first area is located in the vertical direction of the fourth area.

进一步的,所述根据所述脸部图像的人脸姿态,修正所述关键点对应的椭圆邻域半径,包括:Further, the modifying the radius of the ellipse neighborhood corresponding to the key point according to the face pose of the face image includes:

若所述人脸姿态为正脸,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述椭圆邻域的横轴和所述椭圆邻域的纵轴均等于第一预设值;If the face posture is a frontal face, the horizontal axis of the ellipse neighborhood and the vertical axis of the ellipse neighborhood in the first area, the second area, the third area, and the fourth area The axes are all equal to the first preset value;

若所述人脸姿态为仰头,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述横轴等于所述第一预设值,所述第一区域和所述第二区域的所述纵轴小于第一预设值,所述第三区域和所述第四区域的所述纵轴大于所述第一预设值;If the facial posture is head-up, the horizontal axis of the first area, the second area, the third area and the fourth area is equal to the first preset value, and the first The vertical axes of the first area and the second area are smaller than a first preset value, and the vertical axes of the third area and the fourth area are larger than the first preset value;

若所述人脸姿态为低头,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述横轴等于所述第一预设值,所述第一区域和所述第二区域的所述纵轴大于第一预设值,所述第三区域和所述第四区域的所述纵轴小于所述第一预设值;If the facial posture is head down, the horizontal axes of the first area, the second area, the third area and the fourth area are equal to the first preset value, and the first The vertical axes of the zone and the second zone are greater than a first preset value, and the vertical axes of the third zone and the fourth zone are smaller than the first preset value;

若所述人脸姿态为左侧头,所述第一区域和所述第三区域的所述横轴大于第一预设值,所述第二区域和所述第四区域的所述纵轴小于所述第一预设值,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述纵轴等于所述第一预设值;If the face posture is the left head, the horizontal axis of the first area and the third area is greater than the first preset value, and the vertical axis of the second area and the fourth area less than the first preset value, the vertical axes of the first area, the second area, the third area and the fourth area are equal to the first preset value;

若所述人脸姿态为右侧头,所述第一区域和所述第三区域的所述横轴小于第一预设值,所述第二区域和所述第四区域的所述纵轴大于所述第一预设值,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述纵轴等于所述第一预设值;If the face posture is the right head, the horizontal axis of the first area and the third area is smaller than the first preset value, and the vertical axis of the second area and the fourth area greater than the first preset value, the vertical axes of the first area, the second area, the third area and the fourth area are equal to the first preset value;

若所述人脸姿态为仰头且左侧头,所述第一区域和所述第三区域的所述横轴大于所述第一预设值,所述第二区域和所述第四区域的所述横轴小于所述第一预设值,所述第一区域和所述第二区域的所述纵轴小于第一预设值,所述第三区域和所述第四区域的所述纵轴大于第一预设值;If the face posture is head up and left head, the horizontal axis of the first area and the third area is greater than the first preset value, and the second area and the fourth area The horizontal axis of is smaller than the first preset value, the vertical axes of the first area and the second area are smaller than the first preset value, and all of the third area and the fourth area The vertical axis is greater than the first preset value;

若所述人脸姿态为仰头且右侧头,所述第一区域和所述第三区域的所述横轴小于所述第一预设值,所述第二区域和所述第四区域的所述横轴大于所述第一预设值,所述第一区域和所述第二区域的所述纵轴大于第一预设值,所述第三区域和所述第四区域的所述纵轴小于第一预设值;If the face posture is head up and head on the right side, the horizontal axis of the first area and the third area is smaller than the first preset value, and the second area and the fourth area The horizontal axis of is greater than the first preset value, the vertical axis of the first area and the second area is greater than the first preset value, and all of the third area and the fourth area The vertical axis is smaller than the first preset value;

若所述人脸姿态为低头且左侧头,所述第一区域和所述第三区域的所述横轴大于所述第一预设值,所述第二区域和所述第四区域的所述横轴小于所述第一预设值,所述第一区域和所述第二区域的所述纵轴大于第一预设值,所述第三区域和所述第四区域的所述纵轴小于第一预设值;If the face posture is head down and left head, the horizontal axis of the first area and the third area is greater than the first preset value, and the horizontal axis of the second area and the fourth area The horizontal axis is smaller than the first preset value, the vertical axes of the first area and the second area are larger than the first preset value, the third area and the fourth area are the vertical axis is smaller than the first preset value;

若所述人脸姿态为仰头且左侧头,所述第一区域和所述第三区域的所述横轴小于所述第一预设值,所述第二区域和所述第四区域的所述横轴大于所述第一预设值,所述第一区域和所述第二区域的所述纵轴小于第一预设值,所述第三区域和所述第四区域的所述纵轴大于第一预设值。If the face posture is head up and left head, the horizontal axis of the first area and the third area is smaller than the first preset value, and the second area and the fourth area The horizontal axis of is greater than the first preset value, the vertical axes of the first area and the second area are smaller than the first preset value, and all of the third area and the fourth area The vertical axis is greater than the first preset value.

另一方面,本发明还提供一种基于脸部关键点的LBP特征提取方法,包括:On the other hand, the present invention also provides a method for extracting LBP features based on facial key points, including:

基于待处理脸部图像的关键点,估计所述脸部图像的人脸姿态;Estimating the facial pose of the facial image based on key points of the facial image to be processed;

根据所述脸部图像的人脸姿态确定所述关键点在预置映射表中对应的椭圆邻域半径;determining the radius of the ellipse neighborhood corresponding to the key point in the preset mapping table according to the face pose of the face image;

对所述脸部图像采用所述椭圆邻域半径对所述关键点进行LBP特征提取。Using the ellipse neighborhood radius to perform LBP feature extraction on the key points on the face image.

进一步的,所述基于待处理脸部图像的关键点,估计所述脸部图像的人脸姿态,包括:Further, the estimation of the facial pose of the facial image based on the key points of the facial image to be processed includes:

获取所述脸部图像竖直方向上的第一竖直距离和第二竖直距离,其中,所述第一竖直距离和所述第二竖直距离沿竖直方向自上向下分布;Obtaining a first vertical distance and a second vertical distance in the vertical direction of the facial image, wherein the first vertical distance and the second vertical distance are distributed from top to bottom in the vertical direction;

所述第一竖直距离与所述第二竖直距离之间的比值大于第一阈值,则所述脸部图像的人脸姿态为低头;或所述第一竖直距离与所述第二竖直距离之间的比值小于第一阈值,则所述脸部图像的人脸姿态为仰头。If the ratio between the first vertical distance and the second vertical distance is greater than a first threshold, then the facial posture of the facial image is head down; or the first vertical distance and the second vertical distance If the ratio between the vertical distances is smaller than the first threshold, the facial posture of the facial image is head up.

进一步的,所述基于待处理脸部图像的关键点,估计所述脸部图像的人脸姿态,还包括:Further, the estimation of the facial pose of the facial image based on the key points of the facial image to be processed further includes:

获取所述脸部图像水平方向上的第一水平距离和第二水平距离,其中,所述第一水平距离和所述第二水平距离沿水平方向自左向右分布;Obtaining a first horizontal distance and a second horizontal distance in the horizontal direction of the facial image, wherein the first horizontal distance and the second horizontal distance are distributed from left to right along the horizontal direction;

所述第一水平距离与所述第二水平距离之间的比值大于第二阈值,则所述脸部图像的人脸姿态为右侧头;或所述第一水平距离与所述第二水平距离之间的比值小于第二阈值,则所述脸部图像的人脸姿态为左侧头。If the ratio between the first horizontal distance and the second horizontal distance is greater than a second threshold, then the face posture of the facial image is the right head; or the first horizontal distance and the second horizontal distance If the ratio between the distances is smaller than the second threshold, the face pose of the face image is the left head.

优选的,所述脸部图像包括第一区域、第二区域、第三区域和第四区域,其中,所述第一区域、所述第二区域、所述第三区域和所述第四区域沿顺时针分布,且所述第一区域位于所述第四区域竖直方向上。Preferably, the face image includes a first area, a second area, a third area and a fourth area, wherein the first area, the second area, the third area and the fourth area Distributed clockwise, and the first area is located in the vertical direction of the fourth area.

优选的,所述预置映射表用于表征不同人脸姿态下、不同脸部区域内的所述关键点对应的椭圆邻域半径,其中:Preferably, the preset mapping table is used to characterize the ellipse neighborhood radius corresponding to the key point in different face regions under different face poses, wherein:

若所述人脸姿态为正脸,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述椭圆邻域的横轴和所述椭圆邻域的纵轴均等于第一预设值;If the face posture is a frontal face, the horizontal axis of the ellipse neighborhood and the vertical axis of the ellipse neighborhood in the first area, the second area, the third area, and the fourth area The axes are all equal to the first preset value;

若所述人脸姿态为仰头,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述横轴等于所述第一预设值,所述第一区域和所述第二区域的所述纵轴小于第一预设值,所述第三区域和所述第四区域的所述纵轴大于所述第一预设值;If the facial posture is head-up, the horizontal axis of the first area, the second area, the third area and the fourth area is equal to the first preset value, and the first The vertical axes of the first area and the second area are smaller than a first preset value, and the vertical axes of the third area and the fourth area are larger than the first preset value;

若所述人脸姿态为低头,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述横轴等于所述第一预设值,所述第一区域和所述第二区域的所述纵轴大于第一预设值,所述第三区域和所述第四区域的所述纵轴小于所述第一预设值;If the facial posture is head down, the horizontal axes of the first area, the second area, the third area and the fourth area are equal to the first preset value, and the first The vertical axes of the zone and the second zone are greater than a first preset value, and the vertical axes of the third zone and the fourth zone are smaller than the first preset value;

若所述人脸姿态为左侧头,所述第一区域和所述第三区域的所述横轴大于第一预设值,所述第二区域和所述第四区域的所述纵轴小于所述第一预设值,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述纵轴等于所述第一预设值;If the face posture is the left head, the horizontal axis of the first area and the third area is greater than the first preset value, and the vertical axis of the second area and the fourth area less than the first preset value, the vertical axes of the first area, the second area, the third area and the fourth area are equal to the first preset value;

若所述人脸姿态为右侧头,所述第一区域和所述第三区域的所述横轴小于第一预设值,所述第二区域和所述第四区域的所述纵轴大于所述第一预设值,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述纵轴等于所述第一预设值;If the face posture is the right head, the horizontal axis of the first area and the third area is smaller than the first preset value, and the vertical axis of the second area and the fourth area greater than the first preset value, the vertical axes of the first area, the second area, the third area and the fourth area are equal to the first preset value;

若所述人脸姿态为仰头且左侧头,所述第一区域和所述第三区域的所述横轴大于所述第一预设值,所述第二区域和所述第四区域的所述横轴小于所述第一预设值,所述第一区域和所述第二区域的所述纵轴小于第一预设值,所述第三区域和所述第四区域的所述纵轴大于第一预设值;If the face posture is head up and left head, the horizontal axis of the first area and the third area is greater than the first preset value, and the second area and the fourth area The horizontal axis of is smaller than the first preset value, the vertical axes of the first area and the second area are smaller than the first preset value, and all of the third area and the fourth area The vertical axis is greater than the first preset value;

若所述人脸姿态为仰头且右侧头,所述第一区域和所述第三区域的所述横轴小于所述第一预设值,所述第二区域和所述第四区域的所述横轴大于所述第一预设值,所述第一区域和所述第二区域的所述纵轴大于第一预设值,所述第三区域和所述第四区域的所述纵轴小于第一预设值;If the face posture is head up and head on the right side, the horizontal axis of the first area and the third area is smaller than the first preset value, and the second area and the fourth area The horizontal axis of is greater than the first preset value, the vertical axis of the first area and the second area is greater than the first preset value, and all of the third area and the fourth area The vertical axis is smaller than the first preset value;

若所述人脸姿态为低头且左侧头,所述第一区域和所述第三区域的所述横轴大于所述第一预设值,所述第二区域和所述第四区域的所述横轴小于所述第一预设值,所述第一区域和所述第二区域的所述纵轴大于第一预设值,所述第三区域和所述第四区域的所述纵轴小于第一预设值;If the face posture is head down and left head, the horizontal axis of the first area and the third area is greater than the first preset value, and the horizontal axis of the second area and the fourth area The horizontal axis is smaller than the first preset value, the vertical axes of the first area and the second area are larger than the first preset value, the third area and the fourth area are the vertical axis is smaller than the first preset value;

若所述人脸姿态为仰头且左侧头,所述第一区域和所述第三区域的所述横轴小于所述第一预设值,所述第二区域和所述第四区域的所述横轴大于所述第一预设值,所述第一区域和所述第二区域的所述纵轴小于第一预设值,所述第三区域和所述第四区域的所述纵轴大于第一预设值。If the face posture is head up and left head, the horizontal axis of the first area and the third area is smaller than the first preset value, and the second area and the fourth area The horizontal axis of is greater than the first preset value, the vertical axes of the first area and the second area are smaller than the first preset value, and all of the third area and the fourth area The vertical axis is greater than the first preset value.

在一方面,本发明还提供一种基于脸部关键点的LBP特征提取装置,包括:In one aspect, the present invention also provides a kind of LBP feature extraction device based on facial key points, comprising:

关键点检测模块,用于检测待处理脸部图像的关键点;A key point detection module for detecting key points of the face image to be processed;

图像处理模块,用于获取所述关键点之间的距离,根据所述距离确定所述脸部图像的人脸姿态,以及根据所述人脸姿态修正所述关键点对应椭圆邻域的半径;An image processing module, configured to obtain the distance between the key points, determine the face pose of the face image according to the distance, and modify the radius of the ellipse neighborhood corresponding to the key point according to the face pose;

特征提取模块,用于对所述脸部图像采用所述椭圆邻域的半径对所述关键点进行LBP特征提取。A feature extraction module, configured to perform LBP feature extraction on the key points using the radius of the ellipse neighborhood on the face image.

进一步的,所述图像处理模块具体用于:Further, the image processing module is specifically used for:

获取所述脸部图像竖直方向上的第一竖直距离和第二竖直距离,其中,所述第一竖直距离和所述第二竖直距离沿竖直方向自上向下分布,所述第一竖直距离与所述第二竖直距离之间的比值大于第一阈值,则所述脸部图像的人脸姿态为低头,或所述第一竖直距离与所述第二竖直距离之间的比值小于第一阈值,则所述脸部图像的人脸姿态为仰头;Acquiring a first vertical distance and a second vertical distance in the vertical direction of the facial image, wherein the first vertical distance and the second vertical distance are distributed from top to bottom in the vertical direction, If the ratio between the first vertical distance and the second vertical distance is greater than a first threshold, then the facial posture of the facial image is head down, or the first vertical distance and the second vertical distance The ratio between the vertical distances is less than the first threshold, then the face posture of the facial image is head-up;

获取所述脸部图像水平方向上的第一水平距离和第二水平距离,其中,所述第一水平距离和所述第二水平距离沿水平方向自左向右分布,所述第一水平距离与所述第二水平距离之间的比值大于第二阈值,则所述脸部图像的人脸姿态为右侧头,或所述第一水平距离与所述第二水平距离之间的比值小于第二阈值,则所述脸部图像的人脸姿态为左侧头。Acquiring a first horizontal distance and a second horizontal distance in the horizontal direction of the facial image, wherein the first horizontal distance and the second horizontal distance are distributed from left to right in the horizontal direction, and the first horizontal distance If the ratio between the first horizontal distance and the second horizontal distance is greater than the second threshold, then the facial posture of the face image is the right head, or the ratio between the first horizontal distance and the second horizontal distance is less than The second threshold, then the face pose of the face image is the left head.

进一步的,所述图像处理模块具体用于:Further, the image processing module is specifically used for:

若所述人脸姿态为正脸,确定所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述椭圆邻域的横轴和所述椭圆邻域的纵轴均等于第一预设值;或If the face pose is a frontal face, determine the horizontal axis of the ellipse neighborhood and the ellipse neighborhood of the first area, the second area, the third area, and the fourth area both vertical axes are equal to the first preset value; or

若所述人脸姿态为仰头,确定所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述横轴等于所述第一预设值,所述第一区域和所述第二区域的所述纵轴小于第一预设值,所述第三区域和所述第四区域的所述纵轴大于所述第一预设值;或If the facial posture is head-up, it is determined that the horizontal axis of the first area, the second area, the third area, and the fourth area is equal to the first preset value, and the The vertical axes of the first area and the second area are smaller than a first preset value, and the vertical axes of the third area and the fourth area are larger than the first preset value; or

若所述人脸姿态为低头,确定所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述横轴等于所述第一预设值,所述第一区域和所述第二区域的所述纵轴大于第一预设值,所述第三区域和所述第四区域的所述纵轴小于所述第一预设值;或If the facial posture is head down, determine that the horizontal axis of the first area, the second area, the third area, and the fourth area is equal to the first preset value, and the second area The vertical axes of the first area and the second area are greater than a first preset value, and the vertical axes of the third area and the fourth area are smaller than the first preset value; or

若所述人脸姿态为左侧头,确定所述第一区域和所述第三区域的所述横轴大于第一预设值,所述第二区域和所述第四区域的所述纵轴小于所述第一预设值,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述纵轴等于所述第一预设值;或If the face posture is the left head, it is determined that the horizontal axis of the first area and the third area is greater than the first preset value, and the vertical axis of the second area and the fourth area axis is smaller than said first preset value, said longitudinal axis of said first zone, said second zone, said third zone and said fourth zone is equal to said first preset value; or

若所述人脸姿态为右侧头,确定所述第一区域和所述第三区域的所述横轴小于第一预设值,所述第二区域和所述第四区域的所述纵轴大于所述第一预设值,所述第一区域、所述第二区域、所述第三区域和所述第四区域的所述纵轴等于所述第一预设值;或If the face posture is the head on the right side, it is determined that the horizontal axis of the first area and the third area is smaller than the first preset value, and the vertical axis of the second area and the fourth area the axes are greater than the first preset value, and the longitudinal axes of the first zone, the second zone, the third zone, and the fourth zone are equal to the first preset value; or

若所述人脸姿态为仰头且左侧头,确定所述第一区域和所述第三区域的所述横轴大于所述第一预设值,所述第二区域和所述第四区域的所述横轴小于所述第一预设值,所述第一区域和所述第二区域的所述纵轴小于第一预设值,所述第三区域和所述第四区域的所述纵轴大于第一预设值;或If the face posture is head up and left head, it is determined that the horizontal axis of the first area and the third area is greater than the first preset value, and the second area and the fourth area The horizontal axis of the region is smaller than the first preset value, the vertical axes of the first region and the second region are smaller than the first preset value, and the third region and the fourth region the vertical axis is greater than a first predetermined value; or

若所述人脸姿态为仰头且右侧头,确定所述第一区域和所述第三区域的所述横轴小于所述第一预设值,所述第二区域和所述第四区域的所述横轴大于所述第一预设值,所述第一区域和所述第二区域的所述纵轴大于第一预设值,所述第三区域和所述第四区域的所述纵轴小于第一预设值;或If the face posture is head up and head on the right side, it is determined that the horizontal axis of the first area and the third area is smaller than the first preset value, and the second area and the fourth area The horizontal axis of the area is greater than the first preset value, the vertical axis of the first area and the second area is greater than the first preset value, and the third area and the fourth area the vertical axis is less than a first predetermined value; or

若所述人脸姿态为低头且左侧头,确定所述第一区域和所述第三区域的所述横轴大于所述第一预设值,所述第二区域和所述第四区域的所述横轴小于所述第一预设值,所述第一区域和所述第二区域的所述纵轴大于第一预设值,所述第三区域和所述第四区域的所述纵轴小于第一预设值;或If the face posture is head down and left head, it is determined that the horizontal axis of the first area and the third area is greater than the first preset value, and the second area and the fourth area The horizontal axis of is smaller than the first preset value, the vertical axes of the first area and the second area are greater than the first preset value, and all of the third area and the fourth area said vertical axis is less than a first predetermined value; or

若所述人脸姿态为仰头且左侧头,确定所述第一区域和所述第三区域的所述横轴小于所述第一预设值,所述第二区域和所述第四区域的所述横轴大于所述第一预设值,所述第一区域和所述第二区域的所述纵轴小于第一预设值,所述第三区域和所述第四区域的所述纵轴大于第一预设值。If the face posture is head up and left head, it is determined that the horizontal axis of the first area and the third area is smaller than the first preset value, and the second area and the fourth area The horizontal axis of the region is greater than the first preset value, the vertical axes of the first region and the second region are smaller than the first preset value, and the third region and the fourth region The vertical axis is greater than a first preset value.

本发明的有益效果如下:The beneficial effects of the present invention are as follows:

本发明实施例提供的基于脸部关键点的LBP特征提取方法,首先根据脸部图像的关键点确定该脸部图像的人脸姿态,进而根据该脸部图像的人脸姿态修正不同脸部关键点所对应的椭圆邻域半径,建立了椭圆邻域半径与该脸部图像的人脸姿态之间的对应关系,从而避免了同一个人不同人脸姿态下,脸部图像局部缩放比例不同,导致同一关键点提取的LBP特征差别较大的问题,提高了不同人脸姿态下基于脸部关键点的LBP特征提取的有效性,进而提高了人脸识别准确率。The face key point-based LBP feature extraction method provided by the embodiment of the present invention first determines the face pose of the face image according to the key points of the face image, and then corrects different face key points according to the face pose of the face image. The radius of the ellipse neighborhood corresponding to the point establishes the correspondence between the radius of the ellipse neighborhood and the face pose of the face image, thereby avoiding the different face image local scaling ratios of the same person under different face poses, resulting in The problem of large differences in LBP features extracted from the same key point improves the effectiveness of LBP feature extraction based on facial key points under different face poses, thereby improving the accuracy of face recognition.

附图说明Description of drawings

图1为现有技术中正脸姿态下脸部关键点A的LBP特征提取邻域示意图;Fig. 1 is a schematic diagram of the LBP feature extraction neighborhood of the facial key point A under the front face posture in the prior art;

图2为现有技术中侧脸姿态下脸部关键点A的LBP特征提取邻域示意图;Fig. 2 is a schematic diagram of the LBP feature extraction neighborhood of the face key point A under the profile pose in the prior art;

图3为本发明实施例的一种基于脸部关键点的LBP特征提取流程示意图;Fig. 3 is a kind of schematic flow chart of LBP feature extraction based on facial key points according to the embodiment of the present invention;

图4为本发明实施例的一种脸部关键点分布示意图;Fig. 4 is a schematic diagram of distribution of facial key points according to an embodiment of the present invention;

图5为本发明实施例的一种图像校正之前的待处理脸部图像示意图;Fig. 5 is a schematic diagram of a face image to be processed before image correction according to an embodiment of the present invention;

图6为本发明实施例的一种图像校正之后的待处理脸部图像示意图Fig. 6 is a schematic diagram of a face image to be processed after image correction according to an embodiment of the present invention

图7为本发明实施例的一种脸部五官位置分布示意图;Fig. 7 is a schematic diagram of the distribution of facial features according to an embodiment of the present invention;

图8为本发明实施例的一种人脸姿态估计用脸部关键点分布示意图;Fig. 8 is a schematic diagram of distribution of facial key points for face pose estimation according to an embodiment of the present invention;

图9为本发明实施例的一种椭圆邻域修正示意图;FIG. 9 is a schematic diagram of an ellipse neighborhood correction according to an embodiment of the present invention;

图10为本发明实施例的一种脸部区域划分示意图;Fig. 10 is a schematic diagram of a face area division according to an embodiment of the present invention;

图11为本发明实施例的另一种基于脸部关键点的LBP特征提取流程示意图;11 is a schematic diagram of another LBP feature extraction process based on facial key points according to an embodiment of the present invention;

图12为本发明实施例的一种基于脸部关键点的LBP特征提取装置示意图。Fig. 12 is a schematic diagram of an LBP feature extraction device based on facial key points according to an embodiment of the present invention.

具体实施方式Detailed ways

为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

在本发明的描述中,需要理解的是,术语“中心”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。In describing the present invention, it is to be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", The orientations or positional relationships indicated by "top", "bottom", "inner", "outer", etc. are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying References to devices or elements must have a particular orientation, be constructed, and operate in a particular orientation and therefore should not be construed as limiting the invention.

术语“第一”、“第二”、“第三”、“第四”“第五”、“第六”、“第七”、“第八”和“第九”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、“第三”、“第四”“第五”、“第六”、“第七”、“第八”和“第九”的特征可以明示或者隐含地包括一个或者更多个该特征。在本发明的描述中,除非另有说明,“多个”的含义是两个或两个以上。The terms "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth" and "ninth" are used for descriptive purposes only, It should not be understood as indicating or implying relative importance or implying the number of technical features indicated. Thus, the characteristics of "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth" and "ninth" are defined One or more of these features may be included explicitly or implicitly. In the description of the present invention, unless otherwise specified, "plurality" means two or more.

本发明实施例可以应用于各种智能终端,如智能电视、手机、智能摄像头、监控设备等等;本发明实施例尤其适用于具有人脸识别技术的各类终端,例如采用人脸识别技术的安防设备、监控设备、门禁设备、智能电视和智能手机等等。Embodiments of the present invention can be applied to various smart terminals, such as smart TVs, mobile phones, smart cameras, monitoring equipment, etc.; Security equipment, surveillance equipment, access control equipment, smart TVs and smartphones, etc.

实施例一Embodiment one

图3示出了本发明实施例提供的一种基于脸部关键点的LBP特征提取流程示意图,如图3所示,该基于脸部关键点的LBP特征提取过程包括:Fig. 3 shows a schematic flow chart of the LBP feature extraction process based on facial key points provided by an embodiment of the present invention. As shown in Fig. 3, the LBP feature extraction process based on facial key points includes:

步骤100:基于待处理脸部图像的关键点,估计所述脸部图像的人脸姿态。Step 100: Estimating the face pose of the face image based on the key points of the face image to be processed.

具体的,在执行步骤100的过程中,首先将待处理的脸部图像进行预处理,得到待处理图像的灰度图像,对该待处理图像的灰度图像进行脸部关键点检测,获得该灰度图像中待提取LBP特征的脸部关键点位置。需要说明的是,在步骤100中确定的脸部关键点包括人脸脸廓关键点、眉毛关键点、眼睛关键点、鼻子关键点和嘴巴关键点,分别代表待处理脸部图像中人脸轮廓的位置、眉毛的位置、眼睛的位置、鼻子的位置和嘴巴的位置。Specifically, in the process of executing step 100, firstly, the face image to be processed is preprocessed to obtain a grayscale image of the image to be processed, and the facial key point detection is performed on the grayscale image of the image to be processed to obtain the The position of the facial key points to be extracted LBP features in the grayscale image. It should be noted that the face key points determined in step 100 include face contour key points, eyebrow key points, eye key points, nose key points and mouth key points, which respectively represent the face contour in the face image to be processed. The position of the eyebrows, the position of the eyes, the position of the nose and the position of the mouth.

示例的,图4示出了本发明实施例的一种脸部关键点分布示意图,如图4所示,确定的脸部关键点共有83个,其中,代表人脸轮廓位置和人脸轮廓大小的人脸轮廓关键点有19个,代表眉毛位置和眉毛大小的眉毛关键点有16个,代表眼睛位置和眼睛大小的眼睛关键点有18个,代表鼻子位置和鼻子大小的鼻子关键点有12个,代表嘴巴位置和嘴巴大小的嘴巴关键点有18个。当然,此处仅是举例说明,并不代表本发明实施例的步骤100确定的脸部关键点分布位置和数量局限于此。As an example, Fig. 4 shows a schematic diagram of the distribution of facial key points according to an embodiment of the present invention. As shown in Fig. 4, there are 83 determined facial key points, wherein, the position and the size of the human face contour are represented There are 19 key points of the face contour, 16 key points of eyebrows representing the position and size of eyebrows, 18 key points of eyes representing the position and size of eyes, and 12 key points of nose representing the position and size of nose There are 18 mouth key points representing mouth position and mouth size. Of course, this is only an example, and does not mean that the distribution positions and numbers of facial key points determined in step 100 of the embodiment of the present invention are limited thereto.

进一步的,需要说明的是,步骤100中确定了待处理的脸部图像的脸部关键点位置之后,需要将待处理脸部图像整体进行图像校正,以确保每一张待处理脸部图像中,两眼球之间的连线与水平线之间的夹角相同。示例的,可以通过旋转整个待处理脸部图像,保证所有待处理的脸部图像中,代表人脸两眼球位置的关键点的纵坐标相同,即保证人眼眼球处于同一水平线上。Further, it should be noted that after the facial key point positions of the facial images to be processed are determined in step 100, it is necessary to perform image correction on the entire facial images to be processed, so as to ensure that each facial image to be processed , the angle between the line connecting the two eyeballs and the horizontal line is the same. For example, by rotating the entire face image to be processed, it is possible to ensure that in all the face images to be processed, the ordinates of the key points representing the positions of the two eyeballs of the human face are the same, that is, to ensure that the eyeballs of the human eyes are on the same horizontal line.

示例的,参考图5所示,待处理的脸部图像未进行图像校正之前,代表人脸两眼球位置的关键点之间的连线与水平线之间具有一定的夹角;参考图6所述,待处理的脸部图像进行图像校正之后,代表人脸两眼球位置的关键点之间的连线处于同一水平线上,即代表人脸两眼球位置的关键点的纵坐标相同;参考图5和图6所示,对待处理的脸部图像进行图像校正,只是在平面坐标系中,对待处理的脸部图像整体进行旋转,并不改变待处理脸部图像中的人脸姿态和人脸大小。For example, as shown in FIG. 5, before the face image to be processed is not subjected to image correction, there is a certain angle between the line between the key points representing the positions of the two eyeballs of the human face and the horizontal line; referring to FIG. 6 , after image correction is performed on the face image to be processed, the line between the key points representing the positions of the two eyeballs of the human face is on the same horizontal line, that is, the ordinates of the key points representing the positions of the two eyeballs of the human face are the same; refer to Figure 5 and As shown in FIG. 6 , image correction is performed on the face image to be processed, only in the plane coordinate system, the face image to be processed is rotated as a whole, and the posture and size of the face in the face image to be processed are not changed.

进一步的,参考大量的经验,人脸姿态通常包括正脸、左侧脸、右侧脸、低头和仰头等五种不同的姿态,其中,左侧脸和右侧脸相对于正脸,待处理脸部图像的脸部特征在水平方向上变化较大,在竖直方向上不发生变化;低头和仰头相对于正脸,待处理脸部图像的脸部特征在水平方向上不发生变化,在竖直方向上变化较大;基于上述分析,步骤100的执行过程包括:Further, with reference to a large amount of experience, face poses usually include five different poses: front face, left face, right face, head down, and head up. Among them, the left face and right face are different from the front face. The facial features of the facial image change greatly in the horizontal direction, but do not change in the vertical direction; compared with the front face, the facial features of the facial image to be processed do not change in the horizontal direction. Larger changes in the vertical direction; based on the above analysis, the execution process of step 100 includes:

获取所述脸部图像竖直方向上的第一竖直距离和第二竖直距离,其中,所述第一竖直距离和所述第二竖直距离沿竖直方向自上向下分布;Obtaining a first vertical distance and a second vertical distance in the vertical direction of the facial image, wherein the first vertical distance and the second vertical distance are distributed from top to bottom in the vertical direction;

所述第一竖直距离与所述第二竖直距离之间的比值大于第一阈值,则所述脸部图像的人脸姿态为低头;或所述第一竖直距离与所述第二竖直距离之间的比值小于第一阈值,则所述脸部图像的人脸姿态为仰头。If the ratio between the first vertical distance and the second vertical distance is greater than a first threshold, then the facial posture of the facial image is head down; or the first vertical distance and the second vertical distance If the ratio between the vertical distances is smaller than the first threshold, the facial posture of the facial image is head up.

获取所述脸部图像水平方向上的第一水平距离和第二水平距离,其中,所述第一水平距离和所述第二水平距离沿水平方向自左向右分布;Obtaining a first horizontal distance and a second horizontal distance in the horizontal direction of the facial image, wherein the first horizontal distance and the second horizontal distance are distributed from left to right along the horizontal direction;

所述第一水平距离与所述第二水平距离之间的比值大于第二阈值,则所述脸部图像的人脸姿态为右侧头;或所述第一水平距离与所述第二水平距离之间的比值小于第二阈值,则所述脸部图像的人脸姿态为左侧头。If the ratio between the first horizontal distance and the second horizontal distance is greater than a second threshold, then the face posture of the facial image is the right head; or the first horizontal distance and the second horizontal distance If the ratio between the distances is smaller than the second threshold, the face pose of the face image is the left head.

具体的,获取第一关键点到第二关键点之间的第一竖直距离以及所述第二关键点到第三关键点之间的第二竖直距离,其中,所述第一关键点、所述第二关键点以及所述第三关键点沿竖直方向自上向下分布;Specifically, the first vertical distance between the first key point and the second key point and the second vertical distance between the second key point and the third key point are acquired, wherein the first key point , the second key point and the third key point are distributed vertically from top to bottom;

所述第一竖直距离与所述第二竖直距离之间的比值大于第一阈值,则所述脸部图像的人脸姿态为低头;或所述第一竖直距离与所述第二竖直距离之间的比值小于第一阈值,则所述脸部图像的人脸姿态为仰头。If the ratio between the first vertical distance and the second vertical distance is greater than a first threshold, then the facial posture of the facial image is head down; or the first vertical distance and the second vertical distance If the ratio between the vertical distances is smaller than the first threshold, the facial posture of the facial image is head up.

获取第三关键点到第四关键点之间的第一水平距离以及第五关键点到第六关键点之间的第二水平距离,其中,所述第三关键点、所述第四关键点、所述第五关键点以及所述第六关键点沿水平方向从左到右分布;Obtain the first horizontal distance between the third key point and the fourth key point and the second horizontal distance between the fifth key point and the sixth key point, wherein the third key point, the fourth key point , the fifth key point and the sixth key point are distributed from left to right along the horizontal direction;

所述第一水平距离与所述第二水平距离之间的比值大于第二阈值,则所述脸部图像的人脸姿态为右侧头;或所述第一水平距离与所述第二水平距离之间的比值小于第二阈值,则所述脸部图像的人脸姿态为左侧头。If the ratio between the first horizontal distance and the second horizontal distance is greater than a second threshold, then the face posture of the facial image is the right head; or the first horizontal distance and the second horizontal distance If the ratio between the distances is smaller than the second threshold, the face pose of the face image is the left head.

需要说明的是,步骤100的执行过程中,判断人脸姿态是否为仰头或低头与判断人脸姿态是否为左侧头和右侧头之间,不存在先后顺序,两者可以互换顺序,也可以同时执行。即步骤100的执行过程还可以如下:It should be noted that during the execution of step 100, there is no sequence between judging whether the face posture is head up or down and judging whether the face posture is left head or right head, and the order of the two can be interchanged. , can also be executed simultaneously. That is, the execution process of step 100 can also be as follows:

获取所述脸部图像水平方向上的第一水平距离和第二水平距离,其中,所述第一水平距离和所述第二水平距离沿水平方向自左向右分布;Obtaining a first horizontal distance and a second horizontal distance in the horizontal direction of the facial image, wherein the first horizontal distance and the second horizontal distance are distributed from left to right along the horizontal direction;

所述第一水平距离与所述第二水平距离之间的比值大于第二阈值,则所述脸部图像的人脸姿态为右侧头;或所述第一水平距离与所述第二水平距离之间的比值小于第二阈值,则所述脸部图像的人脸姿态为左侧头。If the ratio between the first horizontal distance and the second horizontal distance is greater than a second threshold, then the face posture of the facial image is the right head; or the first horizontal distance and the second horizontal distance If the ratio between the distances is smaller than the second threshold, the face pose of the face image is the left head.

获取所述脸部图像竖直方向上的第一竖直距离和第二竖直距离,其中,所述第一竖直距离和所述第二竖直距离沿竖直方向自上向下分布;Obtaining a first vertical distance and a second vertical distance in the vertical direction of the facial image, wherein the first vertical distance and the second vertical distance are distributed from top to bottom in the vertical direction;

所述第一竖直距离与所述第二竖直距离之间的比值大于第一阈值,则所述脸部图像的人脸姿态为低头;或所述第一竖直距离与所述第二竖直距离之间的比值小于第一阈值,则所述脸部图像的人脸姿态为仰头。If the ratio between the first vertical distance and the second vertical distance is greater than a first threshold, then the facial posture of the facial image is head down; or the first vertical distance and the second vertical distance If the ratio between the vertical distances is smaller than the first threshold, the facial posture of the facial image is head up.

进一步的,需要说明的,第二竖直距离可以为第二关键点到第三关键点之间的竖直距离,也可以为第三关键点到第九关键点之间的竖直距离,其中,第一关键点、第二关键点、第三关键点和第九关键点沿竖直方向自上向下分布。Further, it should be noted that the second vertical distance may be the vertical distance between the second key point and the third key point, or the vertical distance between the third key point and the ninth key point, wherein , the first key point, the second key point, the third key point and the ninth key point are distributed vertically from top to bottom.

进一步的,需要说明的,第四关键点和第五关键点可以为人脸图像中的同一个关键点,也可以是人脸图像上沿水平方向分布的不同关键点。Further, it should be noted that the fourth key point and the fifth key point may be the same key point in the face image, or may be different key points distributed along the horizontal direction on the face image.

进一步的,需要说明的,第一阈值和第二阈值分别代表正脸状态下脸部图像中第一竖直距离与第二竖直距离的比值和第一水平距离与第二水平距离的比值,第一阈值和第二阈值可以分别为一个具体数值,也可以分别为一个数值范围。Further, it should be noted that the first threshold and the second threshold respectively represent the ratio of the first vertical distance to the second vertical distance and the ratio of the first horizontal distance to the second horizontal distance in the facial image in the front face state, The first threshold and the second threshold may be a specific numerical value or a numerical range respectively.

下面将结合具体的实施例,详细的说明本发明实施例的步骤100执行过程,当然,此处仅是举例说明,并不代表本发明实施例的人脸姿态估计局限于此。The execution process of step 100 of the embodiment of the present invention will be described in detail below in conjunction with a specific embodiment. Of course, this is only an example and does not mean that the face pose estimation of the embodiment of the present invention is limited thereto.

图7示例性的示出了正脸姿态下人脸五官位置分布示意图,参考图7所示,眼球到额底线之间的竖直距离与眼球到人脸头部最高点之间的竖直距离分别占到了人脸竖直距离的一半,即人脸两个眼球之间的连线是人脸在竖直方向的中心线,其中,鼻底线到额底线之间的竖直距离与鼻底线到眉线之间的竖直距离分别占到了人脸竖直距离的三分之一,即正脸姿态下,眉线到鼻底线之间的竖直距离与鼻底线到额底线之间的竖直距离的比值为1:1。进一步的分析发现,当人脸姿态由正脸变为仰头时,眉线到鼻底线之间的人脸部分比鼻底线到额底线之间的人脸部分距离拍摄镜头的距离远,相应的眉线到鼻底线之间的竖直距离相对正脸状态下变大,鼻底线到额底线之间的竖直距离相对正脸状态下变小,即仰头状态下,眉线到鼻底线之间的竖直距离与鼻底线到额底线之间的竖直距离的比值大于1:1;当人脸姿态由正脸变为低头时,眉线到鼻底线之间的人脸部分比鼻底线到额底线之间的人脸部分距离拍摄镜头的距离近,相应的眉线到鼻底线之间的竖直距离相对正脸状态下变小,鼻底线到额底线之间的竖直距离相对正脸状态下变大,即低头状态下,眉线到鼻底线之间的竖直距离与鼻底线到额底线之间的竖直距离的比值小于1:1。Figure 7 exemplarily shows a schematic diagram of the distribution of facial features in a frontal posture. Referring to Figure 7, the vertical distance between the eyeball and the frontal base line and the vertical distance between the eyeball and the highest point of the head of the face They respectively account for half of the vertical distance of the face, that is, the line connecting the two eyeballs of the face is the center line of the face in the vertical direction, and the vertical distance between the nose base line and the frontal base line is the same as The vertical distance between the eyebrow lines accounts for one-third of the vertical distance of the face, that is, the vertical distance between the eyebrow line and the bottom line of the nose and the vertical distance between the bottom line of the nose and the bottom line of the forehead in a frontal posture. The distance ratio is 1:1. Further analysis found that when the face posture changes from frontal to upward, the part of the face between the brow line and the bottom line of the nose is farther away from the camera lens than the part of the face between the bottom line of the nose and the bottom line of the forehead. The vertical distance between the eyebrow line and the bottom line of the nose is larger than that of the frontal face, and the vertical distance between the bottom line of the nose and the bottom line of the forehead is smaller than that of the frontal face. The ratio of the vertical distance between the brow line and the vertical distance between the nose base line and the forehead line is greater than 1:1; The face part between the forehead line and the base line is closer to the camera, the corresponding vertical distance between the brow line and the nose base line is smaller than that of the frontal face, and the vertical distance between the nose base line and the forehead line is relatively positive. When the face becomes larger, that is, when the head is lowered, the ratio of the vertical distance from the eyebrow line to the nose line to the vertical distance from the nose line to the forehead line is less than 1:1.

基于上述分析,本发明可以通过判断眉线到鼻底线之间的竖直距离与鼻底线到额底线之间的竖直距离的比值与第一阈值Y之间的大小,判断待处理脸部图像的人脸姿态是否为低头或仰头。考虑到测量误差与不同人脸五官分布的差异性,优选的,第一阈值Y的取值是一个数值范围而不是一个具体数值,示例的,第一阈值Y为[0.8,1.2]。Based on the above analysis, the present invention can determine the face image to be processed by judging the ratio of the vertical distance between the eyebrow line to the nose base line and the vertical distance between the nose base line to the frontal base line and the first threshold Y Whether the face posture of the user is head down or head up. Considering the differences in measurement errors and the distribution of facial features of different faces, preferably, the value of the first threshold Y is a numerical range rather than a specific numerical value. For example, the first threshold Y is [0.8, 1.2].

参考图8所示,第一关键点A1代表眉线在脸部图像中的竖直位置,第二关键点A2代表鼻底线在脸部图像中的竖直位置,第三关键点A3代表额底线在脸部图像中的竖直位置,第一关键点A1到第二关键点A2之间的竖直距离Y1代表眉线到鼻底线之间的竖直距离,第二关键点A2到第三关键点A3之间的竖直距离代表鼻底线到额底线之间的竖直距离Y2。Referring to Figure 8, the first key point A1 represents the vertical position of the eyebrow line in the facial image, the second key point A2 represents the vertical position of the nasal bottom line in the facial image, and the third key point A3 represents the forehead line In the vertical position in the facial image, the vertical distance Y1 between the first key point A1 and the second key point A2 represents the vertical distance between the eyebrow line and the bottom line of the nose, and the second key point A2 to the third key point The vertical distance between points A3 represents the vertical distance Y2 between the nasal base line and the frontal base line.

若Y1与Y2的比值等于第一阈值Y,即Y1与Y2的比值在[0.8,1.2]内,则该脸部图像的人脸姿态为正脸;若Y1与Y2的比值大于第一阈值Y,即Y1与Y2的比值大于1.2,则该脸部图像的人脸姿态为仰头;若Y1与Y2的比值小于第一阈值Y,即Y1与Y2的比值小于0.8,则该脸部图像的人脸姿态为低头。If the ratio of Y1 to Y2 is equal to the first threshold Y, that is, the ratio of Y1 to Y2 is within [0.8, 1.2], then the facial posture of the facial image is a positive face; if the ratio of Y1 to Y2 is greater than the first threshold Y , that is, the ratio of Y1 to Y2 is greater than 1.2, then the facial posture of the face image is head-up; if the ratio of Y1 to Y2 is less than the first threshold Y, that is, the ratio of Y1 to Y2 is less than 0.8, then the face image of the face The facial posture is head down.

参考图7所示,正脸姿态下人脸五官中,左眼的左眼角到左耳根之间的水平距离、左眼的左眼角到左眼的右眼角之间的水平距离、左眼的右眼角到右眼的左眼角之间的水平距离、右眼的左眼角到右眼的右眼角之间的水平距离与右眼的右眼角到右耳根之间的水平距离分别占到脸部图像整体水平距离的五分之一,即左眼的左眼角到左耳根之间的水平距离、左眼的左眼角到左眼的右眼角之间的水平距离、左眼的右眼角到右眼的左眼角之间的水平距离、右眼的左眼角到右眼的右眼角之间的水平距离与右眼的右眼角到右耳根之间的水平距离之间全部之间的比值为1:1:1:1:1:1。经过研究发现,当脸部图像的人脸姿态从正脸变化为左侧脸或右侧脸时,左眼的左眼角到左耳根之间的水平距离、左眼的左眼角到左眼的右眼角之间的水平距离、左眼的右眼角到右眼的左眼角之间的水平距离、右眼的左眼角到右眼的右眼角之间的水平距离与右眼的右眼角到右耳根之间的水平距离相对于正脸姿态下均发生不同程度的变化,因此,我们可以通过判断上述五个水平距离之间任意两者的比值变化情况判断该脸部图像的人脸姿态是否为左侧脸或右侧脸。Referring to Figure 7, among facial features in a frontal posture, the horizontal distance between the left corner of the left eye and the root of the left ear, the horizontal distance between the left corner of the left eye and the right corner of the left eye, the right corner of the left eye The horizontal distance between the corner of the eye and the left corner of the right eye, the horizontal distance between the left corner of the right eye and the right corner of the right eye, and the horizontal distance between the right corner of the right eye and the root of the right ear respectively account for the overall facial image One-fifth of the horizontal distance, that is, the horizontal distance between the left corner of the left eye and the base of the left ear, the horizontal distance between the left corner of the left eye and the right corner of the left eye, and the horizontal distance between the right corner of the left eye and the left corner of the right eye. The ratio of the horizontal distance between the corners of the eyes, the horizontal distance between the left corner of the right eye to the right corner of the right eye, and the horizontal distance between the right corner of the right eye and the root of the right ear is 1:1:1 :1:1:1. After research, it is found that when the face posture of the face image changes from the front face to the left face or the right face, the horizontal distance between the left corner of the left eye and the root of the left ear, the left corner of the left eye to the right of the left eye The horizontal distance between the corners of the eyes, the horizontal distance between the right corner of the left eye and the left corner of the right eye, the horizontal distance between the left corner of the right eye and the right corner of the right eye, and the distance between the right corner of the right eye and the root of the right ear The horizontal distances between the above five horizontal distances have different degrees of change relative to the face posture. Therefore, we can judge whether the face posture of the face image is the left side by judging the ratio change of any two of the above five horizontal distances. face or the right side of the face.

下面将结合左眼的左眼角到左眼的右眼角之间的水平距离与右眼的左眼角到右眼的右眼角之间的水平距离的比值与第二阈值X之间的大小关系,判断待处理图像的人脸姿态是否为左侧头或右侧头。考虑到测量误差与不同人脸五官的差异性,优选的,第二阈值X的取值是一个数值范围而不是一个具体数值,示例的,第一阈值X为[0.9,1.1]。当然,此处仅是举例说明,并不代表本发明实施例判断待处理图像的人脸姿态是否为左侧头或右侧头的方法局限于此。The ratio of the horizontal distance between the left corner of the left eye to the right corner of the left eye and the horizontal distance between the left corner of the right eye to the right corner of the right eye and the second threshold X will be combined to judge Whether the face pose of the image to be processed is left head or right head. Considering the differences in measurement errors and facial features, preferably, the value of the second threshold X is a numerical range rather than a specific numerical value. For example, the first threshold X is [0.9, 1.1]. Of course, this is just an example, and it does not mean that the method of judging whether the facial posture of the image to be processed is a left head or a right head is not limited in this embodiment of the present invention.

具体的,参考图8所示,第四关键点B1代表左眼的左眼角在脸部图像中的水平位置,第五关键点B2代表左眼的右眼角在脸部图像中的水平位置,第六关键点B3代表右眼的左眼角在脸部图像中的水平位置,第七关键点B4代表右眼的右眼角在脸部图像中的水平位置,第四关键点B1到第五关键点B2之间的水平距离代表左眼的左眼角到左眼的右眼角之间的水平距离,第六关键点B3到第七关键点B4之间的水平距离X2代表右眼的左眼角到右眼的右眼角之间的水平距离。Specifically, as shown in FIG. 8 , the fourth key point B1 represents the horizontal position of the left corner of the left eye in the face image, the fifth key point B2 represents the horizontal position of the right corner of the left eye in the face image, and the fifth key point B2 represents the horizontal position of the right corner of the left eye in the face image. The six key points B3 represent the horizontal position of the left corner of the right eye in the face image, the seventh key point B4 represents the horizontal position of the right eye corner of the right eye in the face image, the fourth key point B1 to the fifth key point B2 The horizontal distance between represents the horizontal distance between the left corner of the left eye and the right corner of the left eye, and the horizontal distance X2 between the sixth key point B3 and the seventh key point B4 represents the distance from the left corner of the right eye to the right eye. The horizontal distance between the corners of the right eye.

若X1与X2的比值等于第二阈值X,即X1与X2的比值在[0.9,1.1]内,则该脸部图像的人脸姿态为正脸;若X1与X2的比值大于第二阈值X,即X1与X2的比值大于1.1,则该脸部图像的人脸姿态为左侧头;若X1与X2的比值小于第二阈值X,即X1与X2的比值小于0.9,则该脸部图像的人脸姿态为右侧头。If the ratio of X1 to X2 is equal to the second threshold X, that is, the ratio of X1 to X2 is within [0.9, 1.1], then the face posture of the facial image is a positive face; if the ratio of X1 to X2 is greater than the second threshold X , that is, the ratio of X1 to X2 is greater than 1.1, then the face pose of the face image is the left head; if the ratio of X1 to X2 is less than the second threshold X, that is, the ratio of X1 to X2 is less than 0.9, the face image The face pose of is right head.

进一步的,若Y1与Y2的比值大于第一阈值Y且X1与X2的比值大于第二阈值X,则该脸部图像的人脸姿态为仰头且左侧头;若Y1与Y2的比值大于第一阈值Y且X1与X2的比值小于第二阈值X,则该脸部图像的人脸姿态为仰头且右侧头;若Y1与Y2的比值小于第一阈值Y且X1与X2的比值大于第二阈值X,则该脸部图像的人脸姿态为低头且左侧头,若Y1与Y2的比值小于第一阈值Y且X1与X2的比值小于第二阈值X,则该脸部图像的人脸姿态为低头且右侧头。Further, if the ratio of Y1 to Y2 is greater than the first threshold Y and the ratio of X1 to X2 is greater than the second threshold X, the facial posture of the face image is head up and left head; if the ratio of Y1 to Y2 is greater than The first threshold Y and the ratio of X1 to X2 is less than the second threshold X, then the facial posture of the facial image is head up and right head; if the ratio of Y1 to Y2 is less than the first threshold Y and the ratio of X1 to X2 If it is greater than the second threshold X, the facial posture of the facial image is head down and left head. If the ratio of Y1 to Y2 is smaller than the first threshold Y and the ratio of X1 to X2 is smaller than the second threshold X, the facial image The face posture of is head down and head on the right side.

步骤110:根据所述脸部图像的人脸姿态,修正所述关键点对应的椭圆邻域半径。Step 110: Correct the radius of the ellipse neighborhood corresponding to the key point according to the face pose of the face image.

具体的,步骤110的执行过程如下:Specifically, the execution process of step 110 is as follows:

若所述人脸姿态为正脸,所述椭圆邻域的横轴等于第一预设值,所述椭圆邻域的纵轴等于第一预设值。If the face pose is a front face, the horizontal axis of the ellipse neighborhood is equal to a first preset value, and the vertical axis of the ellipse neighborhood is equal to a first preset value.

若所述人脸姿态为仰头或低头,所述椭圆邻域的横轴等于第一预设值,所述椭圆邻域的纵轴等于第一预设值与第一预设权重的乘积。If the facial posture is head up or head down, the horizontal axis of the ellipse neighborhood is equal to a first preset value, and the vertical axis of the ellipse neighborhood is equal to the product of the first preset value and a first preset weight.

若所述人脸姿态为左侧头或右侧头,所述椭圆邻域的横轴等于第一预设值与第二预设权重的乘积,所述椭圆邻域的纵轴等于第一预设值。If the face posture is the left head or the right head, the horizontal axis of the ellipse neighborhood is equal to the product of the first preset value and the second preset weight, and the vertical axis of the ellipse neighborhood is equal to the first preset weight. set value.

具体的,参考图9所示,关键点O的椭圆邻域横轴为W、纵轴为H。根据步骤100的判断结果,若待处理脸部图像的人脸姿态为正脸,则关键点O的椭圆邻域横轴W等于第一预设值D、纵轴H等于第一预设值D;若待处理脸部图像的人脸姿态为仰头或低头,则关键点O的椭圆邻域横轴W等于第一预设值D、纵轴H等于第一预设值D与第一预设权重&1的乘积;若待处理脸部图像的人脸姿态为左侧头或右侧头,则关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D。Specifically, as shown in FIG. 9 , the horizontal axis of the elliptical neighborhood of the key point O is W, and the vertical axis is H. According to the judgment result of step 100, if the face pose of the face image to be processed is a frontal face, then the horizontal axis W of the ellipse neighborhood of the key point O is equal to the first preset value D, and the vertical axis H is equal to the first preset value D ; If the face posture of the face image to be processed is head up or head down, the horizontal axis W of the ellipse neighborhood of the key point O is equal to the first preset value D, and the vertical axis H is equal to the first preset value D and the first preset value. Set the product of weight &1; if the face pose of the face image to be processed is the left head or the right head, then the horizontal axis W of the ellipse neighborhood of the key point O is equal to the first preset value D and the second preset weight &2 The product of , the vertical axis H is equal to the first preset value D.

进一步的,首先,将待处理脸部图像分为四个区域,分别为第一区域、第二区域、第三区域和第四区域,其中,第一区域、第二区域、第三区域和第四区域沿顺时针分布,且第一区域位于所述第四区域竖直方向上。Further, firstly, the face image to be processed is divided into four regions, which are respectively the first region, the second region, the third region and the fourth region, wherein the first region, the second region, the third region and the fourth region The four areas are distributed clockwise, and the first area is located in the vertical direction of the fourth area.

示例的,参考图10所示,第一区域位于人脸的左半脸且位于鼻底线以上区域,第二区域位于人脸的右半脸且位于鼻底线以上区域,第三区域位于人脸的右半脸且位于鼻底线以下区域,第四区域位于人脸的左半脸且位于鼻底线以下区域。For example, as shown in Figure 10, the first area is located on the left half of the face and above the nose line, the second area is located on the right half of the face and above the nose line, and the third area is located on the bottom of the face. The right half of the face is located in the area below the nasal base line, and the fourth area is located in the left half of the face and is located in the area below the nasal base line.

具体的,根据步骤100的待处理脸部图像的人脸姿态估计结果,若待处理脸部图像的人脸姿态为正脸,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D、纵轴H等于第一预设值D。Specifically, according to the face pose estimation result of the face image to be processed in step 100, if the face pose of the face image to be processed is a frontal face, it is located in the first area, the second area, the third area and the fourth area The horizontal axis W of the ellipse neighborhood of the key point O is equal to the first preset value D, and the vertical axis H is equal to the first preset value D.

若待处理脸部图像的人脸姿态为仰头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域和第二区域时,第一预设权重&1小于1,即位于第一区域和第二区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第三区域和第四区域时,第一预设权重&1大于1,即位于第一区域和第二区域的关键点O的椭圆邻域的纵轴H大于第一预设值D。If the face posture of the face image to be processed is head-up, then the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset value D, The vertical axis H is equal to the product of the first preset value D and the first preset weight &1. Among them, when the key point O is located in the first area and the second area, the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area and the second area is smaller than the first preset weight Set the value D; when the key point O is located in the third area and the fourth area, the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area and the second area is greater than the first A default value D.

若待处理脸部图像的人脸姿态为低头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域和第二区域时,第一预设权重&1大于1,即位于第一区域和第二区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第三区域和第四区域时,第一预设权重&1小于1,即位于第一区域和第二区域的关键点O的椭圆邻域的纵轴H小于第一预设值D。If the face posture of the face image to be processed is head down, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset value D, and the vertical axis is equal to the first preset value D. The axis H is equal to the product of the first preset value D and the first preset weight &1. Among them, when the key point O is located in the first area and the second area, the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area and the second area is greater than the first preset weight Set the value D; when the key point O is located in the third area and the fourth area, the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area and the second area is smaller than the first A default value D.

若待处理脸部图像的人脸姿态为左侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D。其中,当关键点O位于第一区域和第三区域时,第二预设权重&2大于1,即位于第一区域和第二区域的关键点O的椭圆邻域的横轴W大于第一预设值D;当关键点O位于第二区域和第四区域时,第二预设权重&2小于1,即位于第一区域和第二区域的关键点O的椭圆邻域的横轴W小于第一预设值D。If the face pose of the face image to be processed is the left head, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset value D The product of the second preset weight &2, the vertical axis H is equal to the first preset value D. Among them, when the key point O is located in the first area and the third area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area and the second area is greater than the first preset weight Set the value D; when the key point O is located in the second area and the fourth area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area and the second area is smaller than the first area A default value D.

若待处理脸部图像的人脸姿态为右侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D。其中,当关键点O位于第一区域和第三区域时,第二预设权重&2小于1,即位于第一区域和第二区域的关键点O的椭圆邻域的横轴W小于第一预设值D;当关键点O位于第二区域和第四区域时,第二预设权重&2大于1,即位于第一区域和第二区域的关键点O的椭圆邻域的横轴W大于第一预设值D。If the face pose of the face image to be processed is the right head, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset value D The product of the second preset weight &2, the vertical axis H is equal to the first preset value D. Among them, when the key point O is located in the first area and the third area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area and the second area is smaller than the first preset weight Set the value D; when the key point O is located in the second area and the fourth area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area and the second area is greater than the first area A default value D.

若待处理脸部图像的人脸姿态为仰头且左侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第二区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第三区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第四区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D。If the face posture of the face image to be processed is head up and head on the left side, then the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset The product of the set value D and the second preset weight &2, and the vertical axis H are equal to the product of the first preset value D and the first preset weight &1. Wherein, when the key point O is located in the first area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, and the first preset The weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D; when the key point O is located in the second area, the second preset weight &2 is less than 1, that is The horizontal axis W of the ellipse neighborhood of the key point O located in the first area is less than the first preset value D, and the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area Less than the first preset value D; when the key point O is located in the third area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D; when the key point O is located in the fourth area, the second preset Weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O in the first area is smaller than the first preset value D, and the first preset weight &1 is greater than 1, that is, the ellipse of the key point O in the first area The vertical axis H of the neighborhood is larger than the first preset value D.

若待处理脸部图像的人脸姿态为仰头且右侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第二区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第三区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第四区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D。If the facial posture of the face image to be processed is head up and head on the right side, then the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset The product of the set value D and the second preset weight &2, and the vertical axis H are equal to the product of the first preset value D and the first preset weight &1. Wherein, when the key point O is located in the first area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D, and the first preset The weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D; when the key point O is located in the second area, the second preset weight &2 is greater than 1, that is The horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, and the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area Less than the first preset value D; when the key point O is located in the third area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D, the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D; when the key point O is located in the fourth area, the second preset Weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O in the first area is greater than the first preset value D, and the first preset weight &1 is greater than 1, that is, the ellipse of the key point O in the first area The vertical axis H of the neighborhood is larger than the first preset value D.

若待处理脸部图像的人脸姿态为低头且左侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第二区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第三区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第四区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D。If the face posture of the face image to be processed is head down and head on the left side, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset The product of the value D and the second preset weight &2, the vertical axis H is equal to the product of the first preset value D and the first preset weight &1. Wherein, when the key point O is located in the first area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, and the first preset The weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D; when the key point O is located in the second area, the second preset weight &2 is less than 1, that is The horizontal axis W of the ellipse neighborhood of the key point O located in the first area is less than the first preset value D, and the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area Greater than the first preset value D; when the key point O is located in the third area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D; when the key point O is located in the fourth area, the second preset Weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O in the first area is smaller than the first preset value D, and the first preset weight &1 is less than 1, that is, the ellipse of the key point O in the first area The vertical axis H of the neighborhood is smaller than the first preset value D.

若待处理脸部图像的人脸姿态为仰低头且右侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第二区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第三区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第四区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D。If the face posture of the face image to be processed is head down and head on the right side, then the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset The product of the set value D and the second preset weight &2, and the vertical axis H are equal to the product of the first preset value D and the first preset weight &1. Wherein, when the key point O is located in the first area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D, and the first preset The weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D; when the key point O is located in the second area, the second preset weight &2 is greater than 1, that is The horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, and the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area Greater than the first preset value D; when the key point O is located in the third area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D, the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D; when the key point O is located in the fourth area, the second preset Weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O in the first area is greater than the first preset value D, and the first preset weight &1 is less than 1, that is, the ellipse of the key point O in the first area The vertical axis H of the neighborhood is smaller than the first preset value D.

示例的,第一预设权重&1小于1时,&1=1-e·sinα,其中,α为待处理脸部图像中人脸姿态的侧头角度;第一预设权重&1大于1时,&1=1+e·sinα,其中,α为待处理脸部图像中人脸姿态的侧头角度;第二预设权重&2小于1时,示例的&2=0.8;第二预设权重&2大于1时,示例的&2=1.2。For example, when the first preset weight &1 is less than 1, &1=1-e·sinα, wherein, α is the side head angle of the face posture in the face image to be processed; when the first preset weight &1 is greater than 1, &1 =1+e sin α, wherein, α is the side head angle of face attitude in the face image to be processed; When the second preset weight & 2 is less than 1, & 2=0.8 of example; When the second preset weight & 2 is greater than 1 , &2=1.2 for the example.

示例的,同一人的脸部图像,关键点O的椭圆邻域横轴W、纵轴H与人脸姿态和关键点O的位置之间的对应关系如下表表一所示:For example, in the face image of the same person, the corresponding relationship between the horizontal axis W and the vertical axis H of the ellipse neighborhood of the key point O, the face pose and the position of the key point O is shown in Table 1 below:

表一Table I

步骤120:对所述脸部图像采用所述椭圆邻域半径对所述关键点进行LBP特征提取。Step 120: performing LBP feature extraction on the key points using the ellipse neighborhood radius on the face image.

具体的,对待处理脸部图像的关键点进行LBP特征提取之前,需要对待处理脸部图像进行归一化处理,将待处理脸部图像的尺寸缩放到同一尺寸。示例的,假如待处理脸部图像中人脸的双眼球间实际距离为L,若待处理脸部图像的人脸姿态不是左侧头或右侧头,则对待处理脸部图像进行缩放直至其中人脸的双眼球间距离为L;若待处理脸部图像的人脸姿态是左侧头或右侧头,则对待处理脸部图像进行缩放直至其中人脸的双眼球间距离为L·cosα,其中α为待处理脸部图像中人脸姿态的侧头角度。Specifically, before performing LBP feature extraction on the key points of the face image to be processed, it is necessary to perform normalization processing on the face image to be processed, and scale the size of the face image to be processed to the same size. For example, if the actual distance between the two eyeballs of the face in the face image to be processed is L, if the face pose of the face image to be processed is not the left head or the right head, then the face image to be processed is scaled until it The distance between the two eyeballs of the face is L; if the face pose of the face image to be processed is the left head or the right head, then the face image to be processed is scaled until the distance between the two eyeballs of the face is L cosα , where α is the side head angle of the face pose in the face image to be processed.

进一步的,以每一个关键点为中心,取待处理脸部图像中的一块区域,并将该区域分成若干个大小相同的图像块,然后对每一个图像块的每个像素点进行LBP特征提取。在对每一个像素点进行LBP特征提取的过程中,使用圆形LBP算子,其中,每一个像素点的邻域半径采用步骤110中根据人脸姿态和关键点位置确定的椭圆邻域的横轴W和纵轴H的数值,进而获得该椭圆邻域内若干个采样点的像素值,将该若干个采样点的像素值与该椭圆邻域中心点的像素值进行比较,大于该中心点像素值的采样点位置标记为1,否则标记为0。然后,根据每个采样点的标记结果,按照一定的顺序得到一定位数的二进制数,然后按照等价模式将该二进制数转化为十进制数,根据该十进制数生成该图像块的直方图,最后将每个图像块的直方图进行串联,生成该关键点的LBP特征向量。Further, take each key point as the center, take an area in the face image to be processed, and divide the area into several image blocks of the same size, and then perform LBP feature extraction on each pixel of each image block . In the process of LBP feature extraction for each pixel point, a circular LBP operator is used, wherein the neighborhood radius of each pixel point adopts the transverse radius of the ellipse neighborhood determined according to the face pose and key point position in step 110. Axis W and vertical axis H, and then obtain the pixel values of several sampling points in the ellipse neighborhood, compare the pixel values of the several sampling points with the pixel value of the center point of the ellipse neighborhood, and the pixels greater than the center point The sampling point position of the value is marked as 1, otherwise it is marked as 0. Then, according to the marking results of each sampling point, a binary number with a certain number of digits is obtained in a certain order, and then the binary number is converted into a decimal number according to the equivalent mode, and the histogram of the image block is generated according to the decimal number, and finally The histograms of each image block are concatenated to generate the LBP feature vector of the key point.

进一步的,关于关键点的LBP特征提取算法,本发明不做详细介绍,本领域技术人员可参考现有技术。Further, the present invention does not introduce in detail about the LBP feature extraction algorithm of key points, and those skilled in the art may refer to the prior art.

本发明实施例提供的基于脸部关键点的LBP特征提取方法,首先根据脸部图像的关键点确定该脸部图像的人脸姿态,进而根据该脸部图像的人脸姿态修正不同脸部关键点所对应的椭圆邻域半径,建立了椭圆邻域半径与该脸部图像的人脸姿态以及该关键点的位置之间的对应关系,进而采用修正后的椭圆邻域半径提取该脸部关键点的LBP特征,从而避免了同一个人不同人脸姿态下,脸部图像局部缩放比例不同,导致同一关键点提取的LBP特征差别较大的问题,提高了不同人脸姿态下基于脸部关键点的LBP特征提取的有效性,进而提高了人脸识别准确率。The face key point-based LBP feature extraction method provided by the embodiment of the present invention first determines the face pose of the face image according to the key points of the face image, and then corrects different face key points according to the face pose of the face image. The corresponding relationship between the radius of the ellipse neighborhood and the face pose of the face image and the position of the key point is established, and the corrected radius of the ellipse neighborhood is used to extract the key points of the face. Point LBP features, thus avoiding the problem that the local scaling ratio of the face image is different under different face poses of the same person, resulting in a large difference in the LBP features extracted from the same key point, and improving the face key points based on different face poses. The effectiveness of the LBP feature extraction, thereby improving the accuracy of face recognition.

实施例二Embodiment two

图11示出了本发明实施例提供的另一种基于脸部关键点的LBP特征提取流程示意图,如图11所示,该基于脸部关键点的LBP特征提取过程包括:Fig. 11 shows a schematic diagram of another LBP feature extraction process based on facial key points provided by an embodiment of the present invention. As shown in Fig. 11, the LBP feature extraction process based on facial key points includes:

步骤200:基于待处理脸部图像的关键点,估计所述脸部图像的人脸姿态。Step 200: Estimating the face pose of the face image based on the key points of the face image to be processed.

具体的,步骤200的执行过程与上述实施例一的步骤100相同,前面已经详细介绍,本发明在此不做累述,具体的请参照实施例一的步骤100。Specifically, the execution process of step 200 is the same as that of step 100 in the above-mentioned embodiment 1, which has been introduced in detail above, and the present invention will not be repeated here. For details, please refer to step 100 in embodiment 1.

步骤210:根据所述脸部图像的人脸姿态确定所述关键点在预置映射表中对应的椭圆邻域半径。Step 210: Determine the radius of the ellipse neighborhood corresponding to the key point in the preset mapping table according to the face pose of the face image.

具体的,根据上述步骤200中确定的待处理脸部图像的人脸姿态,查找待处理脸部图像的关键点在预置映射表中所对应的椭圆邻域半径,其中,该预置映射表用于表征同一个人的脸部图像,在不同人脸姿态下的不同脸部区域内的关键点进行LBP特征提取过程中对应的椭圆邻域半径大小。示例的,参考图10所示,将人脸分为四个区域,分别为第一区域、第二区域、第三区域和第四区域,其中,第一区域、第二区域、第三区域和第四区域沿顺时针分布,且第一区域位于所述第四区域竖直方向上,其中,第一区域位于人脸的左半脸且位于鼻底线以上区域,第二区域位于人脸的右半脸且位于鼻底线以上区域,第三区域位于人脸的右半脸且位于鼻底线以下区域,第四区域位于人脸的左半脸且位于鼻底线以下区域。Specifically, according to the face pose of the face image to be processed determined in the above step 200, the ellipse neighborhood radius corresponding to the key point of the face image to be processed in the preset mapping table is searched, wherein the preset mapping table It is used to represent the face image of the same person, and the corresponding ellipse neighborhood radius in the process of LBP feature extraction of key points in different face regions under different face poses. Exemplarily, as shown in FIG. 10 , the face is divided into four regions, namely the first region, the second region, the third region and the fourth region, wherein the first region, the second region, the third region and the The fourth area is distributed clockwise, and the first area is located in the vertical direction of the fourth area, wherein the first area is located on the left half of the face and above the nose line, and the second area is located on the right side of the face. The half face is located above the nose line, the third area is located on the right half of the face and below the nose line, and the fourth area is located on the left half of the face and below the nose line.

进一步的,该预置映射表中,待处理脸部图像关键点O与待处理脸部图像的人脸姿态和该关键点O在待处理脸部图像上的分布位置之间的对应关系如下:Further, in the preset mapping table, the corresponding relationship between the key point O of the face image to be processed and the face pose of the face image to be processed and the distribution position of the key point O on the face image to be processed is as follows:

若待处理脸部图像的人脸姿态为正脸,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D、纵轴H等于第一预设值D。If the face pose of the face image to be processed is a positive face, then the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset value D, The vertical axis H is equal to the first preset value D.

若待处理脸部图像的人脸姿态为仰头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域和第二区域时,第一预设权重&1小于1,即位于第一区域和第二区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第三区域和第四区域时,第一预设权重&1大于1,即位于第一区域和第二区域的关键点O的椭圆邻域的纵轴H大于第一预设值D。If the face posture of the face image to be processed is head-up, then the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset value D, The vertical axis H is equal to the product of the first preset value D and the first preset weight &1. Among them, when the key point O is located in the first area and the second area, the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area and the second area is smaller than the first preset weight Set the value D; when the key point O is located in the third area and the fourth area, the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area and the second area is greater than the first A default value D.

若待处理脸部图像的人脸姿态为低头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域和第二区域时,第一预设权重&1大于1,即位于第一区域和第二区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第三区域和第四区域时,第一预设权重&1小于1,即位于第一区域和第二区域的关键点O的椭圆邻域的纵轴H小于第一预设值D。If the face posture of the face image to be processed is head down, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset value D, and the vertical axis is equal to the first preset value D. The axis H is equal to the product of the first preset value D and the first preset weight &1. Among them, when the key point O is located in the first area and the second area, the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area and the second area is greater than the first preset weight Set the value D; when the key point O is located in the third area and the fourth area, the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area and the second area is smaller than the first A default value D.

若待处理脸部图像的人脸姿态为左侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D。其中,当关键点O位于第一区域和第三区域时,第二预设权重&2大于1,即位于第一区域和第二区域的关键点O的椭圆邻域的横轴W大于第一预设值D;当关键点O位于第二区域和第四区域时,第二预设权重&2小于1,即位于第一区域和第二区域的关键点O的椭圆邻域的横轴W小于第一预设值D。If the face pose of the face image to be processed is the left head, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset value D The product of the second preset weight &2, the vertical axis H is equal to the first preset value D. Among them, when the key point O is located in the first area and the third area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area and the second area is greater than the first preset weight Set the value D; when the key point O is located in the second area and the fourth area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area and the second area is smaller than the first area A default value D.

若待处理脸部图像的人脸姿态为右侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D。其中,当关键点O位于第一区域和第三区域时,第二预设权重&2小于1,即位于第一区域和第二区域的关键点O的椭圆邻域的横轴W小于第一预设值D;当关键点O位于第二区域和第四区域时,第二预设权重&2大于1,即位于第一区域和第二区域的关键点O的椭圆邻域的横轴W大于第一预设值D。If the face pose of the face image to be processed is the right head, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset value D The product of the second preset weight &2, the vertical axis H is equal to the first preset value D. Among them, when the key point O is located in the first area and the third area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area and the second area is smaller than the first preset weight Set the value D; when the key point O is located in the second area and the fourth area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area and the second area is greater than the first area A default value D.

若待处理脸部图像的人脸姿态为仰头且左侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第二区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第三区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第四区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D。If the face posture of the face image to be processed is head up and head on the left side, then the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset The product of the set value D and the second preset weight &2, and the vertical axis H are equal to the product of the first preset value D and the first preset weight &1. Wherein, when the key point O is located in the first area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, and the first preset The weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D; when the key point O is located in the second area, the second preset weight &2 is less than 1, that is The horizontal axis W of the ellipse neighborhood of the key point O located in the first area is less than the first preset value D, and the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area Less than the first preset value D; when the key point O is located in the third area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D; when the key point O is located in the fourth area, the second preset Weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O in the first area is smaller than the first preset value D, and the first preset weight &1 is greater than 1, that is, the ellipse of the key point O in the first area The vertical axis H of the neighborhood is larger than the first preset value D.

若待处理脸部图像的人脸姿态为仰头且右侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第二区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第三区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第四区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D。If the facial posture of the face image to be processed is head up and head on the right side, then the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset The product of the set value D and the second preset weight &2, and the vertical axis H are equal to the product of the first preset value D and the first preset weight &1. Wherein, when the key point O is located in the first area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D, and the first preset The weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D; when the key point O is located in the second area, the second preset weight &2 is greater than 1, that is The horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, and the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area Less than the first preset value D; when the key point O is located in the third area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D, the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D; when the key point O is located in the fourth area, the second preset Weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O in the first area is greater than the first preset value D, and the first preset weight &1 is greater than 1, that is, the ellipse of the key point O in the first area The vertical axis H of the neighborhood is larger than the first preset value D.

若待处理脸部图像的人脸姿态为低头且左侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第二区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第三区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第四区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D。If the face posture of the face image to be processed is head down and head on the left side, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset The product of the value D and the second preset weight &2, the vertical axis H is equal to the product of the first preset value D and the first preset weight &1. Wherein, when the key point O is located in the first area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, and the first preset The weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D; when the key point O is located in the second area, the second preset weight &2 is less than 1, that is The horizontal axis W of the ellipse neighborhood of the key point O located in the first area is less than the first preset value D, and the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area Greater than the first preset value D; when the key point O is located in the third area, the second preset weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D; when the key point O is located in the fourth area, the second preset Weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O in the first area is smaller than the first preset value D, and the first preset weight &1 is less than 1, that is, the ellipse of the key point O in the first area The vertical axis H of the neighborhood is smaller than the first preset value D.

若待处理脸部图像的人脸姿态为仰低头且右侧头,则位于第一区域、第二区域、第三区域和第四区域的关键点O的椭圆邻域横轴W等于第一预设值D与第二预设权重&2的乘积、纵轴H等于第一预设值D与第一预设权重&1的乘积。其中,当关键点O位于第一区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第二区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1大于1,即位于第一区域的关键点O的椭圆邻域的纵轴H大于第一预设值D;当关键点O位于第三区域时,第二预设权重&2小于1,即位于第一区域的关键点O的椭圆邻域的横轴W小于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D;当关键点O位于第四区域时,第二预设权重&2大于1,即位于第一区域的关键点O的椭圆邻域的横轴W大于第一预设值D,第一预设权重&1小于1,即位于第一区域的关键点O的椭圆邻域的纵轴H小于第一预设值D。If the face posture of the face image to be processed is head down and head on the right side, then the horizontal axis W of the ellipse neighborhood of the key point O located in the first area, the second area, the third area and the fourth area is equal to the first preset The product of the set value D and the second preset weight &2, and the vertical axis H are equal to the product of the first preset value D and the first preset weight &1. Wherein, when the key point O is located in the first area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D, and the first preset The weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D; when the key point O is located in the second area, the second preset weight &2 is greater than 1, that is The horizontal axis W of the ellipse neighborhood of the key point O located in the first area is greater than the first preset value D, and the first preset weight &1 is greater than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area Greater than the first preset value D; when the key point O is located in the third area, the second preset weight &2 is less than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D, the first preset weight &1 is less than 1, that is, the vertical axis H of the ellipse neighborhood of the key point O located in the first area is smaller than the first preset value D; when the key point O is located in the fourth area, the second preset Weight &2 is greater than 1, that is, the horizontal axis W of the ellipse neighborhood of the key point O in the first area is greater than the first preset value D, and the first preset weight &1 is less than 1, that is, the ellipse of the key point O in the first area The vertical axis H of the neighborhood is smaller than the first preset value D.

示例的,第一预设权重&1小于1时,&1=1-e·sinα,其中,α为待处理脸部图像中人脸姿态的侧头角度;第一预设权重&1大于1时,&1=1+e·sinα,其中,α为待处理脸部图像中人脸姿态的侧头角度;第二预设权重&2小于1时,示例的&2=0.7;第二预设权重&2大于1时,示例的&2=1.1。For example, when the first preset weight &1 is less than 1, &1=1-e·sinα, wherein, α is the side head angle of the face posture in the face image to be processed; when the first preset weight &1 is greater than 1, &1 =1+e sin α, wherein, α is the side head angle of face attitude in the face image to be processed; When the second preset weight & 2 is less than 1, & 2=0.7 of example; When the second preset weight & 2 is greater than 1 , &2=1.1 for the example.

示例的,同一人的脸部图像,关键点O的椭圆邻域横轴W、纵轴H与人脸姿态和关键点O的位置之间的对应关系如下表表二所示,即该预置映射表如下表表二所示:For example, for the face image of the same person, the corresponding relationship between the horizontal axis W and the vertical axis H of the ellipse neighborhood of the key point O, the face posture and the position of the key point O is shown in Table 2 below, that is, the preset The mapping table is shown in Table 2 below:

表二Table II

步骤220:对所述脸部图像采用所述椭圆邻域半径对所述关键点进行LBP特征提取。Step 220: Perform LBP feature extraction on the key points using the ellipse neighborhood radius on the face image.

具体的,步骤220的执行过程与上述实施例一的步骤120相同,前面已经详细介绍,本发明在此不做累述,具体的请参照实施例一的步骤120。Specifically, the execution process of step 220 is the same as that of step 120 in the above-mentioned embodiment 1, which has been introduced in detail above, and the present invention will not be repeated here. For details, please refer to step 120 of embodiment 1.

本发明实施例提供的基于脸部关键点的LBP特征提取方法,首先根据脸部图像的关键点确定该脸部图像的人脸姿态,进而根据该脸部图像的人脸姿态,查找待处理脸部图像的关键点在预置映射表中所对应的椭圆邻域半径,其中,该预置映射表用于表征同一个人的脸部图像,在不同人脸姿态下的不同脸部区域内的关键点进行LBP特征提取过程中对应的椭圆邻域半径大小。本发明实施例的预置映射表建立了椭圆邻域半径与该脸部图像的人脸姿态以及该关键点的位置之间的对应关系,进而采用预置映射表中的椭圆邻域半径提取该脸部关键点的LBP特征,从而避免了同一个人不同人脸姿态下,脸部图像局部缩放比例不同,导致同一关键点提取的LBP特征差别较大的问题,提高了不同人脸姿态下基于脸部关键点的LBP特征提取的有效性,进而提高了人脸识别准确率。The LBP feature extraction method based on facial key points provided by the embodiment of the present invention first determines the face pose of the face image according to the key points of the face image, and then searches for the face to be processed according to the face pose of the face image. The key points of the internal image correspond to the ellipse neighborhood radius in the preset mapping table, where the preset mapping table is used to represent the face image of the same person, and the key points in different face regions under different face poses The radius of the corresponding ellipse neighborhood during the LBP feature extraction process of the point. The preset mapping table in the embodiment of the present invention establishes the corresponding relationship between the radius of the ellipse neighborhood and the face pose of the facial image and the position of the key point, and then uses the radius of the neighborhood of the ellipse in the preset mapping table to extract the The LBP feature of the key points of the face, thus avoiding the problem that the local scaling ratio of the face image is different under different face poses of the same person, resulting in a large difference in the LBP features extracted from the same key point, and improving the face based on different face poses. The effectiveness of the LBP feature extraction of internal key points, thereby improving the accuracy of face recognition.

基于上述实施例的基于脸部关键点的LBP特征提取方法,本发明实施例还提供一种基于脸部关键点的LBP特征提取装置,采用上述实施例提供的LBP特征提取方法进行待处理脸部图像的LBP特征提取,该装置如图12所示,包括:Based on the LBP feature extraction method based on the facial key points of the above-mentioned embodiment, the embodiment of the present invention also provides an LBP feature extraction device based on the facial key points, and the LBP feature extraction method provided by the above-mentioned embodiment is used to extract the face to be processed. The LBP feature extraction of the image, the device is shown in Figure 12, including:

关键点检测模块301,用于检测待处理脸部图像的关键点,确定待提取LBP特征的脸部关键点位置。The key point detection module 301 is used to detect the key points of the face image to be processed, and determine the position of the key points of the face to be extracted from the LBP feature.

图像处理模块302,用于获取所述关键点之间的距离根据所述距离确定所述脸部图像的人脸姿态,以及根据所述人脸姿态修正所述关键点对应椭圆邻域的半径。The image processing module 302 is configured to obtain the distance between the key points, determine the face pose of the face image according to the distance, and correct the radius of the ellipse neighborhood corresponding to the key point according to the face pose.

特征提取模块303,用于对所述脸部图像采用所述椭圆邻域的半径对所述关键点进行LBP特征提取。The feature extraction module 303 is configured to perform LBP feature extraction on the key points using the radius of the ellipse neighborhood on the face image.

具体的,关键点检测模块301用于检测待处理脸部图像的关键点,获得待处理脸部图像中待提取LBP特征的脸部关键点位置。进一步的,关键点检测模块301用于检测分别代表待处理脸部图像中人脸轮廓的位置、眉毛的位置、眼睛的位置、鼻子的位置和嘴巴的位置的人脸脸廓关键点、眉毛关键点、眼睛关键点、鼻子关键点和嘴巴关键点等,进而基于关键点的位置,参考图10所示将待处理脸部图像分为第一区域、第二区域、第三区域和第四区域四个区域,其中,第一区域、第二区域、第三区域和第四区域沿顺时针分布,且第一区域位于所述第四区域竖直方向上,示例的,第一区域位于人脸的左半脸且位于鼻底线以上区域,第二区域位于人脸的右半脸且位于鼻底线以上区域,第三区域位于人脸的右半脸且位于鼻底线以下区域,第四区域位于人脸的左半脸且位于鼻底线以下区域。Specifically, the key point detection module 301 is used to detect the key points of the face image to be processed, and obtain the position of the key points of the face to be extracted from the face image to be processed. Further, the key point detection module 301 is used to detect the key points of the face profile, the eyebrow key, the position of the eyebrow, the position of the eye, the position of the nose and the position of the mouth respectively representing the position of the face profile in the face image to be processed. Points, eye key points, nose key points and mouth key points, etc., and then based on the position of the key points, the face image to be processed is divided into the first area, the second area, the third area and the fourth area as shown in Figure 10 Four areas, wherein the first area, the second area, the third area and the fourth area are distributed clockwise, and the first area is located in the vertical direction of the fourth area, for example, the first area is located in the face The left half of the face is located above the nose line, the second area is located on the right half of the face and above the nose line, the third area is located on the right half of the face and below the nose line, and the fourth area is located on the The left half of the face and the area below the bottom line of the nose.

具体的,图像处理模块302用于获取待处理关键点之间的距离,并根据获取到的脸部关键点之间的距离,确定才处理脸部图像的人脸姿态,最后根据确定的待处理脸部图像的人脸姿态,对待处理脸部图像进行比例缩放,并确定不同人脸姿态下的不同脸部区域内的关键点进行LBP特征提取过程中对应的椭圆邻域半径大小。具体的,图像处理模块302根据获取到的脸部关键点之间的距离,确定才处理脸部图像的人脸姿态以及根据确定的待处理脸部图像的人脸姿态,对待处理脸部图像进行比例缩放,并确定不同人脸姿态下的不同脸部区域内的关键点进行LBP特征提取过程中对应的椭圆邻域半径大小的方法,与前面实施例一的步骤100和110以及实施例二的步骤200和步骤210中叙述的方法相同,在此本发明不做累述。Specifically, the image processing module 302 is used to obtain the distance between the key points to be processed, and determine the face pose of the face image to be processed according to the obtained distance between the key points of the face, and finally according to the determined to-be-processed The face pose of the face image is scaled to the face image to be processed, and the key points in different face regions under different face poses are determined to perform the corresponding ellipse neighborhood radius in the process of LBP feature extraction. Specifically, the image processing module 302 determines the face pose of the face image to be processed according to the acquired distance between facial key points, and performs processing on the face image to be processed according to the determined face pose of the face image to be processed. Scaling, and determining the key points in different face areas under different face postures to perform the method of corresponding ellipse neighborhood radius in the process of LBP feature extraction, and the steps 100 and 110 of the previous embodiment 1 and the method of embodiment 2 The methods described in step 200 and step 210 are the same, and the present invention will not repeat them here.

具体的,特征提取模块303用于对缩放后的脸部图像采用图像处理模块302中确定的脸部关键点的椭圆邻域半径对该关键点进行LBP特征提取,具体的LBP特征提取方法和过程,请参考实施例一的步骤120和实施例二的步骤220,本发明在此不做累述。Specifically, the feature extraction module 303 is used to perform LBP feature extraction on the key point using the ellipse neighborhood radius of the facial key point determined in the image processing module 302 on the scaled face image, and the specific LBP feature extraction method and process , please refer to step 120 of Embodiment 1 and step 220 of Embodiment 2, and the present invention will not repeat them here.

本发明实施例提供的基于脸部关键点的LBP特征提取装置,首先根据脸部图像的关键点确定该脸部图像的人脸姿态,进而根据该脸部图像的人脸姿态,确定待处理脸部图像在该人脸姿态下的不同脸部区域内的关键点进行LBP特征提取过程中对应的椭圆邻域半径大小。本发明实施例的LBP特征提取装置建立了椭圆邻域半径与该脸部图像的人脸姿态以及该关键点的位置之间的对应关系,进而采用该椭圆邻域半径提取该脸部关键点的LBP特征,从而避免了同一个人不同人脸姿态下,脸部图像局部缩放比例不同,导致同一关键点提取的LBP特征差别较大的问题,提高了不同人脸姿态下基于脸部关键点的LBP特征提取的有效性,进而提高了人脸识别准确率。The LBP feature extraction device based on facial key points provided by the embodiment of the present invention first determines the face pose of the face image according to the key points of the face image, and then determines the face to be processed according to the face pose of the face image. The corresponding radius of the ellipse neighborhood during the LBP feature extraction process of key points in different face regions of the face image under the face pose. The LBP feature extraction device in the embodiment of the present invention establishes the corresponding relationship between the radius of the ellipse neighborhood and the face pose of the face image and the position of the key point, and then uses the radius of the ellipse neighborhood to extract the key point of the face. LBP features, thus avoiding the problem that the local scaling ratio of the face image is different under different face poses of the same person, resulting in a large difference in the LBP features extracted from the same key point, and improving the LBP based on face key points under different face poses The effectiveness of feature extraction improves the accuracy of face recognition.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器,使得通过该计算机或其他可编程数据处理设备的处理器执行的指令可实现流程图中的一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special purpose computer, an embedded processor, or other programmable data processing equipment, so that the instructions executed by the processor of the computer or other programmable data processing equipment can realize the A process or processes and/or a function specified in a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图的一个流程或多个流程和/或方框图的一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow or flows of the flowcharts and/or the block or blocks of the block diagrams.

尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。While preferred embodiments of the present invention have been described, additional changes and modifications can be made to these embodiments by those skilled in the art once the basic inventive concept is appreciated. Therefore, it is intended that the appended claims be construed to cover the preferred embodiment as well as all changes and modifications which fall within the scope of the invention.

显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本发明实施例的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Apparently, those skilled in the art can make various changes and modifications to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. In this way, if the modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and equivalent technologies, the present invention also intends to include these modifications and variations.

Claims (19)

1. a kind of LBP feature extracting method based on face's key point characterized by comprising
Based on the key point of face image to be processed, the human face posture of the face image is estimated;
According to the human face posture of the face image, the corresponding Ellipse Neighborhood radius of the key point is corrected;
LBP feature extraction is carried out to the key point using the Ellipse Neighborhood radius to the face image.
2. a kind of LBP feature extracting method based on face's key point characterized by comprising
Based on the key point of face image to be processed, the human face posture of the face image is estimated;
The key point corresponding Ellipse Neighborhood radius in preset mapping table is determined according to the human face posture of the face image;
LBP feature extraction is carried out to the key point using the Ellipse Neighborhood radius to the face image.
3. method according to claim 1 or 2, which is characterized in that the key point based on face image to be processed is estimated Count the human face posture of the face image, comprising:
Obtain the first vertical distance and the second vertical distance on the face image vertical direction, wherein described first is vertical Distance and second vertical distance are distributed from up to down along the vertical direction;
Ratio between first vertical distance and second vertical distance is greater than first threshold, then the face image Human face posture is to bow;Or
Ratio between first vertical distance and second vertical distance is less than first threshold, then the face image Human face posture is to face upward head.
4. method according to claim 1 or claim 2, which is characterized in that the key point based on face image to be processed, estimation The human face posture of the face image, further includes:
Obtain the first level distance and the second horizontal distance in the face image horizontal direction, wherein the first level Distance and second horizontal distance are distributed from left to right in the horizontal direction;
Ratio between the first level distance and second horizontal distance is greater than second threshold, then the face image Human face posture is right side head;Or
Ratio between the first level distance and second horizontal distance is less than second threshold, then the face image Human face posture is left side head.
5. according to claim 1 or any one of 2 the methods, which is characterized in that the face appearance according to the face image State corrects the corresponding Ellipse Neighborhood radius of the key point, comprising:
The horizontal axis of the face if the human face posture is positive, the Ellipse Neighborhood is equal to the first preset value, the longitudinal axis of the Ellipse Neighborhood Equal to the first preset value;Or
If the human face posture is to face upward head or bow, the horizontal axis of the Ellipse Neighborhood is equal to the first preset value, the Ellipse Neighborhood The longitudinal axis be equal to the first preset value and the first default weight product;Or
If the human face posture is left side head or right side head, the horizontal axis of the Ellipse Neighborhood, which is equal to the first preset value and second, to be preset The longitudinal axis of the product of weight, the Ellipse Neighborhood is equal to the first preset value.
6. method according to claim 5, which is characterized in that the face image includes first area, second area, third Region and the fourth region, wherein the first area, the second area, the third region and the fourth region are along suitable Hour hands distribution, and the first area is located on the fourth region vertical direction.
7. method according to claim 6, which is characterized in that the human face posture according to the face image corrects institute State the corresponding Ellipse Neighborhood radius of key point, comprising:
The face if human face posture is positive, the first area, the second area, the third region and the fourth region The horizontal axis of the Ellipse Neighborhood and the longitudinal axis of the Ellipse Neighborhood be equal to the first preset value.
8. method according to claim 6, which is characterized in that the human face posture according to the face image corrects institute State the corresponding Ellipse Neighborhood radius of key point, further includes:
If the human face posture is to face upward head, the first area, the second area, the third region and the fourth region The horizontal axis be equal to first preset value, the longitudinal axis of the first area and the second area is default less than first The longitudinal axis of value, the third region and the fourth region is greater than first preset value.
9. method according to claim 6, which is characterized in that the human face posture according to the face image corrects institute State the corresponding Ellipse Neighborhood radius of key point, further includes:
If the human face posture is to bow, the first area, the second area, the third region and the fourth region The horizontal axis be equal to first preset value, it is default that the longitudinal axis of the first area and the second area is greater than first The longitudinal axis of value, the third region and the fourth region is less than first preset value.
10. method according to claim 6, which is characterized in that the human face posture according to the face image corrects institute State the corresponding Ellipse Neighborhood radius of key point, further includes:
If the human face posture is left side head, it is default that the horizontal axis of the first area and the fourth region is greater than first Value, the horizontal axis in the second area and the third region are less than first preset value, the first area, described the The longitudinal axis in two regions, the third region and the fourth region is equal to first preset value.
11. method according to claim 6, which is characterized in that the human face posture according to the face image corrects institute State the corresponding Ellipse Neighborhood radius of key point, further includes:
If the human face posture is right side head, the horizontal axis of the first area and the fourth region is default less than first Value, the horizontal axis in the second area and the third region are greater than first preset value, the first area, described the The longitudinal axis in two regions, the third region and the fourth region is equal to first preset value.
12. method according to claim 6, which is characterized in that the human face posture according to the face image corrects institute State the corresponding Ellipse Neighborhood radius of key point, further includes:
If the human face posture is to face upward head and left side head, the horizontal axis of the first area and the fourth region is greater than described The horizontal axis in the first preset value, the second area and the third region is less than first preset value, firstth area The longitudinal axis of domain and the second area is less than the first preset value, the longitudinal axis in the third region and the fourth region Greater than the first preset value.
13. method according to claim 6, which is characterized in that the human face posture according to the face image corrects institute State the corresponding Ellipse Neighborhood radius of key point, further includes:
If the human face posture is to face upward head and right side head, the horizontal axis of the first area and the fourth region is less than described The horizontal axis in the first preset value, the second area and the third region is greater than first preset value, firstth area The longitudinal axis of domain and the second area is greater than the first preset value, the longitudinal axis in the third region and the fourth region Less than the first preset value.
14. method according to claim 6, which is characterized in that the human face posture according to the face image corrects institute State the corresponding Ellipse Neighborhood radius of key point, further includes:
If the human face posture is to bow and left side head, the horizontal axis of the first area and the fourth region is greater than described The horizontal axis in the first preset value, the second area and the third region is less than first preset value, firstth area The longitudinal axis of domain and the second area is greater than the first preset value, the longitudinal axis in the third region and the fourth region Less than the first preset value.
15. method according to claim 6, which is characterized in that the human face posture according to the face image corrects institute State the corresponding Ellipse Neighborhood radius of key point, further includes:
If the human face posture is to face upward head and left side head, the horizontal axis of the first area and the fourth region is less than described The horizontal axis in the first preset value, the second area and the third region is greater than first preset value, firstth area The longitudinal axis of domain and the second area is less than the first preset value, the longitudinal axis in the third region and the fourth region Greater than the first preset value.
16. method according to claim 6, which is characterized in that preset mapping table is used to characterize under different faces posture, is different The corresponding Ellipse Neighborhood radius of the key point in face area, in which:
The face if human face posture is positive, the first area, the second area, the third region and the fourth region The horizontal axis of the Ellipse Neighborhood and the longitudinal axis of the Ellipse Neighborhood be equal to the first preset value;
If the human face posture is to face upward head, the first area, the second area, the third region and the fourth region The horizontal axis be equal to first preset value, the longitudinal axis of the first area and the second area is default less than first The longitudinal axis of value, the third region and the fourth region is greater than first preset value;
If the human face posture is to bow, the first area, the second area, the third region and the fourth region The horizontal axis be equal to first preset value, it is default that the longitudinal axis of the first area and the second area is greater than first The longitudinal axis of value, the third region and the fourth region is less than first preset value;
If the human face posture is left side head, it is default that the horizontal axis of the first area and the fourth region is greater than first Value, the horizontal axis in the second area and the third region are less than first preset value, the first area, described the The longitudinal axis in two regions, the third region and the fourth region is equal to first preset value;
If the human face posture is right side head, the horizontal axis of the first area and the fourth region is default less than first Value, the horizontal axis in the second area and the third region are greater than first preset value, the first area, described the The longitudinal axis in two regions, the third region and the fourth region is equal to first preset value;
If the human face posture is to face upward head and left side head, the horizontal axis of the first area and the fourth region is greater than described The horizontal axis in the first preset value, the second area and the third region is less than first preset value, firstth area The longitudinal axis of domain and the second area is less than the first preset value, the longitudinal axis in the third region and the fourth region Greater than the first preset value;
If the human face posture is to face upward head and right side head, the horizontal axis of the first area and the fourth region is less than described The horizontal axis in the first preset value, the second area and the third region is greater than first preset value, firstth area The longitudinal axis of domain and the second area is greater than the first preset value, the longitudinal axis in the third region and the fourth region Less than the first preset value;
If the human face posture is to bow and left side head, the horizontal axis of the first area and the fourth region is greater than described The horizontal axis in the first preset value, the second area and the third region is less than first preset value, firstth area The longitudinal axis of domain and the second area is greater than the first preset value, the longitudinal axis in the third region and the fourth region Less than the first preset value;
If the human face posture is to face upward head and left side head, the horizontal axis of the first area and the fourth region is less than described The horizontal axis in the first preset value, the second area and the third region is greater than first preset value, firstth area The longitudinal axis of domain and the second area is less than the first preset value, the longitudinal axis in the third region and the fourth region Greater than the first preset value.
17. a kind of LBP feature deriving means based on face's key point characterized by comprising
Critical point detection module, for detecting the key point of face image to be processed;
Image processing module determines the face image according to the distance for obtaining the distance between described key point Human face posture, and the radius that the key point corresponds to Ellipse Neighborhood is corrected according to the human face posture;
Characteristic extracting module, for carrying out LBP to the key point using the radius of the Ellipse Neighborhood to the face image Feature extraction.
18. 7 described device according to claim 1, which is characterized in that described image processing module is specifically used for:
Obtain the first vertical distance and the second vertical distance on the face image vertical direction, wherein described first is vertical Distance and second vertical distance are distributed from up to down along the vertical direction, first vertical distance with described second vertically away from Ratio between is greater than first threshold, then the human face posture of the face image be bow or first vertical distance with Ratio between second vertical distance is less than first threshold, then the human face posture of the face image is to face upward head;
Obtain the first level distance and the second horizontal distance in the face image horizontal direction, wherein the first level Distance and second horizontal distance are distributed from left to right in the horizontal direction, the first level distance with described second it is horizontal away from Ratio between is greater than second threshold, then the human face posture of the face image is right side head or the first level distance Ratio between second horizontal distance is less than second threshold, then the human face posture of the face image is left side head.
19. 7 described device according to claim 1, which is characterized in that described image processing module is specifically used for:
The face if human face posture is positive determines the described oval adjacent of first area, second area, third region and the fourth region The longitudinal axis of the horizontal axis in domain and the Ellipse Neighborhood is equal to the first preset value;Or
If the human face posture is to face upward head, the first area, the second area, the third region and the described 4th are determined The horizontal axis in region is equal to first preset value, and the longitudinal axis of the first area and the second area is less than first The longitudinal axis of preset value, the third region and the fourth region is greater than first preset value;Or
If the human face posture is to bow, the first area, the second area, the third region and the described 4th are determined The horizontal axis in region is equal to first preset value, and the longitudinal axis of the first area and the second area is greater than first The longitudinal axis of preset value, the third region and the fourth region is less than first preset value;Or
If the human face posture is left side head, determine that the horizontal axis of the first area and the fourth region is greater than first in advance If value, the horizontal axis in the second area and the third region is less than first preset value, the first area, described The longitudinal axis of second area, the third region and the fourth region is equal to first preset value;Or
If the human face posture is right side head, determine that the horizontal axis of the first area and the fourth region is pre- less than first If value, the horizontal axis in the second area and the third region is greater than first preset value, the first area, described The longitudinal axis of second area, the third region and the fourth region is equal to first preset value;Or
If the human face posture is to face upward head and left side head, determine that the horizontal axis of the first area and the fourth region is greater than The horizontal axis in first preset value, the second area and the third region is less than first preset value, and described the The longitudinal axis of one region and the second area less than the first preset value, the third region and the fourth region it is described The longitudinal axis is greater than the first preset value;Or
If the human face posture is to face upward head and right side head, determine that the horizontal axis of the first area and the fourth region is less than The horizontal axis in first preset value, the second area and the third region is greater than first preset value, and described the The longitudinal axis of one region and the second area is greater than the first preset value, the third region and the fourth region it is described The longitudinal axis is less than the first preset value;Or
If the human face posture is to bow and left side head, determine that the horizontal axis of the first area and the fourth region is greater than The horizontal axis in first preset value, the second area and the third region is less than first preset value, and described the The longitudinal axis of one region and the second area is greater than the first preset value, the third region and the fourth region it is described The longitudinal axis is less than the first preset value;Or
If the human face posture is to face upward head and left side head, determine that the horizontal axis of the first area and the fourth region is less than The horizontal axis in first preset value, the second area and the third region is greater than first preset value, and described the The longitudinal axis of one region and the second area less than the first preset value, the third region and the fourth region it is described The longitudinal axis is greater than the first preset value.
CN201610093896.1A 2016-02-22 2016-02-22 A method and device for extracting LBP features based on facial key points Expired - Fee Related CN105608448B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610093896.1A CN105608448B (en) 2016-02-22 2016-02-22 A method and device for extracting LBP features based on facial key points

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610093896.1A CN105608448B (en) 2016-02-22 2016-02-22 A method and device for extracting LBP features based on facial key points

Publications (2)

Publication Number Publication Date
CN105608448A CN105608448A (en) 2016-05-25
CN105608448B true CN105608448B (en) 2019-08-09

Family

ID=55988374

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610093896.1A Expired - Fee Related CN105608448B (en) 2016-02-22 2016-02-22 A method and device for extracting LBP features based on facial key points

Country Status (1)

Country Link
CN (1) CN105608448B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106203308B (en) * 2016-06-30 2023-04-21 美的集团股份有限公司 Face recognition method and face recognition device
CN107958439B (en) * 2017-11-09 2021-04-27 北京小米移动软件有限公司 Image processing method and device
CN109359532A (en) * 2018-09-12 2019-02-19 中国人民解放军国防科技大学 BGP face recognition method based on heuristic information
CN110909568A (en) * 2018-09-17 2020-03-24 北京京东尚科信息技术有限公司 Image detection method, apparatus, electronic device, and medium for face recognition
CN109685013B (en) * 2018-12-25 2020-11-24 上海智臻智能网络科技股份有限公司 Method and device for detecting head key points in human body posture recognition
CN110532965B (en) * 2019-08-30 2022-07-26 京东方科技集团股份有限公司 Age identification method, storage medium and electronic device
CN112069954B (en) * 2020-08-26 2023-12-19 武汉普利商用机器有限公司 Living body micro-expression detection method and system
CN112232146B (en) * 2020-09-27 2024-04-09 厦门亿联网络技术股份有限公司 Face brightness calculation method, device, equipment and storage medium
CN112686824B (en) * 2020-12-30 2024-11-29 北京迈格威科技有限公司 Image correction method, apparatus, electronic device, and computer-readable medium
CN115798011A (en) * 2022-12-05 2023-03-14 中远海运散货运输有限公司 Face image screening method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011089517A1 (en) * 2010-01-25 2011-07-28 Vesalis Method and device for facial recognition under variable pose conditions
CN102667810A (en) * 2009-10-09 2012-09-12 维斯顿有限公司 Face recognition in digital images
CN103988228A (en) * 2011-09-27 2014-08-13 英特尔公司 Face recognition method, apparatus, and computer-readable recording medium for executing the method
CN104036276A (en) * 2014-05-29 2014-09-10 无锡天脉聚源传媒科技有限公司 Face recognition method and device
CN104268539A (en) * 2014-10-17 2015-01-07 中国科学技术大学 High-performance human face recognition method and system
CN104794441A (en) * 2015-04-15 2015-07-22 重庆邮电大学 Human face feature extracting method based on active shape model and POEM (patterns of oriented edge magnituedes) texture model in complicated background
CN104850818A (en) * 2014-02-17 2015-08-19 华为技术有限公司 Face detector training method, face detection method and device
CN104899575A (en) * 2015-06-19 2015-09-09 南京大学 Human body assembly dividing method based on face detection and key point positioning

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102667810A (en) * 2009-10-09 2012-09-12 维斯顿有限公司 Face recognition in digital images
WO2011089517A1 (en) * 2010-01-25 2011-07-28 Vesalis Method and device for facial recognition under variable pose conditions
CN103988228A (en) * 2011-09-27 2014-08-13 英特尔公司 Face recognition method, apparatus, and computer-readable recording medium for executing the method
CN104850818A (en) * 2014-02-17 2015-08-19 华为技术有限公司 Face detector training method, face detection method and device
CN104036276A (en) * 2014-05-29 2014-09-10 无锡天脉聚源传媒科技有限公司 Face recognition method and device
CN104268539A (en) * 2014-10-17 2015-01-07 中国科学技术大学 High-performance human face recognition method and system
CN104794441A (en) * 2015-04-15 2015-07-22 重庆邮电大学 Human face feature extracting method based on active shape model and POEM (patterns of oriented edge magnituedes) texture model in complicated background
CN104899575A (en) * 2015-06-19 2015-09-09 南京大学 Human body assembly dividing method based on face detection and key point positioning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
AAM在多姿态人脸特征点检测中的应用;呼月宁等;《计算机工程与应用》;20100421;第46卷(第12期);161-165 *
基于LBP金字塔特征的头部姿态识别;戴惟嘉;《信息化研究》;20160220;第42卷(第1期);40-43 *

Also Published As

Publication number Publication date
CN105608448A (en) 2016-05-25

Similar Documents

Publication Publication Date Title
CN105608448B (en) A method and device for extracting LBP features based on facial key points
US20210209851A1 (en) Face model creation
CN105023010B (en) A kind of human face in-vivo detection method and system
CN107506693B (en) Distorted face image correction method, device, computer equipment and storage medium
CN105574518B (en) Method and device for face liveness detection
KR100374708B1 (en) Non-contact type human iris recognition method by correction of rotated iris image
CN103210421B (en) Article detection device and object detecting method
WO2018028546A1 (en) Key point positioning method, terminal, and computer storage medium
US20160162673A1 (en) Technologies for learning body part geometry for use in biometric authentication
CN102971768B (en) Posture state estimation unit and posture state method of estimation
CN112384127B (en) Eyelid ptosis detection method and system
CN104933389B (en) Finger vein-based identification method and device
WO2015067084A1 (en) Human eye positioning method and apparatus
US10922399B2 (en) Authentication verification using soft biometric traits
JP2007094906A (en) Characteristic point detection device and method
CN104573634A (en) Three-dimensional face recognition method
CN112200074B (en) Gesture comparison method and terminal
CN103605965A (en) Multi-pose face recognition method and device
JP2009053916A (en) Face image processing apparatus, face image processing method, and computer program
JP6071002B2 (en) Reliability acquisition device, reliability acquisition method, and reliability acquisition program
CN109389018B (en) Face angle recognition method, device and equipment
CN109993021A (en) Face detection method, device and electronic device
CN117623031A (en) Elevator non-inductive control system and method
US11048926B2 (en) Adaptive hand tracking and gesture recognition using face-shoulder feature coordinate transforms
CN111652018B (en) Face registration method and authentication method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190809