WO2017036160A1 - Glasses removal method for facial recognition - Google Patents

Glasses removal method for facial recognition Download PDF

Info

Publication number
WO2017036160A1
WO2017036160A1 PCT/CN2016/081152 CN2016081152W WO2017036160A1 WO 2017036160 A1 WO2017036160 A1 WO 2017036160A1 CN 2016081152 W CN2016081152 W CN 2016081152W WO 2017036160 A1 WO2017036160 A1 WO 2017036160A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
face
region
glasses
eliminating
Prior art date
Application number
PCT/CN2016/081152
Other languages
French (fr)
Chinese (zh)
Inventor
聂芸芸
梁添才
龚文川
张永
刘道余
Original Assignee
广州广电运通金融电子股份有限公司
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 广州广电运通金融电子股份有限公司 filed Critical 广州广电运通金融电子股份有限公司
Publication of WO2017036160A1 publication Critical patent/WO2017036160A1/en

Links

Images

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
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/273Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion removing elements interfering with the pattern to be recognised
    • 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/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion

Definitions

  • the present invention relates to the field of face recognition technology, and in particular, to a method for eliminating glasses for face recognition.
  • Embodiments of the present invention provide a method for eliminating glasses for face recognition, which can solve the problem of reflection of a face image lens.
  • performing face detection on the first image, and acquiring the face region specifically includes:
  • the face region is acquired by performing face detection on the first image based on the skin color detecting method.
  • the data model of the Haar classifier is updated when the glasses elimination method is first executed:
  • a plurality of face images are expanded into the OpenCV library in the Haar classifier as original training samples, and the cascade training is re-derived to obtain a new data model.
  • the method further includes:
  • the calculating the illuminance of the face region is specifically:
  • the illuminance of the image of the eye region is calculated.
  • the acquiring the image of the eye region in the face region specifically includes:
  • An eye region image is obtained according to the coordinates of the two diagonal vertices and the relative position of the preset eye region.
  • calculating the illuminance of the image of the eye region specifically includes:
  • the high-brightness pixel being a pixel having a gray value of 1.
  • positioning the frame area of the eyeglass frame on the second image is specifically:
  • the frame area of the eyeglass frame is positioned on the second image by the GVF-Snake method.
  • repairing the frame area on the second image to obtain a target image of the elimination frame is specifically:
  • the frame region on the second image is interpolated and repaired by a weighted average difference method to obtain a target image from which the frame is eliminated.
  • the method further includes:
  • Determining whether the glare of the face region on any of the first images is greater than a preset standard threshold, and if so, performing the screening of the first illuminance that is not greater than a preset first glare threshold The step of the image as the second image.
  • the first reflection threshold is obtained by the following steps:
  • a face image is collected, and the obtained plurality of image frames are grayed out to obtain a plurality of first images; then, the first image is subjected to face detection to obtain a face. a region; then, calculating a shininess of the face region; and filtering the first image whose glare is not greater than a preset first glare threshold as a second image; and further, on the second image Positioning the frame area of the eyeglass frame; finally, repairing the frame area on the second image to obtain a target image of the frame.
  • the method for eliminating the face recognition glasses can solve the problem of reflection of the face image glasses, so that the human eye positioning no longer receives the influence of the glasses reflection, the feature points are accurately positioned and the recognition rate is improved.
  • FIG. 1 is a flow chart of an embodiment of a method for eliminating glasses for face recognition according to an embodiment of the present invention
  • FIG. 2 is a flow chart of another embodiment of a method for eliminating glasses for face recognition according to an embodiment of the present invention
  • FIG. 3 is an analytical diagram of weighted interpolation weight calculation proposed by the present invention.
  • Embodiments of the present invention provide a method for eliminating glasses for face recognition, which is used to solve the problem of reflection of a face image lens.
  • an embodiment of a method for eliminating glasses for face recognition includes:
  • a face image can be acquired, and the obtained plurality of image frames are subjected to gradation processing to obtain a plurality of first images.
  • the first image may be subjected to face detection to acquire a face region.
  • the illuminance of the face area can be calculated.
  • the first image whose illuminance is not greater than a preset first illuminating threshold may be selected as the second image.
  • the frame region of the eyeglass frame may be positioned on the second image.
  • the frame area on the second image can be repaired to obtain a target image from which the frame is eliminated.
  • a face image is collected, and the obtained plurality of image frames are subjected to grayscale processing to obtain a plurality of first images; then, the first image is subjected to face detection to obtain a face region; Then, calculating the illuminance of the face region; selecting the first image whose illuminance is not greater than the preset first illuminating threshold as the second image; and then positioning the frame region of the spectacles frame on the second image Finally, the frame area on the second image is repaired, and the target image of the frame is eliminated.
  • the method for eliminating the face recognition glasses can solve the problem of reflection of the face image glasses, so that the human eye positioning no longer receives the influence of the glasses reflection, the feature points are accurately positioned and the recognition rate is improved.
  • FIG. 2 another embodiment of a method for eliminating glasses for face recognition according to an embodiment of the present invention includes:
  • a face image can be acquired, and the obtained plurality of image frames are subjected to gradation processing to obtain a plurality of first images.
  • a near-infrared image of a human face can be collected, and the near-infrared camera can have the following characteristics: 1. Automatic rotation within a range of 45 degrees; 2. Band 850 nm; 3. Near the camera. Infrared fill light, the camera is activated, and the light source is turned on.
  • the camera continuously photographs the human face at a fixed frequency or time interval to obtain a plurality of image frames, that is, multi-frame images. These images are then grayed out to obtain a corresponding plurality of first images.
  • the first image may be subjected to face detection to acquire a face region.
  • face detection methods there are two types: one is based on machine learning, such as the face detection method based on Haar classifier; the other is based on skin color detection method, or the fusion of the above two methods; Adaptive thresholds are more difficult to obtain due to the diversity of user skin tones. Therefore, in step 202, the face detection algorithm of the OpenCV library can be used for face detection, and the algorithm is implemented based on the Haar classifier.
  • the present invention can expand a plurality of face images (or a near-infrared image specifically for a face) into the OpenCV library in the Haar classifier in advance as The original training samples are re-conducted to obtain a new data model.
  • the original training samples are augmented with 70,000 NIR images, and cascading training is performed to obtain a new data model.
  • the reconstructed data model can accurately locate the face region of the near-infrared face image.
  • an image of the eye area in the face area can be acquired.
  • the acquiring the image of the eye region in the face region may specifically include:
  • the rectangular region RI where the two eyes are located is calculated by the following formula (1), and the RI is binarized to obtain the binarized eye region image.
  • the rectangular area RI where the two eyes are located is calculated by the following formula:
  • RI left FR left +FR width /8
  • RI top FR top +FR width /4
  • RI right FR left +FR width -FR width /8 (1)
  • RI bottom FR top +FR height /2
  • the initial threshold of binarization of RI is obtained by statistic of gray histogram, and then the threshold is adjusted according to the pixel distribution of the binary image, which can reduce the interference of other high-brightness noise in non-eye regions.
  • the eye region image may be binarized as described in step 203.
  • step 205 After binarizing the image of the eye region, the illuminance of the image of the eye region can be calculated. It can be understood that, for the binarized image, the shininess is reflected by the number of high-brightness pixels (the gradation value is 1) on the image. Therefore, step 205 can be specifically as follows:
  • the sum of the number of high-brightness pixels included in all connected domains on the image of the eye region is calculated, and the high-brightness pixel is a pixel with a gray value of 1, wherein the higher the number of high-brightness pixels, the higher the spectacle of the glasses.
  • the specific calculation formula (2) is as follows:
  • S i is the number of pixels whose gradation value is 1 in the i-th connected domain
  • m is the number of connected domains formed by high-brightness pixels.
  • step 206 determining whether there is any vertigo of the face area of the first image is greater than a preset standard threshold, and if so, executing step 207, if not, executing step 211;
  • step 207 After calculating the illuminance of the image of the eye region, it may be determined whether the glare of the face region on any of the first images is greater than a preset standard threshold, and if yes, step 207 is performed. If no, step 211 is performed.
  • the near-infrared light source is irradiated from a certain angle to the lens to cause strong reflection, forming a high-luminance connection region, and the illumination at any angle does not form a high-brightness connection region on the eye.
  • the acquisition camera is rotated up and down and supplements near-infrared light, if glasses are worn, there must be multiple illumination angles such that the glare is above a certain threshold.
  • the judgment criterion of the glasses detection is: multi-frame (for example, five frames) images sampled at intervals, if one frame of image glare is greater than a preset standard threshold, it is determined to wear glasses, and vice versa, no glasses are worn. ,
  • K ⁇ K ⁇ is the eyeglass detection threshold (ie, the standard threshold), which can be set experimentally.
  • the person may be considered to have glasses on the face, and therefore, the glare may be filtered out to be greater than a preset first glare threshold.
  • the first image is taken as the second image.
  • the image with low reflectance and accurate positioning of the pupil is obtained by the saliency screening. Since the angle and intensity of the light source are constantly changing, the resulting image frame sequence has different shininess.
  • the saliency screening is achieved by threshold control of the image shininess: if the illuminance of the image I is K ⁇ ⁇ , it is removed by screening to the next frame.
  • the first reflective threshold may be calculated in advance, and specifically includes:
  • the first reflection threshold ⁇ is obtained through a data experiment: the collected 10,000 glasses images I 1 , . . . , I 10000 are subjected to a face feature point localization algorithm test. The image set A with accurate pupil positioning is selected, and the reflectances K 1 , . . . , K N (N ⁇ 10000) of all the images in A are calculated by the formula of the reflectance, and the maximum value is the first reflection threshold ⁇ .
  • the frame area of the eyeglass frame can be positioned on the second image.
  • the eyeglass frame positioning can adopt the GVF-Snake method, and the initial contour is gradually evolved to the target contour GI by the energy function. Since the method is based on the region edge information and does not depend on the image gray feature, the contour curve is highly resistant to noise and false boundaries during the evolution process, and the method is not sensitive to the initial contour.
  • the initial contour of this step can be obtained by the Canny detection method: Gaussian filtering is performed on the image, and the eyeglass contour S 0 is extracted using the Canny operator in the eyeglass region RI.
  • the frame area on the second image can be repaired to obtain a target image of the frame.
  • the common methods for eliminating the glasses frame area are PCA reconstruction, setting mask template processing, feature element compensation, weighted average interpolation, and the like.
  • PCA reconstruction and feature element compensation methods require a large number of glasses face database and model database without glasses, but it is difficult to obtain such samples in practical applications.
  • the template setting of the mask template processing method has a large dependence on the image itself, and the generalization performance of the method is not good.
  • the invention adopts a weighted average interpolation method to estimate the pixel point P 0 (x 0 , y 0 ) in the target contour GI by using the gray value of the known pixel point.
  • N is the total number of P 0 neighborhood pixels in the window
  • G(x i , y i ) is the gray value of the P 0 neighborhood pixel in the window
  • ⁇ i is the weight.
  • the occlusion portion of the eyeglass frame is mostly skin or hair, and the degree of correlation with the pixels of the vertical neighborhood is higher than that of the horizontal neighborhood, so the window can adopt an m ⁇ n rectangular region centered on the point to be interpolated (where: m ⁇ n, such as : 3 ⁇ 7 windows).
  • m ⁇ n such as : 3 ⁇ 7 windows.
  • d is the Euclidean distance from the interpolation point P0 to the neighborhood pixel point P i :
  • is the angle between the line P 0 P i and the axis of the window.
  • the target image of the frame After the target image of the frame is removed, the target image can be saved to a database for convenient use.
  • the illuminance of the face region on any of the first images does not exceed the preset standard threshold, it can be considered that no glasses are worn on the face of the person, and the first image is the target image and is saved in the database.
  • the face image of the wearing face can be accurately detected by using the face avatar acquisition, and the image with serious reflection of the lens is automatically filtered through a reasonable threshold, and the image with low reflection degree and not affecting the pupil positioning is further filtered.
  • the frame is eliminated.
  • the face image of the glasses after treatment by the device has no interference of the glasses reflection and the frame occlusion, and effectively solves the problem that the user recognition efficiency of the glasses in the near-infrared mode is low or even unrecognizable, and the algorithm has high efficiency and small memory consumption.
  • the identification system user based on the collection device can complete the recognition with the same efficiency without removing the glasses, and greatly improves the user satisfaction.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated in In a unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Abstract

A glasses removal method for facial recognition, which is used for solving the problem that glasses lenses in a facial image reflect light. The method comprises: collecting a facial image, and performing grayscale processing on a plurality of obtained image frames to obtain a plurality of first images (101); performing face detection on the first images to acquire a face region (102); calculating the light reflectance of the face region (103); screening out the first image with a light reflectance not greater than a pre-set first light reflectance threshold value as a second image (104); locating a glasses frame region of a glasses frame on the second image (105); and restoring the glasses frame region on the second image to obtain a target image in which the glasses frame is removed (106).

Description

人脸识别的眼镜消除方法Face recognition method for eliminating glasses
本申请要求2015年09月06日提交中国专利局、申请号为201510564190.4、发明名称为“人脸识别的眼镜消除方法”的发明专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to the Chinese Patent Office, filed on Sep. 6, 2015, the entire disclosure of which is hereby incorporated by reference.
技术领域Technical field
本发明涉及人脸识别技术领域,尤其涉及人脸识别的眼镜消除方法。The present invention relates to the field of face recognition technology, and in particular, to a method for eliminating glasses for face recognition.
背景技术Background technique
光照、姿态和表情等是影响人脸识别的主要因素,其中光照变化对人脸识别的影响较大。近红外图像可以有效的解决环境光照变化的影响,但是近红外主动光源照射在眼镜上形成反光会导致人眼定位失败,另外,眼镜边框的遮挡也会影响特征点的准确定位而引起识别率下降。Light, posture and expression are the main factors affecting face recognition, and illumination changes have a greater impact on face recognition. Near-infrared images can effectively solve the influence of ambient light changes, but the near-infrared active light source illuminates on the glasses to cause reflection of the human eye. In addition, the occlusion of the frame of the glasses also affects the accurate positioning of the feature points and causes the recognition rate to decrease. .
人脸图像眼镜片反光问题是人脸识别领域的长期以来面临的技术难题,目前在图像处理层面上尚没有一种有效的解决方法。The problem of reflective image of face image glasses is a long-standing technical problem in the field of face recognition. At present, there is no effective solution at the level of image processing.
发明内容Summary of the invention
本发明实施例提供了一种人脸识别的眼镜消除方法,能够解决人脸图像眼镜片反光的问题。Embodiments of the present invention provide a method for eliminating glasses for face recognition, which can solve the problem of reflection of a face image lens.
本发明实施例提供的一种人脸识别的眼镜消除方法,包括:A method for eliminating glasses for face recognition according to an embodiment of the present invention includes:
采集人脸图像,并对得到的多个图像帧进行灰度化处理,得到多张第一图像;Collecting a face image, and performing grayscale processing on the obtained plurality of image frames to obtain a plurality of first images;
对所述第一图像进行人脸检测,获取人脸区域;Performing face detection on the first image to acquire a face region;
计算所述人脸区域的反光度;Calculating the illuminance of the face region;
筛选出所述反光度不大于预设的第一反光阈值的所述第一图像作为第二图像;And filtering the first image whose reflection degree is not greater than a preset first reflection threshold as a second image;
在所述第二图像上定位眼镜框的镜框区域;Positioning a frame area of the eyeglass frame on the second image;
修复所述第二图像上的所述镜框区域,得到消除镜框的目标图像。Repairing the frame area on the second image to obtain a target image that eliminates the frame.
可选地,对所述第一图像进行人脸检测,获取人脸区域具体包括:Optionally, performing face detection on the first image, and acquiring the face region specifically includes:
通过基于Haar分类器对所述第一图像进行人脸检测,获取人脸区域; Obtaining a face region by performing face detection on the first image based on a Haar classifier;
或,通过基于肤色检测方法对所述第一图像进行人脸检测,获取人脸区域。Or, the face region is acquired by performing face detection on the first image based on the skin color detecting method.
可选地,在首次执行所述眼镜消除方法时,对所述Haar分类器的数据模型进行更新:Optionally, the data model of the Haar classifier is updated when the glasses elimination method is first executed:
将多幅人脸图像扩充至所述Haar分类器中的OpenCV库中作为原始训练样本,重新进行级联训练得到新的数据模型。A plurality of face images are expanded into the OpenCV library in the Haar classifier as original training samples, and the cascade training is re-derived to obtain a new data model.
可选地,在对所述第一图像进行人脸检测,获取人脸区域之后,并且在计算所述人脸区域的反光度之前还包括:Optionally, after performing face detection on the first image, acquiring a face region, and before calculating the shininess of the face region, the method further includes:
获取所述人脸区域中的眼部区域图像;Obtaining an image of an eye region in the face region;
对所述眼部区域图像进行二值化处理;Performing binarization processing on the image of the eye region;
所述计算所述人脸区域的反光度具体为:The calculating the illuminance of the face region is specifically:
计算所述眼部区域图像的反光度。The illuminance of the image of the eye region is calculated.
可选地,获取所述人脸区域中的眼部区域图像具体包括:Optionally, the acquiring the image of the eye region in the face region specifically includes:
获取所述人脸区域的两个对角顶点坐标;Obtaining two diagonal vertex coordinates of the face region;
根据所述两个对角顶点坐标以及预设的眼部区域相对位置得到眼部区域图像。An eye region image is obtained according to the coordinates of the two diagonal vertices and the relative position of the preset eye region.
可选地,计算所述眼部区域图像的反光度具体包括:Optionally, calculating the illuminance of the image of the eye region specifically includes:
计算所述眼部区域图像上所有连通域内包含的高亮度像素的个数之和,所述高亮度像素为灰度值为1的像素。Calculating a sum of the number of high-brightness pixels included in all connected domains on the image of the eye region, the high-brightness pixel being a pixel having a gray value of 1.
可选地,在所述第二图像上定位眼镜框的镜框区域具体为:Optionally, positioning the frame area of the eyeglass frame on the second image is specifically:
通过GVF-Snake方法在所述第二图像上定位出眼镜框的镜框区域。The frame area of the eyeglass frame is positioned on the second image by the GVF-Snake method.
可选地,修复所述第二图像上的所述镜框区域,得到消除镜框的目标图像具体为:Optionally, repairing the frame area on the second image to obtain a target image of the elimination frame is specifically:
通过加权平均差值方法对所述第二图像上的所述镜框区域进行插值修复,得到消除镜框的目标图像。The frame region on the second image is interpolated and repaired by a weighted average difference method to obtain a target image from which the frame is eliminated.
可选地,计算所述人脸区域的反光度之后以及筛选出所述反光度不大于预设的第一反光阈值的所述第一图像作为第二图像之前还包括:Optionally, after calculating the illuminance of the face region and screening the first image whose glare is not greater than the preset first glare threshold as the second image, the method further includes:
判断是否存在任一所述第一图像上人脸区域的所述反光度大于预设的标准阈值,若是,则执行筛选出所述反光度不大于预设的第一反光阈值的所述第一图像作为第二图像的步骤。 Determining whether the glare of the face region on any of the first images is greater than a preset standard threshold, and if so, performing the screening of the first illuminance that is not greater than a preset first glare threshold The step of the image as the second image.
可选地,所述第一反光阈值由以下步骤得到:Optionally, the first reflection threshold is obtained by the following steps:
采集不少于预设数量级的戴眼镜的人脸图像;Collecting face images of glasses that are not less than a preset number of levels;
从所述人脸图像中筛选出瞳孔定位准确的图像组成标准图像集;Extracting an image with accurate pupil positioning from the face image to form a standard image set;
计算所述标准图像集中所有图像的反光度;Calculating the illuminance of all images in the standard image set;
获取所述所有图像的反光度的最大值,作为所述第一反光阈值。Obtaining a maximum value of the shininess of all the images as the first reflection threshold.
从以上技术方案可以看出,本发明实施例具有以下优点:It can be seen from the above technical solutions that the embodiments of the present invention have the following advantages:
本发明实施例中,首先,采集人脸图像,并对得到的多个图像帧进行灰度化处理,得到多张第一图像;然后,对所述第一图像进行人脸检测,获取人脸区域;接着,计算所述人脸区域的反光度;筛选出所述反光度不大于预设的第一反光阈值的所述第一图像作为第二图像;再之,在所述第二图像上定位眼镜框的镜框区域;最后,修复所述第二图像上的所述镜框区域,得到消除镜框的目标图像。在本发明实施例中,该人脸识别的眼镜消除方法可以解决人脸图像眼镜片反光的问题,使得人眼定位不再收到眼镜反光的影响,特征点准确定位并提高识别率。In the embodiment of the present invention, first, a face image is collected, and the obtained plurality of image frames are grayed out to obtain a plurality of first images; then, the first image is subjected to face detection to obtain a face. a region; then, calculating a shininess of the face region; and filtering the first image whose glare is not greater than a preset first glare threshold as a second image; and further, on the second image Positioning the frame area of the eyeglass frame; finally, repairing the frame area on the second image to obtain a target image of the frame. In the embodiment of the present invention, the method for eliminating the face recognition glasses can solve the problem of reflection of the face image glasses, so that the human eye positioning no longer receives the influence of the glasses reflection, the feature points are accurately positioned and the recognition rate is improved.
附图说明DRAWINGS
图1为本发明实施例中人脸识别的眼镜消除方法一个实施例流程图;1 is a flow chart of an embodiment of a method for eliminating glasses for face recognition according to an embodiment of the present invention;
图2为本发明实施例中人脸识别的眼镜消除方法另一个实施例流程图;2 is a flow chart of another embodiment of a method for eliminating glasses for face recognition according to an embodiment of the present invention;
图3为本发明提出的加权插值权重计算解析图。FIG. 3 is an analytical diagram of weighted interpolation weight calculation proposed by the present invention.
具体实施方式detailed description
本发明实施例提供了人脸识别的眼镜消除方法,用于解决人脸图像眼镜片反光的问题。Embodiments of the present invention provide a method for eliminating glasses for face recognition, which is used to solve the problem of reflection of a face image lens.
为使得本发明的发明目的、特征、优点能够更加的明显和易懂,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,下面所描述的实施例仅仅是本发明一部分实施例,而非全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。 In order to make the object, the features and the advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
请参阅图1,本发明实施例中一种人脸识别的眼镜消除方法一个实施例包括:Referring to FIG. 1, an embodiment of a method for eliminating glasses for face recognition according to an embodiment of the present invention includes:
101、采集人脸图像,并对得到的多个图像帧进行灰度化处理,得到多张第一图像;101. Collecting a face image, and performing grayscale processing on the obtained plurality of image frames to obtain a plurality of first images;
首先,可以采集人脸图像,并对得到的多个图像帧进行灰度化处理,得到多张第一图像。First, a face image can be acquired, and the obtained plurality of image frames are subjected to gradation processing to obtain a plurality of first images.
102、对该第一图像进行人脸检测,获取人脸区域;102. Perform face detection on the first image to obtain a face area.
在得到多张第一图像之后,可以对该第一图像进行人脸检测,获取人脸区域。After obtaining the plurality of first images, the first image may be subjected to face detection to acquire a face region.
103、计算该人脸区域的反光度;103. Calculate a shininess of the face area;
在获取人脸区域之后,可以计算该人脸区域的反光度。After the face area is acquired, the illuminance of the face area can be calculated.
104、筛选出该反光度不大于预设的第一反光阈值的该第一图像作为第二图像;104. Filter the first image whose reflection degree is not greater than a preset first reflection threshold as the second image;
在计算该人脸区域的反光度之后,可以筛选出该反光度不大于预设的第一反光阈值的该第一图像作为第二图像。After calculating the illuminance of the face region, the first image whose illuminance is not greater than a preset first illuminating threshold may be selected as the second image.
105、在该第二图像上定位眼镜框的镜框区域;105. Position a frame area of the eyeglass frame on the second image;
在筛选出该反光度不大于预设的第一反光阈值的该第一图像作为第二图像之后,可以在该第二图像上定位眼镜框的镜框区域。After the first image whose reflection degree is not greater than the preset first reflection threshold is selected as the second image, the frame region of the eyeglass frame may be positioned on the second image.
106、修复该第二图像上的该镜框区域,得到消除镜框的目标图像。106. Repair the frame area on the second image to obtain a target image that eliminates the frame.
在在该第二图像上定位眼镜框的镜框区域之后,可以修复该第二图像上的该镜框区域,得到消除镜框的目标图像。After positioning the frame area of the eyeglass frame on the second image, the frame area on the second image can be repaired to obtain a target image from which the frame is eliminated.
本实施例中,首先,采集人脸图像,并对得到的多个图像帧进行灰度化处理,得到多张第一图像;然后,对该第一图像进行人脸检测,获取人脸区域;接着,计算该人脸区域的反光度;筛选出该反光度不大于预设的第一反光阈值的该第一图像作为第二图像;再之,在该第二图像上定位眼镜框的镜框区域;最后,修复该第二图像上的该镜框区域,得到消除镜框的目标图像。在本实施例中,该人脸识别的眼镜消除方法可以解决人脸图像眼镜片反光的问题,使得人眼定位不再收到眼镜反光的影响,特征点准确定位并提高识别率。In this embodiment, first, a face image is collected, and the obtained plurality of image frames are subjected to grayscale processing to obtain a plurality of first images; then, the first image is subjected to face detection to obtain a face region; Then, calculating the illuminance of the face region; selecting the first image whose illuminance is not greater than the preset first illuminating threshold as the second image; and then positioning the frame region of the spectacles frame on the second image Finally, the frame area on the second image is repaired, and the target image of the frame is eliminated. In the embodiment, the method for eliminating the face recognition glasses can solve the problem of reflection of the face image glasses, so that the human eye positioning no longer receives the influence of the glasses reflection, the feature points are accurately positioned and the recognition rate is improved.
为便于理解,下面对本发明实施例中的一种人脸识别的眼镜消除方法 进行详细描述,请参阅图2,本发明实施例中一种人脸识别的眼镜消除方法另一个实施例包括:For ease of understanding, the following method for eliminating face recognition glasses in the embodiment of the present invention For a detailed description, referring to FIG. 2, another embodiment of a method for eliminating glasses for face recognition according to an embodiment of the present invention includes:
201、采集人脸图像,并对得到的多个图像帧进行灰度化处理,得到多张第一图像;201, collecting a face image, and performing grayscale processing on the obtained plurality of image frames to obtain a plurality of first images;
首先,可以采集人脸图像,并对得到的多个图像帧进行灰度化处理,得到多张第一图像。需要说明的是,本实施例中可以采集人脸的近红外图像,采用的近红外摄像头可以具有如下特性:1.可上下45度范围内自动转动;2.波段850nm;3.摄像头周围布设近红外补光灯,摄像头启动,光源打开。First, a face image can be acquired, and the obtained plurality of image frames are subjected to gradation processing to obtain a plurality of first images. It should be noted that, in this embodiment, a near-infrared image of a human face can be collected, and the near-infrared camera can have the following characteristics: 1. Automatic rotation within a range of 45 degrees; 2. Band 850 nm; 3. Near the camera. Infrared fill light, the camera is activated, and the light source is turned on.
因此,可以理解的是,该摄像头以固定的频率或时间间隔对人脸进行连续的拍摄,得到多个图像帧,也即多帧图像。然后对这些图像进行灰度化处理,得到对应的多张第一图像。Therefore, it can be understood that the camera continuously photographs the human face at a fixed frequency or time interval to obtain a plurality of image frames, that is, multi-frame images. These images are then grayed out to obtain a corresponding plurality of first images.
202、对该第一图像进行人脸检测,获取人脸区域;202. Perform face detection on the first image to obtain a face region.
在得到多张第一图像之后,可以对该第一图像进行人脸检测,获取人脸区域。其中,人脸检测的方法有两类:一类是基于机器学习的方法,如基于Haar分类器的人脸检测方法;另一类是基于肤色的检测方法,或是融合上述两种方法;考虑到用户肤色的多样性,自适应阈值较难获取。故本步骤202可以采用OpenCV库的人脸检测算法进行人脸检测,该算法是基于Haar分类器实现的。另外,考虑到OpenCV库的训练样本都是可见光环境下的图像库,本发明可以预先将多幅人脸图像(或具体为人脸的近红外图像)扩充至该Haar分类器中的OpenCV库中作为原始训练样本,重新进行级联训练得到新的数据模型。例如,用70000幅近红外图像扩充原始训练样本,重新进行级联训练得到新的数据模型。重建的数据模型能够较准确的对近红外人脸图像进行人脸区域定位。After obtaining the plurality of first images, the first image may be subjected to face detection to acquire a face region. Among them, there are two types of face detection methods: one is based on machine learning, such as the face detection method based on Haar classifier; the other is based on skin color detection method, or the fusion of the above two methods; Adaptive thresholds are more difficult to obtain due to the diversity of user skin tones. Therefore, in step 202, the face detection algorithm of the OpenCV library can be used for face detection, and the algorithm is implemented based on the Haar classifier. In addition, considering that the training samples of the OpenCV library are all image libraries in a visible light environment, the present invention can expand a plurality of face images (or a near-infrared image specifically for a face) into the OpenCV library in the Haar classifier in advance as The original training samples are re-conducted to obtain a new data model. For example, the original training samples are augmented with 70,000 NIR images, and cascading training is performed to obtain a new data model. The reconstructed data model can accurately locate the face region of the near-infrared face image.
203、获取该人脸区域中的眼部区域图像;203. Acquire an image of an eye region in the face region.
在获取到人脸区域之后,可以获取该人脸区域中的眼部区域图像。其中,获取该人脸区域中的眼部区域图像具体可以包括:After the face area is acquired, an image of the eye area in the face area can be acquired. The acquiring the image of the eye region in the face region may specifically include:
A、获取该人脸区域的两个对角顶点坐标;A. Obtain coordinates of two diagonal vertices of the face region;
B、根据该两个对角顶点坐标以及预设的眼部区域相对位置得到眼部区域图像。 B. Obtain an eye region image according to the coordinates of the two diagonal vertices and the relative position of the preset eye region.
例如,据人脸区域的顶点坐标,通过下面公式(1)计算得双眼所在的矩形区域RI,并对RI进行二值化处理,得到二值化后的眼部区域图像。For example, according to the vertex coordinates of the face region, the rectangular region RI where the two eyes are located is calculated by the following formula (1), and the RI is binarized to obtain the binarized eye region image.
设人脸区域的左上角顶点坐标为(FRleft,FRtop),右下角顶点坐标为(FRright,FRbottom),宽、高分别记为FRwidth,FRheight。由如下公式计算可得双眼所在的矩形区域RI:Let the coordinates of the top left corner of the face area be (FR left , FR top ), the coordinates of the bottom right corner (FR right , FR bottom ), and the width and height be recorded as FR width and FR height respectively . The rectangular area RI where the two eyes are located is calculated by the following formula:
RIleft=FRleft+FRwidth/8RI left =FR left +FR width /8
RItop=FRtop+FRwidth/4RI top =FR top +FR width /4
RIright=FRleft+FRwidth-FRwidth/8     (1)RI right =FR left +FR width -FR width /8 (1)
RIbottom=FRtop+FRheight/2RI bottom =FR top +FR height /2
RI的二值化的初始阈值是通过灰度直方图统计所得,再根据二值图像像素分布调整阈值,可以减少非眼睛区域其他高亮度噪声的干扰。The initial threshold of binarization of RI is obtained by statistic of gray histogram, and then the threshold is adjusted according to the pixel distribution of the binary image, which can reduce the interference of other high-brightness noise in non-eye regions.
204、对该眼部区域图像进行二值化处理;204. Perform binarization processing on the image of the eye region;
在获取该人脸区域中的眼部区域图像之后,可以对该眼部区域图像进行二值化处理,如步骤203中描述。After acquiring the eye region image in the face region, the eye region image may be binarized as described in step 203.
205、计算该眼部区域图像的反光度;205. Calculate a shininess of the image of the eye region;
在对该眼部区域图像进行二值化处理之后,可以计算该眼部区域图像的反光度。可以理解的是,对于二值化图像而言,反光度即由图像上高亮度像素(灰度值为1)的个数反应,因此,步骤205可以具体为:After binarizing the image of the eye region, the illuminance of the image of the eye region can be calculated. It can be understood that, for the binarized image, the shininess is reflected by the number of high-brightness pixels (the gradation value is 1) on the image. Therefore, step 205 can be specifically as follows:
计算该眼部区域图像上所有连通域内包含的高亮度像素的个数之和,该高亮度像素为灰度值为1的像素,其中,高亮度像素个数越多眼镜反光度越高。具体计算公式(2)如下:The sum of the number of high-brightness pixels included in all connected domains on the image of the eye region is calculated, and the high-brightness pixel is a pixel with a gray value of 1, wherein the higher the number of high-brightness pixels, the higher the spectacle of the glasses. The specific calculation formula (2) is as follows:
Figure PCTCN2016081152-appb-000001
Figure PCTCN2016081152-appb-000001
其中Si是第i个连通域内灰度值为1的像素个数和,m是高亮度像素形成的连通域个数。Where S i is the number of pixels whose gradation value is 1 in the i-th connected domain, and m is the number of connected domains formed by high-brightness pixels.
206、判断是否存在任一该第一图像上人脸区域的该反光度大于预设的标准阈值,若是,则执行步骤207,若否,则执行步骤211;206, determining whether there is any vertigo of the face area of the first image is greater than a preset standard threshold, and if so, executing step 207, if not, executing step 211;
在计算该眼部区域图像的反光度之后,可以判断是否存在任一该第一图像上人脸区域的该反光度大于预设的标准阈值,若是,则执行步骤207, 若否,则执行步骤211。After calculating the illuminance of the image of the eye region, it may be determined whether the glare of the face region on any of the first images is greater than a preset standard threshold, and if yes, step 207 is performed. If no, step 211 is performed.
需要说明的是,近红外光源从某一角度照射至镜片会引起强烈反光,形成高亮度连通区域,而任意角度照射在眼睛上不会形成高亮度连通区域。由于采集摄像头是上下转动且补充近红外光的,若戴眼镜,一定存在多个照射角度使得反光度高于某个阈值。依据这一原理,眼镜检测的判断准则为:对间隔采样的多帧(比如五帧)图像,若有一帧图像反光度大于预设的标准阈值则判定为戴眼镜,反之,未戴眼镜。、It should be noted that the near-infrared light source is irradiated from a certain angle to the lens to cause strong reflection, forming a high-luminance connection region, and the illumination at any angle does not form a high-brightness connection region on the eye. Since the acquisition camera is rotated up and down and supplements near-infrared light, if glasses are worn, there must be multiple illumination angles such that the glare is above a certain threshold. According to this principle, the judgment criterion of the glasses detection is: multi-frame (for example, five frames) images sampled at intervals, if one frame of image glare is greater than a preset standard threshold, it is determined to wear glasses, and vice versa, no glasses are worn. ,
承接上述步骤205中的描述可知,若K≥Kδ,则判定为戴眼镜,反之,不戴眼镜。Kδ为眼镜检测阈值(即标准阈值),可通过实验设定。According to the description in the above step 205, if K ≥ K δ , it is determined that glasses are worn, and vice versa, no glasses are worn. K δ is the eyeglass detection threshold (ie, the standard threshold), which can be set experimentally.
207、筛选出该反光度不大于预设的第一反光阈值的该第一图像作为第二图像;207. Filter the first image whose reflection degree is not greater than a preset first reflection threshold as the second image.
若存在任一该第一图像上人脸区域的该反光度大于预设的标准阈值,则可以认为人脸上戴有眼镜,因此,可以筛选出该反光度不大于预设的第一反光阈值的该第一图像作为第二图像。If the illuminance of the face region on any of the first images is greater than a preset standard threshold, the person may be considered to have glasses on the face, and therefore, the glare may be filtered out to be greater than a preset first glare threshold. The first image is taken as the second image.
其中,需要说明的是,本步骤通过反光度筛选获取反光度较低,不影响瞳孔准确定位的图像。由于光源的角度和强度不断变化,故得到的图像帧序列反光度不同。反光度筛选是通过阈值控制图像反光度来实现的:若图像I的反光度K≤δ,则通过筛选转入下一步镜框消除。其中,上述第一反光阈值可以预先计算得出,具体包括:It should be noted that, in this step, the image with low reflectance and accurate positioning of the pupil is obtained by the saliency screening. Since the angle and intensity of the light source are constantly changing, the resulting image frame sequence has different shininess. The saliency screening is achieved by threshold control of the image shininess: if the illuminance of the image I is K ≤ δ, it is removed by screening to the next frame. The first reflective threshold may be calculated in advance, and specifically includes:
A、采集不少于预设数量级的戴眼镜的人脸近红外图像;A. Collecting near-infrared images of faces of glasses that are not less than a predetermined number of glasses;
B、从该人脸近红外图像中筛选出瞳孔定位准确的图像组成标准图像集;B. Screening the accurate image of the pupil from the near-infrared image of the face to form a standard image set;
C、计算该标准图像集中所有图像的反光度;C. Calculating the illuminance of all images in the standard image set;
D、获取该所有图像的反光度的最大值,作为该第一反光阈值。D. Acquire the maximum value of the shininess of all the images as the first reflection threshold.
例如,第一反光阈值δ通过数据实验得到:将采集的10000幅戴眼镜图像I1,…,I10000进行人脸特征点定位算法测试。挑选出瞳孔定位准确的图像集A,利用反光度计算公式计算A中所有图像的反光度K1,…,KN(N≤10000),取最大值为第一反光阈值δ。For example, the first reflection threshold δ is obtained through a data experiment: the collected 10,000 glasses images I 1 , . . . , I 10000 are subjected to a face feature point localization algorithm test. The image set A with accurate pupil positioning is selected, and the reflectances K 1 , . . . , K N (N≤10000) of all the images in A are calculated by the formula of the reflectance, and the maximum value is the first reflection threshold δ.
208、在该第二图像上定位眼镜框的镜框区域;208. Position a frame area of the eyeglass frame on the second image;
在筛选出该反光度不大于预设的第一反光阈值的该第一图像作为第二 图像之后,可以在该第二图像上定位眼镜框的镜框区域。Filtering the first image whose glare is not greater than a preset first reflection threshold as a second After the image, the frame area of the eyeglass frame can be positioned on the second image.
需要说明的是,眼镜框架定位可以采用GVF-Snake方法,通过能量函数控制初始轮廓逐步演化至目标轮廓GI。由于该方法基于区域边缘信息,不依赖图像灰度特征,因此轮廓曲线在演化过程中受噪声和虚假边界的抗性较高,且该方法对初始轮廓不敏感。本步骤的初始轮廓可以采用Canny检测方法得到:对图像进行高斯滤波,在眼镜区域RI使用Canny算子提取眼镜轮廓S0It should be noted that the eyeglass frame positioning can adopt the GVF-Snake method, and the initial contour is gradually evolved to the target contour GI by the energy function. Since the method is based on the region edge information and does not depend on the image gray feature, the contour curve is highly resistant to noise and false boundaries during the evolution process, and the method is not sensitive to the initial contour. The initial contour of this step can be obtained by the Canny detection method: Gaussian filtering is performed on the image, and the eyeglass contour S 0 is extracted using the Canny operator in the eyeglass region RI.
209、修复该第二图像上的该镜框区域,得到消除镜框的目标图像;209. Repair the frame area on the second image to obtain a target image that eliminates the frame.
在该第二图像上定位眼镜框的镜框区域之后,可以修复该第二图像上的该镜框区域,得到消除镜框的目标图像。可以理解的是,眼镜框架区域的消除常用的方法有PCA重建、设定掩码模板处理、特征元补偿、加权平均插值等。其中PCA重建与特征元补偿方法需要大量的戴眼镜人脸数据库与不戴眼镜数据库做模型训练,而实际应用中较难获取此类样本。掩码模板处理方法的模板设定对图像本身依赖性较大,该方法泛化性能不佳。After positioning the frame area of the eyeglass frame on the second image, the frame area on the second image can be repaired to obtain a target image of the frame. It can be understood that the common methods for eliminating the glasses frame area are PCA reconstruction, setting mask template processing, feature element compensation, weighted average interpolation, and the like. Among them, PCA reconstruction and feature element compensation methods require a large number of glasses face database and model database without glasses, but it is difficult to obtain such samples in practical applications. The template setting of the mask template processing method has a large dependence on the image itself, and the generalization performance of the method is not good.
本发明采用加权平均插值的方法,对目标轮廓GI内的像素点P0(x0,y0),用已知像素点的灰度值来估计
Figure PCTCN2016081152-appb-000002
N是窗口内P0邻域像素点总数,G(xi,yi)是窗口内P0邻域像素点的灰度值,ωi为权值。
The invention adopts a weighted average interpolation method to estimate the pixel point P 0 (x 0 , y 0 ) in the target contour GI by using the gray value of the known pixel point.
Figure PCTCN2016081152-appb-000002
N is the total number of P 0 neighborhood pixels in the window, G(x i , y i ) is the gray value of the P 0 neighborhood pixel in the window, and ω i is the weight.
其中,眼镜框架遮挡部分多为皮肤或头发,与其纵向邻域像素的关联度高于横向邻域,故窗口可以采用以待插值点为中心的m×n矩形区域(其中:m<n,如:3×7窗口)。已知像素点与待插值点距离越远,该点的贡献越小,权值越低;已知像素点越偏离窗口长轴方向,该点的贡献越小,权值越低。考虑以上两个方面,请参阅图3,权重的计算公式(3)如下:Wherein, the occlusion portion of the eyeglass frame is mostly skin or hair, and the degree of correlation with the pixels of the vertical neighborhood is higher than that of the horizontal neighborhood, so the window can adopt an m×n rectangular region centered on the point to be interpolated (where: m<n, such as : 3 × 7 windows). It is known that the farther the pixel point is from the point to be interpolated, the smaller the contribution of the point is, the lower the weight is; the more the pixel point deviates from the long axis direction of the window, the smaller the contribution of the point is, the lower the weight is. Consider the above two aspects, please refer to Figure 3, the weight calculation formula (3) is as follows:
Figure PCTCN2016081152-appb-000003
Figure PCTCN2016081152-appb-000003
d是待插值点P0到邻域像素点Pi的欧式距离:
Figure PCTCN2016081152-appb-000004
d is the Euclidean distance from the interpolation point P0 to the neighborhood pixel point P i :
Figure PCTCN2016081152-appb-000004
θ是P0Pi连线与窗口中轴线的夹角。 θ is the angle between the line P 0 P i and the axis of the window.
210、将该目标图像保存至数据库;210. Save the target image to a database;
在得到消除镜框的目标图像之后,可以将该目标图像保存至数据库,以方便使用。After the target image of the frame is removed, the target image can be saved to a database for convenient use.
211、将该第一图像作为目标图像保存至数据库。211. Save the first image as a target image to a database.
若不存在任一该第一图像上人脸区域的该反光度大于预设的标准阈值,则可以认为人脸上没有戴眼镜,该第一图像即为目标图像,保存至数据库中。If the illuminance of the face region on any of the first images does not exceed the preset standard threshold, it can be considered that no glasses are worn on the face of the person, and the first image is the target image and is saved in the database.
本实施例中,利用人脸头像采集可以准确的检测到戴眼镜的人脸图像,通过一个合理的阈值自动过滤镜片反光严重的图片,筛选出反光度较低、不影响瞳孔定位的图片进一步进行镜框消除。经过此装置处理后的戴眼镜人脸图像没有眼镜反光和镜框遮挡的干扰,有效地解决了近红外模式下戴眼镜用户识别效率低甚至无法识别的问题,且算法效率高,占用内存小。基于此采集装置的识别系统用户不需摘除眼镜就可以同等效率完成识别,大大提高了用户使用满意度。In this embodiment, the face image of the wearing face can be accurately detected by using the face avatar acquisition, and the image with serious reflection of the lens is automatically filtered through a reasonable threshold, and the image with low reflection degree and not affecting the pupil positioning is further filtered. The frame is eliminated. The face image of the glasses after treatment by the device has no interference of the glasses reflection and the frame occlusion, and effectively solves the problem that the user recognition efficiency of the glasses in the near-infrared mode is low or even unrecognizable, and the algorithm has high efficiency and small memory consumption. The identification system user based on the collection device can complete the recognition with the same efficiency without removing the glasses, and greatly improves the user satisfaction.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。A person skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the system, the device and the unit described above can refer to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在 一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated in In a unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。 The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that The technical solutions described in the embodiments are modified, or the equivalents of the technical features are replaced by the equivalents of the technical solutions of the embodiments of the present invention.

Claims (10)

  1. 一种人脸识别的眼镜消除方法,其特征在于,包括:A method for eliminating glasses for face recognition, comprising:
    采集人脸图像,并对得到的多个图像帧进行灰度化处理,得到多张第一图像;Collecting a face image, and performing grayscale processing on the obtained plurality of image frames to obtain a plurality of first images;
    对所述第一图像进行人脸检测,获取人脸区域;Performing face detection on the first image to acquire a face region;
    计算所述人脸区域的反光度;Calculating the illuminance of the face region;
    筛选出所述反光度不大于预设的第一反光阈值的所述第一图像作为第二图像;And filtering the first image whose reflection degree is not greater than a preset first reflection threshold as a second image;
    在所述第二图像上定位眼镜框的镜框区域;Positioning a frame area of the eyeglass frame on the second image;
    修复所述第二图像上的所述镜框区域,得到消除镜框的目标图像。Repairing the frame area on the second image to obtain a target image that eliminates the frame.
  2. 根据权利要求1所述的眼镜消除方法,其特征在于,对所述第一图像进行人脸检测,获取人脸区域具体包括:The method for eliminating glasses according to claim 1, wherein performing face detection on the first image, and acquiring the face region specifically includes:
    通过基于Haar分类器对所述第一图像进行人脸检测,获取人脸区域;Obtaining a face region by performing face detection on the first image based on a Haar classifier;
    或,通过基于肤色检测方法对所述第一图像进行人脸检测,获取人脸区域。Or, the face region is acquired by performing face detection on the first image based on the skin color detecting method.
  3. 根据权利要求2所述的眼镜消除方法,其特征在于,在首次执行所述眼镜消除方法时,对所述Haar分类器的数据模型进行更新:The glasses eliminating method according to claim 2, wherein the data model of the Haar classifier is updated when the glasses eliminating method is first executed:
    将多幅人脸图像扩充至所述Haar分类器中的OpenCV库中作为原始训练样本,重新进行级联训练得到新的数据模型。A plurality of face images are expanded into the OpenCV library in the Haar classifier as original training samples, and the cascade training is re-derived to obtain a new data model.
  4. 根据权利要求1所述的眼镜消除方法,其特征在于,在对所述第一图像进行人脸检测,获取人脸区域之后,并且在计算所述人脸区域的反光度之前还包括:The method for eliminating glasses according to claim 1, wherein after performing face detection on the first image, acquiring a face region, and before calculating the illuminance of the face region, the method further comprises:
    获取所述人脸区域中的眼部区域图像;Obtaining an image of an eye region in the face region;
    对所述眼部区域图像进行二值化处理;Performing binarization processing on the image of the eye region;
    所述计算所述人脸区域的反光度具体为:The calculating the illuminance of the face region is specifically:
    计算所述眼部区域图像的反光度。The illuminance of the image of the eye region is calculated.
  5. 根据权利要求4所述的眼镜消除方法,其特征在于,获取所述人脸区域中的眼部区域图像具体包括:The method for eliminating the eyeglasses according to claim 4, wherein the acquiring the image of the eye region in the face region comprises:
    获取所述人脸区域的两个对角顶点坐标;Obtaining two diagonal vertex coordinates of the face region;
    根据所述两个对角顶点坐标以及预设的眼部区域相对位置得到眼部区 域图像。Obtaining an eye region according to the coordinates of the two diagonal vertices and the relative position of the preset eye region Domain image.
  6. 根据权利要求4所述的眼镜消除方法,其特征在于,计算所述眼部区域图像的反光度具体包括:The method for eliminating glasses according to claim 4, wherein calculating the illuminance of the image of the eye region comprises:
    计算所述眼部区域图像上所有连通域内包含的高亮度像素的个数之和,所述高亮度像素为灰度值为1的像素。Calculating a sum of the number of high-brightness pixels included in all connected domains on the image of the eye region, the high-brightness pixel being a pixel having a gray value of 1.
  7. 根据权利要求1所述的眼镜消除方法,其特征在于,在所述第二图像上定位眼镜框的镜框区域具体为:The method for eliminating glasses according to claim 1, wherein the frame area of the eyeglass frame positioned on the second image is specifically:
    通过GVF-Snake方法在所述第二图像上定位出眼镜框的镜框区域。The frame area of the eyeglass frame is positioned on the second image by the GVF-Snake method.
  8. 根据权利要求7所述的眼镜消除方法,其特征在于,修复所述第二图像上的所述镜框区域,得到消除镜框的目标图像具体为:The method for eliminating glasses according to claim 7, wherein the repairing the frame area on the second image to obtain the target image of the frame is specifically:
    通过加权平均差值方法对所述第二图像上的所述镜框区域进行插值修复,得到消除镜框的目标图像。The frame region on the second image is interpolated and repaired by a weighted average difference method to obtain a target image from which the frame is eliminated.
  9. 根据权利要求1所述的眼镜消除方法,其特征在于,计算所述人脸区域的反光度之后以及筛选出所述反光度不大于预设的第一反光阈值的所述第一图像作为第二图像之前还包括:The method for eliminating glasses according to claim 1, wherein after calculating the illuminance of the face region and filtering out the first image whose glare is not greater than a preset first glare threshold as a second The image also includes:
    判断是否存在任一所述第一图像上人脸区域的所述反光度大于预设的标准阈值,若是,则执行筛选出所述反光度不大于预设的第一反光阈值的所述第一图像作为第二图像的步骤。Determining whether the glare of the face region on any of the first images is greater than a preset standard threshold, and if so, performing the screening of the first illuminance that is not greater than a preset first glare threshold The step of the image as the second image.
  10. 根据权利要求1至9中任一项所述的眼镜消除方法,其特征在于,所述第一反光阈值由以下步骤得到:The method for eliminating glasses according to any one of claims 1 to 9, wherein the first reflection threshold is obtained by the following steps:
    采集不少于预设数量级的戴眼镜的人脸图像;Collecting face images of glasses that are not less than a preset number of levels;
    从所述人脸图像中筛选出瞳孔定位准确的图像组成标准图像集;Extracting an image with accurate pupil positioning from the face image to form a standard image set;
    计算所述标准图像集中所有图像的反光度;Calculating the illuminance of all images in the standard image set;
    获取所述所有图像的反光度的最大值,作为所述第一反光阈值。 Obtaining a maximum value of the shininess of all the images as the first reflection threshold.
PCT/CN2016/081152 2015-09-06 2016-05-05 Glasses removal method for facial recognition WO2017036160A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510564190.4 2015-09-06
CN201510564190.4A CN105046250B (en) 2015-09-06 2015-09-06 The glasses removing method of recognition of face

Publications (1)

Publication Number Publication Date
WO2017036160A1 true WO2017036160A1 (en) 2017-03-09

Family

ID=54452779

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/081152 WO2017036160A1 (en) 2015-09-06 2016-05-05 Glasses removal method for facial recognition

Country Status (2)

Country Link
CN (1) CN105046250B (en)
WO (1) WO2017036160A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109670389A (en) * 2017-10-16 2019-04-23 富士通株式会社 The method and apparatus for evaluating the illumination condition in facial image
CN110889454A (en) * 2019-11-29 2020-03-17 上海能塔智能科技有限公司 Model training method and device, emotion recognition method and device, equipment and medium
CN112434659A (en) * 2020-12-07 2021-03-02 深圳市优必选科技股份有限公司 Method and device for rejecting light reflection characteristic points, robot and readable storage medium
US20220292881A1 (en) * 2020-12-22 2022-09-15 Swallow Incubate Co., Ltd. Eye detecting method, eye detecting device, and non-transitory computer-readable recording medium recording eye detecting program
CN116664567A (en) * 2023-07-26 2023-08-29 山东艾迈科思电气有限公司 Solid insulation switch cabinet quality assessment method and system

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046250B (en) * 2015-09-06 2018-04-20 广州广电运通金融电子股份有限公司 The glasses removing method of recognition of face
CN106407912B (en) * 2016-08-31 2019-04-02 腾讯科技(深圳)有限公司 A kind of method and device of face verification
CN106503644B (en) * 2016-10-19 2019-05-28 西安理工大学 Glasses attribute detection method based on edge projection and color characteristic
CN106791433B (en) * 2017-01-18 2018-10-19 维沃移动通信有限公司 A kind of image processing method and electronic equipment
CN107433898B (en) * 2017-08-09 2021-05-25 上海科世达-华阳汽车电器有限公司 Control method of car light orientation, information processing device and system
CN107506708B (en) * 2017-08-14 2021-03-09 Oppo广东移动通信有限公司 Unlocking control method and related product
CN107730457B (en) * 2017-08-28 2020-02-14 广东数相智能科技有限公司 Image completion method and device, electronic equipment and storage medium
CN107844742B (en) * 2017-09-26 2019-01-04 平安科技(深圳)有限公司 Facial image glasses minimizing technology, device and storage medium
CN107945126B (en) * 2017-11-20 2022-02-18 杭州登虹科技有限公司 Method, device and medium for eliminating spectacle frame in image
CN108076290B (en) * 2017-12-20 2021-01-22 维沃移动通信有限公司 Image processing method and mobile terminal
CN110020578A (en) * 2018-01-10 2019-07-16 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN108664908A (en) * 2018-04-27 2018-10-16 深圳爱酷智能科技有限公司 Face identification method, equipment and computer readable storage medium
CN109145875B (en) * 2018-09-28 2021-04-20 深圳市一心视觉科技有限公司 Method and device for removing black frame glasses in face image
CN111582005B (en) * 2019-02-18 2023-08-15 Oppo广东移动通信有限公司 Image processing method, device, computer readable medium and electronic equipment
CN111145334B (en) * 2019-11-14 2022-04-12 清华大学 Three-dimensional reconstruction method and device for face image glasses with glasses
CN113055579B (en) * 2019-12-26 2022-02-01 深圳市万普拉斯科技有限公司 Image processing method and device, electronic equipment and readable storage medium
CN111444770A (en) * 2020-02-26 2020-07-24 北京大米未来科技有限公司 Image processing method, image processing apparatus, electronic device, and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080118113A1 (en) * 2006-11-21 2008-05-22 Jung Sung Uk Method and apparatus for detecting eyes in face region
CN103020579A (en) * 2011-09-22 2013-04-03 上海银晨智能识别科技有限公司 Face recognition method and system, and removing method and device for glasses frame in face image
CN104156700A (en) * 2014-07-26 2014-11-19 佳都新太科技股份有限公司 Face image glass removal method based on mobile shape model and weighted interpolation method
CN105046250A (en) * 2015-09-06 2015-11-11 广州广电运通金融电子股份有限公司 Glasses elimination method for face recognition

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080118113A1 (en) * 2006-11-21 2008-05-22 Jung Sung Uk Method and apparatus for detecting eyes in face region
CN103020579A (en) * 2011-09-22 2013-04-03 上海银晨智能识别科技有限公司 Face recognition method and system, and removing method and device for glasses frame in face image
CN104156700A (en) * 2014-07-26 2014-11-19 佳都新太科技股份有限公司 Face image glass removal method based on mobile shape model and weighted interpolation method
CN105046250A (en) * 2015-09-06 2015-11-11 广州广电运通金融电子股份有限公司 Glasses elimination method for face recognition

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109670389A (en) * 2017-10-16 2019-04-23 富士通株式会社 The method and apparatus for evaluating the illumination condition in facial image
CN109670389B (en) * 2017-10-16 2023-04-07 富士通株式会社 Method and equipment for evaluating illumination condition in face image
CN110889454A (en) * 2019-11-29 2020-03-17 上海能塔智能科技有限公司 Model training method and device, emotion recognition method and device, equipment and medium
CN112434659A (en) * 2020-12-07 2021-03-02 深圳市优必选科技股份有限公司 Method and device for rejecting light reflection characteristic points, robot and readable storage medium
CN112434659B (en) * 2020-12-07 2023-09-05 深圳市优必选科技股份有限公司 Reflection characteristic point eliminating method, device, robot and readable storage medium
US20220292881A1 (en) * 2020-12-22 2022-09-15 Swallow Incubate Co., Ltd. Eye detecting method, eye detecting device, and non-transitory computer-readable recording medium recording eye detecting program
US11961328B2 (en) * 2020-12-22 2024-04-16 Swallow Incubate Co., Ltd. Eye detecting method, eye detecting device, and non-transitory computer-readable recording medium recording eye detecting program
CN116664567A (en) * 2023-07-26 2023-08-29 山东艾迈科思电气有限公司 Solid insulation switch cabinet quality assessment method and system
CN116664567B (en) * 2023-07-26 2023-09-29 山东艾迈科思电气有限公司 Solid insulation switch cabinet quality assessment method and system

Also Published As

Publication number Publication date
CN105046250A (en) 2015-11-11
CN105046250B (en) 2018-04-20

Similar Documents

Publication Publication Date Title
WO2017036160A1 (en) Glasses removal method for facial recognition
US10726260B2 (en) Feature extraction and matching for biometric authentication
US10445574B2 (en) Method and apparatus for iris recognition
Jeong et al. A new iris segmentation method for non-ideal iris images
US9922238B2 (en) Apparatuses, systems, and methods for confirming identity
KR102641115B1 (en) A method and apparatus of image processing for object detection
JP4755202B2 (en) Face feature detection method
Kang et al. Real-time image restoration for iris recognition systems
US8682073B2 (en) Method of pupil segmentation
EP3440593B1 (en) Method and apparatus for iris recognition
JP5064413B2 (en) Method and apparatus for automatically detecting spectacles using nasal muscle mask
EP1394723A2 (en) Method for detecting red-eye effect in digital images
WO2016010724A1 (en) Multispectral eye analysis for identity authentication
WO2016010721A1 (en) Multispectral eye analysis for identity authentication
JP6058089B2 (en) Blink detection method and apparatus
Kennell et al. Binary morphology and local statistics applied to iris segmentation for recognition
CN110807427A (en) Sight tracking method and device, computer equipment and storage medium
Martinikorena et al. Fast and robust ellipse detection algorithm for head-mounted eye tracking systems
CN109840484A (en) A kind of pupil detection method based on edge filter, oval evaluation and pupil verifying
WO2019014814A1 (en) Method for quantitatively detecting forehead wrinkles on human face, and intelligent terminal
WO2022110917A1 (en) Method for determining driving state of driver, computer storage medium, and electronic device
JP2004192552A (en) Eye opening/closing determining apparatus
Kunka et al. Non-intrusive infrared-free eye tracking method
Mahadeo et al. Model-based pupil and iris localization
CN110751064B (en) Blink frequency analysis method and system based on image processing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16840589

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16840589

Country of ref document: EP

Kind code of ref document: A1