An electronic badge attendance monitoring method based on face recognition

By analyzing the connected domain and iris shape features of the glasses area and combining it with color correction in the non-glasses area, the problem of glasses reflection affecting face recognition under different light intensity is solved, thereby improving the accuracy of face recognition and ensuring the accuracy of attendance monitoring.

CN120510639BActive Publication Date: 2025-09-16BEIJING GUOWANG SHENGYUAN INTELLIGENT TERMINAL SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511005495.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-09-16
Estimated Expiration
2045-07-22

AI Technical Summary

Technical Problem

In a brightly lit environment, the accuracy of facial recognition for people wearing glasses is affected by lens reflections, resulting in inaccurate facial feature extraction and affecting the accuracy of attendance monitoring data.

Method used

By analyzing the glasses area in the face image, obtaining the connected domain and identifying the trend mutation edge points, segmenting the suspected iris area, correcting the iris and eye areas, and combining the color of the pixels in the non-glasses area for correction, the corrected face image is obtained for recognition.

Benefits of technology

It effectively reduces the impact of glasses reflection on face recognition, improves the accuracy of face recognition, and ensures the accuracy of attendance monitoring data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120510639B_ABST
    Figure CN120510639B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of face recognition technology, and in particular to a method for monitoring attendance of electronic work badges based on face recognition. The method comprises: obtaining edge trend mutation edge points of a connected domain within the glasses region of a face image, segmenting the edges of the connected domain, and then obtaining a suspected iris connected domain; determining suspected iris regions, and obtaining the iris possibility of each suspected iris region; the suspected iris region with the greatest iris possibility is the iris region; obtaining an eye region based on the uppermost edge segment and the lowermost edge segment of the connected domain adjacent to the iris region; obtaining neighboring pixels of each pixel in the eye region within a non-eye region within the glasses region; correcting each pixel in the eye region based on its neighboring pixel points and the pixel points within the non-glasses region to obtain a corrected eye region, and obtaining a corrected face image; and performing face recognition using the corrected face image. The present application can improve the accuracy of face recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of face recognition, and in particular to an electronic work badge attendance monitoring method based on face recognition. Background Art

[0002] Attendance monitoring is a crucial component of corporate organizational management. It's not only used to monitor employee attendance and calculate performance-based salaries, but also serves as the primary basis for dynamically adjusting work schedules and resource allocation. With the advancement of facial recognition technology, attendance monitoring systems based on facial recognition have gradually become a primary method for attendance management. Compared to manual attendance recording, electronic badge-based attendance monitoring based on facial recognition is more convenient and accurate. Furthermore, it can be used in conjunction with attendance systems to automatically tally employee attendance, significantly improving attendance management efficiency. The accuracy of facial recognition directly impacts the accuracy of attendance monitoring data.

[0003] Traditional facial recognition technology captures facial images, extracts features such as facial features, and then compares them with previously recorded facial images to identify faces with a high degree of similarity. Therefore, the image clarity and recognizability of facial features significantly impact the accuracy of facial recognition. However, when the user performing facial recognition wears glasses in brightly lit environments, reflections may appear on the lenses in the captured image, resulting in poor image clarity at the eye level. This affects the accuracy of facial feature extraction and, consequently, facial recognition. Summary of the Invention

[0004] In order to solve the above technical problems, the purpose of the present invention is to provide an electronic work badge attendance monitoring method based on face recognition, and the technical solutions adopted are as follows:

[0005] An embodiment of the present invention provides a method for monitoring attendance of an electronic work badge based on face recognition, the method comprising:

[0006] Obtain the eyeglasses region in the face image and obtain the connected domain in the eyeglasses region; analyze the changes in the edge points of the connected domain to obtain the trend mutation edge points;

[0007] The edge of the connected domain is segmented using the trend mutation edge points to obtain edge segments; the connected domain is screened according to the fitting curve of the edge points on each edge segment of each connected domain to obtain the suspected iris connected domain;

[0008] Determine a suspected iris region based on the edges of adjacent suspected iris connected domains; obtain the iris possibility of a suspected iris region based on the uppermost edge segment and the lowermost edge segment of a connected domain adjacent to a suspected iris region; the suspected iris region with the greatest iris possibility is the iris region;

[0009] The eye region is obtained based on the uppermost edge segment and the lowermost edge segment of the connected domain adjacent to the iris region; and the neighboring pixel points of each pixel point in the eye region are obtained in the non-eye region of the glasses region.

[0010] Based on the neighboring pixels of each pixel in the eye area and the pixels in the non-glasses area, each pixel in the eye area is corrected to obtain a corrected eye area, and a corrected face image is obtained; and face recognition is performed using the corrected face image.

[0011] Preferably, analyzing the changes in the edge points of the connected domain to obtain trend mutation edge points includes:

[0012] An equal number of adjacent edge points are obtained on both sides of an edge point on the edge of a connected domain, and are recorded as the adjacent edge points of the edge point; based on the coordinates of the edge point and the adjacent edge points of the edge point, a fitting curve is obtained using the least squares method; a tangent to the fitting curve is made through the position of the edge point on the fitting curve to obtain the tangent corresponding to the edge point; the angle between the tangent corresponding to the edge point and the horizontal axis of the rectangular coordinate system is the tangent angle corresponding to the edge point; the absolute value of the difference between the tangent angle corresponding to the edge point and the tangent angle corresponding to the edge points adjacent to it on the left and right is calculated respectively, and recorded as the left adjacent angle difference and the right adjacent angle difference; the absolute value of the difference between the right adjacent angle difference and the left adjacent angle difference is calculated and normalized to obtain the trend mutation possibility of the edge point; when the trend mutation possibility of the edge point is greater than the first preset threshold, the edge point is a trend mutation edge point.

[0013] Preferably, the connected domains are screened according to the fitting curves of the edge points on each edge segment of each connected domain to obtain the suspected iris connected domains, including:

[0014] A fitting curve corresponding to a connected domain is obtained by least squares circular fitting based on the coordinates of each edge point in an edge segment on the edge of the connected domain, and the variance of the residual between the coordinate values ​​of each edge point in the edge segment and the corresponding coordinate values ​​on the fitting curve corresponding to the edge segment is calculated, which is recorded as the residual variance corresponding to the edge segment; the minimum value of the residual variance corresponding to each edge segment on the edge of the connected domain is inverted by the sum of the first preset value to obtain the suspected iris possibility of the connected domain; if the suspected iris possibility of the connected domain is greater than a second preset threshold, the connected domain is considered to be a suspected iris connected domain.

[0015] Preferably, determining the suspected iris region based on the edges of adjacent suspected iris connected domains includes:

[0016] A first fitting curve is obtained by least squares circle fitting based on the edge points on the edge segment with the smallest residual variance on the edge of each suspected iris connected domain in adjacent suspected iris connected domains. The residual variance corresponding to the adjacent suspected iris connected domains is obtained according to the first fitting curve; if the residual variance corresponding to the adjacent suspected iris connected domains is less than a third preset threshold, the adjacent suspected iris connected domains are merged to obtain a suspected iris area.

[0017] Preferably, obtaining the iris possibility of a suspected iris region based on the uppermost edge segment and the lowermost edge segment of a connected domain adjacent to the suspected iris region includes:

[0018] Obtain a trend mutation edge point on the edge of a suspected iris region, and use the trend mutation edge point on the edge of the suspected iris region to segment the edge of the suspected iris region to obtain edge segments, with the edge segment at the uppermost end being the uppermost edge segment and the edge segment at the lowermost end being the lowermost edge segment; similarly, obtain the uppermost edge segments and lowermost edge segments of other connected domains;

[0019] Obtain different connected domains adjacent to the suspected iris region and whose uppermost edge segments are connected to the uppermost edge segments of the suspected iris region, forming an upper feature connected domain set corresponding to the suspected iris region; obtain different connected domains adjacent to the suspected iris region and whose lowermost edge segments are connected to the lowermost edge segments of the suspected iris region, forming a lower feature connected domain set corresponding to the suspected iris region;

[0020] The iris possibility of the suspected iris area is obtained according to the uppermost edge segment, the lowermost edge segment of the suspected iris area and the uppermost edge segment of the connected domain in the upper feature connected domain set and the lowermost edge segment of the connected domain in the lower feature connected domain set.

[0021] Preferably, obtaining the iris possibility of the suspected iris region based on the uppermost edge segment and the lowermost edge segment of the suspected iris region and the uppermost edge segment of the connected domain in the upper feature connected domain set and the lowermost edge segment of the connected domain in the lower feature connected domain set corresponding thereto includes:

[0022] Obtain the absolute value of the difference in slopes corresponding to every two adjacent edge points in an uppermost edge segment, and average them to obtain the average slope change rate of the uppermost edge segment. Similarly, obtain the average slope change rate of the lowermost edge segment.

[0023] Calculate the absolute value of the difference between the uppermost edge segment of the suspected iris area and the average value of the slope change rate of the uppermost edge segment of a connected domain in its corresponding upper feature connected domain set, add the absolute value of the difference to the hyperparameter and invert it to obtain the slope change rate similarity value corresponding to the uppermost edge segment of the connected domain in the upper feature connected domain set, and the sum of the slope change rate similarity values ​​corresponding to the uppermost edge segments of all connected domains in the upper feature connected domain set is the upper slope change similarity; similarly, obtain the lower slope change similarity based on the lowermost edge segment of the suspected iris area and the lowermost edge segments of each connected domain in its corresponding lower feature connected domain set; add the upper slope change similarity and the lower slope change similarity and normalize them to obtain the iris possibility of the suspected iris area.

[0024] Preferably, acquiring the eye region based on the uppermost edge segment and the lowermost edge segment of the connected domain adjacent to the iris region includes:

[0025] Obtain different connected domains adjacent to the iris region and whose uppermost edge segments are connected to the uppermost edge segment of the iris region to form an upper feature connected domain set corresponding to the iris region, calculate the slope change rate similarity value corresponding to the uppermost edge segment of each connected domain in the upper feature connected domain set corresponding to the iris region in combination with the uppermost edge segment of the iris region, obtain the uppermost edge segment of the connected domain corresponding to the slope change rate similarity value with the largest value and greater than the third judgment threshold as the first uppermost edge segment to be merged, merge the first uppermost edge segment to be merged with the uppermost edge segment of the iris region to form a first merged region; obtain the upper feature connected domain set corresponding to the first merged region, and combine the uppermost edge segment of the first merged region with the uppermost edge segment of the first merged region. The uppermost edge segment calculates the slope change rate similarity value corresponding to the uppermost edge segment of each connected domain in the upper feature connected domain set corresponding to the first merged area, obtains the uppermost edge segment of the connected domain corresponding to the slope change rate similarity value with the largest value and greater than the third judgment threshold, and takes it as the second uppermost edge segment to be merged. The second uppermost edge segment to be merged is merged with the uppermost edge segment of the first merged area to form a second merged area, and so on, until there is no slope change rate similarity value corresponding to the uppermost edge segment of the connected domain that meets the third judgment threshold, and the merging is stopped; the same operation is performed on the lowermost edge segment of the area obtained after the merging is stopped, combined with the uppermost edges of other connected domains, to obtain the eye area.

[0026] Preferably, obtaining neighboring pixel points of each pixel point in the eye area in the non-eye area in the glasses area includes:

[0027] Calculate the distance between a pixel point in the eye area and each pixel point in the non-eye area in the glasses area, and take a preset number of pixels in the non-eye area in the glasses area with the smallest distance as the neighboring pixels of the pixel point in the eye area.

[0028] Preferably, correcting each pixel in the eye area based on neighboring pixels of each pixel in the eye area and pixels in the non-glasses area to obtain a corrected eye area, and obtaining a corrected face image, includes:

[0029] Calculate the average values ​​of the R, G, and B channels of all pixels in the non-glasses area of ​​the face, and record them as the R channel skin standard value, the G channel skin standard value, and the B channel skin standard value;

[0030] Calculate the average value of the difference between the R channel values ​​of all neighboring pixels of a pixel in the eye area and the R channel skin standard value, and record it as the R channel value deviation degree of the pixel in the eye area; similarly, obtain the G channel value deviation degree and the B channel value deviation degree of the pixel in the eye area; subtract the R channel value, G channel value and B channel value of the pixel in the eye area from the R channel value deviation degree, G channel value deviation degree and B channel value deviation degree respectively to obtain the corrected R channel value, G channel value and B channel value; similarly, correct all pixels in the eye area to obtain the corrected eye area, and then replace the R channel value, G channel value and B channel value of each pixel in the non-eye area within the eye area with the R channel skin standard value, G channel skin standard value and B channel skin standard value respectively to obtain the corrected face image.

[0031] Embodiments of the present invention have at least the following beneficial effects: The present application obtains connected domains within the eyeglasses region of a facial image, analyzes changes in edge points of each connected domain to obtain trend mutation edge points, divides the edges of the connected domains to obtain edge segments, and analyzes the edge segments to obtain suspected iris connected domains. A suspected iris region is determined based on the edges of adjacent suspected iris connected domains. The iris likelihood of the suspected iris region is calculated to obtain an iris region. An eye region is obtained based on the uppermost and lowermost edge segments of connected domains adjacent to the iris region. The degree of eye feature expression of each portion is analyzed sequentially based on the shape characteristics of the iris and the contour of the eye, thereby identifying the complete eye region and effectively reducing the impact of eyeglass reflection on facial recognition accuracy. Finally, each pixel in the eye region is corrected based on its neighboring pixels and pixels in the non-eyeglasses region to obtain a corrected eye region and a corrected facial image. The color of the pixels in the eye region is corrected based on the difference between the color of the pixels in the non-eyeglasses region and the color of the pixels in the eyeglasses region, providing sufficient information for facial recognition and improving the accuracy of facial recognition results. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0033] Figure 1 A flowchart of a method for monitoring electronic work badge attendance based on face recognition provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] To further illustrate the technical means and effectiveness of the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail the specific implementation, structure, features, and effectiveness of an electronic work badge attendance monitoring method based on facial recognition proposed by the present invention. In the following description, different references to "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.

[0035] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0036] The following describes in detail a specific solution of an electronic work badge attendance monitoring method based on face recognition provided by the present invention with reference to the accompanying drawings.

[0037] Example:

[0038] The main application scenarios of this invention are: This application identifies eye pixels in the glasses area based on eye shape features, and performs color correction on the pixels in the glasses area in the face image to reduce the impact of glasses reflection on the accuracy of face recognition.

[0039] See also Figure 1 , which shows a method flow chart of a method for monitoring attendance of an electronic work badge based on face recognition provided by an embodiment of the present invention, the method comprising the following steps:

[0040] Step S1, obtaining the eyeglasses region in the face image and obtaining a connected domain in the eyeglasses region; analyzing the changes in the edge points of the connected domain to obtain trend mutation edge points.

[0041] Employees are required to use electronic ID cards to record their attendance through facial recognition when arriving at or leaving their workstations. The electronic ID card captures facial images through the camera above it when the employee punches in.

[0042] To prevent background interference in facial recognition, a convolutional neural network is used to detect the coordinates of the pixels along the facial boundary in the image. This is then used to crop the facial region. A glasses detection model (e.g., a YOLOv5 model trained on an eye database) is then used to identify the glasses region within the cropped image. If the person in the image is not wearing glasses, facial recognition is performed directly. This allows the glasses region to be determined within the facial image. The technology for identifying the glasses region is currently available and will not be elaborated upon here.

[0043] Because face recognition primarily extracts features from the facial features for comparative recognition, this application primarily aims to reduce the interference of reflections in the eye area of ​​an image. The appearance of reflections from glasses depends on a variety of factors, including light intensity and distribution, the material and prescription of the glasses, and the camera's position and angle. Therefore, the appearance of lens reflections varies from image to image, making it difficult to directly determine the impact of the reflections from the glasses on the face area in the current image. Since glasses lenses are typically transparent, the color of the pixels in the reflective area in the captured image is the result of the superposition of the real face and the lens reflections. Therefore, the glasses area is divided into multiple sections based on the pixel colors. Because the iris shape in glasses is highly regular, the probability of each section being a suspected iris region is first calculated based on its shape characteristics. Because the reflection image on the lens is highly random, depending on the object being photographed, some sections of the reflection image may also have iris-like features. To avoid misidentifying these sections as iris sections, the true iris region is further determined based on the degree of conformity between the edge shape of the suspected iris region and that of adjacent regions relative to the edge of the eye. Because the non-glasses area is not affected by reflections and can reflect the true skin color of the face, etc., the pixel color of the glasses area is corrected based on the difference between the pixel color of the non-glasses area and the pixel color of the non-eye part of the glasses area.

[0044] Because the color of pixels in the eyeglass area is a combination of the real face color and the color reflected from the lens, and because the color within each area of ​​the face is relatively consistent in the captured image, such as the skin color and iris color being roughly the same across different parts of the face, pixels with the same color within the eyeglass area are grouped together. Each part contains both information about the lens reflection and the characteristics of the real face. Because the shape of the human eye and iris are distinct, the iris area within the eyeglass area is determined by how closely each part matches the shape of the eye and iris.

[0045] First, adjacent pixels with the same color within the glasses area are grouped together. Because areas with strong reflections tend to have higher brightness overall, the threshold for evaluating pixel color consistency should be set appropriately to accurately segment the eye area. Instead, adjacent pixels with a grayscale difference of 3 or less are considered to be part of the same connected domain. This divides the pixels within the glasses area into multiple connected domains. Because the glasses area includes the eye area, the connected domains surrounding the glasses' edges are not analyzed in the following connected domain shape analysis.

[0046] Because the shape of the iris is basically circular and regular, we first analyze the degree of conformity of the obtained connected domain shape with respect to the iris shape. Due to the different degrees of eye opening, the upper and lower parts of the iris may not appear complete in the image, that is, the upper and lower parts may not have circular features, while the left and right sides are more regular arcs. Moreover, under the influence of reflection, the iris may be divided into multiple pieces. Therefore, the shape of the connected domain belonging to the iris area may not be a complete circle, but a part of the edge has an arc-shaped feature. Therefore, the position of an edge point on the edge of the connected domain is used as the tangent of the curve formed by the current edge segment. Specifically, an equal number of adjacent edges are obtained on both sides of an edge point on the edge of the connected domain. Points are recorded as the adjacent edge points of the edge point. Based on the coordinates of the edge point and the adjacent edge points of the edge point, the least square method is used to obtain the fitting curve, which is the curve corresponding to the current edge segment. Then, the tangent of the fitting curve is made through the position of the edge point on the fitting curve to obtain the tangent corresponding to the edge point. The angle formed by the tangent and the horizontal axis of the rectangular coordinate system (x-axis) gradually changes at a fixed rate of change. The angle formed by the tangent and the horizontal axis of the rectangular coordinate system is the tangent angle corresponding to the edge point. The number of adjacent edge points can be two on each side, and the implementer can adjust it according to the actual situation. Therefore, the difference in the tangent angles between adjacent edge points is calculated. , It represents the absolute value of the difference between the tangent angle corresponding to the i-th edge point and the tangent angle corresponding to the i+1-th edge point. Based on the consistency of the tangent angle difference between adjacent pixels, the possibility of each edge point being the pixel point at the position where the edge change trend abruptly changes is calculated.

[0047] Specifically, the absolute value of the difference between the tangent angle corresponding to an edge point on the edge and the tangent angle corresponding to its left and right adjacent edge points is obtained respectively, which are recorded as the left adjacent angle difference and the right adjacent angle difference; the absolute value of the difference between the right adjacent angle difference and the left adjacent angle difference is calculated and normalized to obtain the possibility of trend mutation of the edge point.

[0048] The calculation model for the possibility of trend mutation is as follows:

[0049] ,

[0050] in, It represents the possibility of a sudden change in the trend of the i-th edge point on the edge of the u-th connected domain, that is, the possibility that the edge point is the pixel point at the position where the edge change trend changes suddenly; norm represents the normalization operation; It represents the absolute value of the difference between the tangent angle corresponding to the i-th edge point and the tangent angle corresponding to the i+1-th edge point, that is, the difference in the adjacent angles on the right side corresponding to the i-th edge point; Indicates the difference in the adjacent angle on the left side corresponding to the i-th edge point; It indicates the difference in the rate of change of the tangent angles on both sides of the i-th edge point. The larger the absolute value of the difference, the more it indicates that the edge change trend at that position has changed, that is, the edge point is the pixel point where the edge change trend suddenly changes.

[0051] The outline of the eye in the image is relatively smooth, and the reflection in the image is related to the object in front of the employee when the image was taken. Because the electronic work badge is mainly used to display employee work information when the salesperson is working, the environment in which the employee is located when the image was taken is relatively simple, that is, the edge of the reflective image is also relatively smooth. Therefore, the position where the edge change trend changes is different from other positions. The values ​​differ greatly, so here it is stipulated that When the value is greater than the first preset threshold, the edge point is considered to be a pixel point at which the edge change trend abruptly changes, that is, a trend abrupt edge point. The first preset threshold value is set as a reference value of 0.5. In this way, the trend abrupt edge points on the edge of each connected domain can be obtained.

[0052] Step S2: segmenting the edge of the connected domain using the trend mutation edge points to obtain edge segments; screening the connected domains according to the fitting curves of the edge points on each edge segment of each connected domain to obtain the suspected iris connected domain.

[0053] The above steps obtain the trend mutation edge points on the edge of each connected domain, and use them to divide the edges of each connected domain into edge segments.

[0054] Furthermore, for an edge segment of an edge of a connected region, it is necessary to determine its similarity to the edge of the iris region based on its shape feature, that is, its near-circularity.

[0055] Specifically, for an edge segment of an edge of a connected domain, a fitting curve corresponding to the edge segment is obtained by least squares circle fitting according to the coordinates of each edge point in an edge segment on the edge of the connected domain, and the variance of the residuals between the coordinate values ​​of each edge point in the edge segment and the corresponding coordinate values ​​on the fitting curve corresponding to the edge segment is calculated, and recorded as the residual variance corresponding to the edge segment; the minimum value of the residual variances corresponding to the edge segments on the edge of the connected domain and the sum of the first preset value are inverted to obtain the suspected iris possibility of the connected domain.

[0056] The calculation model of the possibility of suspected iris is as follows:

[0057] ,

[0058] in, represents the suspected iris possibility of the u-th connected domain, that is, the possibility that the connected domain is an iris area in shape; Represents the residual variance of the dth edge segment on the edge of the uth connected domain, min represents the minimum operation; 1 represents the first preset value; The smaller the minimum value of the residual variance is, the more likely it is the iris area. To ensure that the fraction is meaningful, and .

[0059] Because when the edge is regular and close to a circular arc, The value is usually less than 1, so when When the value is greater than the second preset threshold of 0.5, the connected domain is considered to be a suspected iris connected domain. Thus, the suspected iris connected domains can be screened out from the connected domains.

[0060] Step S3: Determine a suspected iris region based on the edges of adjacent suspected iris connected domains; obtain the iris possibility of the suspected iris region based on the uppermost edge segment and the lowermost edge segment of the connected domain adjacent to the suspected iris region; the suspected iris region with the highest iris possibility is the iris region.

[0061] The above steps obtain the suspected iris connected domain in the connected domain, and then it is necessary to merge the adjacent suspected iris connected domains to obtain the suspected iris area.

[0062] Specifically, a first fitting curve is obtained by least squares circle fitting based on the edge points on the edge segment with the smallest residual variance on the edge of each suspected iris connected domain in adjacent suspected iris connected domains, and the residual variance corresponding to the adjacent suspected iris connected domains is obtained according to the first fitting curve; if the residual variance corresponding to the adjacent suspected iris connected domains is less than a third preset threshold, the adjacent suspected iris connected domains are merged to obtain a suspected iris area.

[0063] It should be noted that the adjacent suspected iris connected domains here refer to the suspected iris connected domains with common edge points. The analysis is performed on several adjacent suspected iris connected domains as a unit, that is, if several adjacent suspected iris connected domains do not have other adjacent suspected iris connected domains and meet the above conditions, then these adjacent suspected iris connected domains are merged into a suspected iris area; the third preset value is 1, because when the degree of fitting is good, most of the values ​​of the residual variance will fall between 0 and 1.

[0064] If there are similar circular objects in the environment, they may also be identified as suspected iris areas, so further differentiation is required in combination with the shape of the eye outline. Because the upper and lower edges of the iris in the image are obscured by the eye outline, the shape of the upper and lower edges is the shape of the eye outline.

[0065] Therefore, it is necessary to obtain the uppermost edge segment and the lowermost edge segment of the suspected iris area. Specifically, the trend mutation edge point in the edge of the suspected iris area is obtained, and the trend mutation edge point in the edge of the suspected iris area is used to segment the edge of the suspected iris area to obtain edge segments. The edge segment located at the uppermost end is the uppermost edge segment, and the edge segment located at the lowermost end is the lowermost edge segment. Furthermore, it is also necessary to obtain the uppermost edge segment and the lowermost edge segment of other connected domains. Different connected domains adjacent to a suspected iris area and connected with the uppermost edge segment of the suspected iris area are obtained to form the upper feature connected domain set corresponding to the suspected iris area. Different connected domains adjacent to a suspected iris area and connected with the lowermost edge segment of the suspected iris area are obtained to form the lower feature connected domain set corresponding to the suspected iris area.

[0066] Furthermore, the absolute value of the difference in slopes corresponding to every two adjacent edge points in an uppermost edge segment is obtained, and the average value is calculated to obtain the average slope change rate of the uppermost edge segment. Similarly, the average slope change rate of the lowermost edge segment is obtained. The possibility that a suspected iris area belongs to the eye area is calculated based on the similarity between the slope change rates of the uppermost edge or the lowermost edge of the connected domain in the upper feature connected domain set and the lower feature connected domain set corresponding to the suspected iris area and the uppermost edge or the lowermost edge of the suspected iris area. If a suspected iris area does not have an adjacent connected domain, it is considered that the suspected iris area is not a real iris area.

[0067] Finally, the iris possibility of a suspected iris region is obtained based on the uppermost edge segment, the lowermost edge segment of a suspected iris region and its corresponding uppermost edge segment of the connected domain in the upper feature connected domain set and the lowermost edge segment of the connected domain in the lower feature connected domain set.

[0068] Specifically, the absolute value of the difference between the uppermost edge segment of a suspected iris area and the average value of the slope change rate of the uppermost edge segment of a connected domain in its corresponding upper feature connected domain set is calculated, the absolute value of the difference is added to the hyperparameter and the result is inverted to obtain the slope change rate similarity value corresponding to the uppermost edge segment of the connected domain in the upper feature connected domain set, and the sum of the slope change rate similarity values ​​corresponding to the uppermost edge segments of all connected domains in the upper feature connected domain set is the upper slope change similarity; similarly, the lower slope change similarity is obtained based on the lowermost edge segment of the suspected iris area and the lowermost edge segments of each connected domain in its corresponding lower feature connected domain set; the upper slope change similarity and the lower slope change similarity are added and normalized to obtain the iris possibility of the suspected iris area.

[0069] The calculation model of the iris possibility of the suspected iris area is specifically as follows:

[0070] ,

[0071] in, represents the iris possibility of the w-th suspected iris region, that is, the possibility that the w-th suspected iris region is the real iris region; It represents the number of connected domains in the upper feature connected domain set corresponding to the w-th suspected iris region, or the number of uppermost edge segments of the connected domain in the upper feature connected domain set; represents the average slope change rate of the uppermost edge segment of the wth suspected iris region, It represents the average slope change rate of the uppermost edge segment of the cth connected domain in the upper feature connected domain set corresponding to the wth suspected iris region, The similarity value of the slope change rate corresponding to the uppermost edge segment of the c-th connected domain is represented. The closer the slope change rates are, the more likely the two edges are to have the same change characteristics, that is, they are more likely to be the edges of the upper eye contour. ε is a hyperparameter used to ensure that the fraction is meaningful. Here, ε=0.01.

[0072] represents the number of connected domains in the lower feature connected domain set corresponding to the w-th suspected iris region, represents the average slope change rate of the lowest edge segment of the w-th suspected iris region, represents the average slope change rate of the lowest edge segment of the cth connected domain in the lower feature connected domain set corresponding to the wth suspected iris region; norm represents the normalization function, is the similarity of the upper slope change, is the similarity of the lower slope change. Generally, and The value of is 2.

[0073] Thus, the iris probability of each suspected iris area can be obtained. The greater the iris probability, the more likely the corresponding suspected iris area is to be the real iris area. Because there is only one iris in a lens area, it is considered that The suspected iris area corresponding to the maximum value is the real eye iris area, that is, the iris area.

[0074] Step S4: obtaining the eye region based on the uppermost edge segment and the lowermost edge segment of the connected domain adjacent to the iris region; and obtaining neighboring pixel points of each pixel point in the eye region in the non-eye region of the glasses region.

[0075] In step S3, the iris region is acquired. Because the upper and lower ends of the iris region are obscured by the eye contour, the shape of the upper and lower iris edge segments resembles the eye contour. The eye contour changes smoothly, as shown above, with relatively consistent slope changes at different locations. Therefore, based on the slope change rates of the upper and lower iris edge segments, the likelihood of other connected domain edges being eye contour edges is analyzed, and the complete eye region is thus obtained.

[0076] Based on the similarity between the slope change rate of the top (or bottom) edge segment of a connected domain adjacent to the iris region and the slope change rate of the top (or bottom) edge segment of the iris region, the likelihood that the corresponding edge segment is the edge of the eye outline is calculated. Because connected domains are interconnected and the eye and skin have a significant color difference, they will be segmented into different connected domains. Therefore, to avoid the influence of the skin region, the adjacent connected domains here refer only to those connected to the corresponding edge segments (that is, when analyzing the similarity of the slope change rate with the top edge segment of the iris region, the top edge segment of the adjacent connected domain must be connected to the top edge segment of the iris region, and the similarity here refers to the similarity between the top edge segments).

[0077] Specifically, different connected domains adjacent to the iris region and whose uppermost edge segments are connected to the uppermost edge segment of the iris region are obtained to form an upper feature connected domain set corresponding to the iris region. The uppermost edge segment of the iris region is combined with the uppermost edge segment of the iris region to calculate the slope change rate similarity value corresponding to the uppermost edge segment of each connected domain in the upper feature connected domain set corresponding to the iris region. The uppermost edge segment of the connected domain corresponding to the slope change rate similarity value having the largest value and greater than the third judgment threshold is obtained as the first uppermost edge segment to be merged. The first uppermost edge segment to be merged is merged with the uppermost edge segment of the iris region to form a first merged region. The upper feature connected domain set corresponding to the first merged region is obtained, and the uppermost edge segment of the iris region is combined with the uppermost edge segment of the iris region to form a first merged region. The uppermost edge segment of the domain calculates the slope change rate similarity value corresponding to the uppermost edge segment of each connected domain in the upper feature connected domain set corresponding to the first merged area, obtains the uppermost edge segment of the connected domain corresponding to the slope change rate similarity value with the largest value and greater than the third judgment threshold, and takes it as the second uppermost edge segment to be merged. The second uppermost edge segment to be merged is merged with the uppermost edge segment of the first merged area to form a second merged area, and so on, until the slope change rate similarity value corresponding to no uppermost edge segment of the connected domain satisfies the third judgment threshold, and the merging is stopped; the same operation is performed on the lowermost edge segment of the area obtained after the merging is stopped, combined with the uppermost edges of other connected domains, to obtain the eye area.

[0078] It should be noted that the calculation method for the slope change rate similarity value is the same as the calculation method for the slope change rate similarity value described above, with only the objects involved in the calculation being different, and the method for obtaining the topmost and bottommost edge segments being the same. Here, the topmost and bottommost edge segments in the connected domain that may be the eye contour edge are screened based on the slope change rate similarity value. The topmost and bottommost edge segments of the connected domain adjacent to the iris region are then merged to obtain the contour edge of the eye region. The topmost or bottommost edge segment of the connected domain corresponding to the slope change rate similarity value with the largest value that is greater than the third judgment threshold is the eye contour edge. Merging the topmost or bottommost edge segments first has no effect on the result, and the two methods can be performed in that order.

[0079] Because eye color is an important facial feature, after obtaining the eye region, the color of the eye pixel points must be corrected. The color of the reflection is usually related to the characteristics of the lens and the intensity of the reflection. Therefore, the color of the eye pixel points is corrected based on the color difference between the non-eye area (i.e., the skin area) within the eye area and the skin area outside the eye area.

[0080] Under normal circumstances, the skin color of different parts of the face is relatively uniform and consistent, so the average value of the RGB three-channel values ​​of all pixels in the non-glasses area of ​​the face is calculated. 、 、 , as the standard value of the current facial skin, recorded as the R channel skin standard value, the G channel skin standard value and the B channel skin standard value. Because there may be some highlights in the reflection, the reflectivity of the entire mirror is not the same. When analyzing the color deviation of the eye pixels, the analysis can be based on the difference between the color of the pixels in the non-eye area of ​​the glasses area that are closer to the pixels in the eye area and the skin standard value.

[0081] Therefore, it is necessary to obtain the neighboring pixels of each pixel in the eye region within the non-eye region of the glasses. Specifically, the distance between a pixel in the eye region and each pixel in the non-eye region of the glasses region is calculated. A preset number of pixels in the non-eye region of the glasses region with the smallest distance are selected as the neighboring pixels of the pixel in the eye region. The preset number is set to 10, and the implementer can adjust it according to actual conditions. In this way, the neighboring pixels are obtained and the pixel in the eye region is corrected.

[0082] Step S5, correcting each pixel in the eye area based on its neighboring pixels and pixels in the non-glasses area to obtain a corrected eye area, and obtaining a corrected face image; and performing face recognition using the corrected face image.

[0083] After obtaining the neighboring pixel points of each pixel point in the eye area, each pixel point in the eye area is corrected based on the neighboring pixel points of each pixel point in the eye area and the pixel points in the non-glasses area to obtain a corrected eye area and a corrected face image.

[0084] Specifically, the average value of the difference between the R channel value of all neighboring pixels of a pixel in the eye area and the R channel skin standard value is calculated, and recorded as the R channel value deviation degree of the pixel in the eye area; similarly, the G channel value deviation degree and the B channel value deviation degree of the pixel in the eye area are obtained; the R channel value, G channel value and B channel value of the pixel in the eye area are subtracted from the R channel value deviation degree, G channel value deviation degree and B channel value deviation degree respectively to obtain the corrected R channel value, G channel value and B channel value; similarly, all pixels in the eye area are corrected to obtain the corrected eye area.

[0085] Taking the R channel as an example, the calculation model of the R channel value deviation degree is as follows:

[0086] ,

[0087] in, Indicates the degree of deviation of the R channel value of the qth pixel representing the eye in the eye area, Indicates the number of neighboring pixels of the qth pixel in the eye area, with a reference value of 10. Represents the R channel value of the jth neighboring pixel among the neighboring pixels of the qth pixel; The R channel skin standard value of the current face skin color can be used to correct the pixels in the eye area.

[0088] Then, the R channel value, G channel value and B channel value of each pixel point in the non-eye area of ​​the glasses area are replaced with the R channel skin standard value, G channel skin standard value and B channel skin standard value respectively, thereby obtaining the corrected face image.

[0089] Finally, using the existing face detection model, a convolutional neural network (CNN) is used to extract facial features from the corrected face image and compare them with the facial information features entered into the database for face recognition. When the facial features in the corrected image match the feature information in the database, face recognition is completed, the employee's attendance is marked, and the relevant information of the identified employee is displayed on the electronic work badge.

[0090] In summary, the present application identifies the glasses area in the captured facial image, divides it into multiple parts according to the color characteristics of the pixels in the glasses area, calculates the possibility that each part is an eye according to the conformity of the shape characteristics of each part with the shape of the eye, obtains the complete eye area, and corrects the color of the pixels in the glasses area in combination with the color of the skin pixels in the non-glasses area to reduce the interference of lens reflections on facial feature extraction and improve the accuracy of face recognition.

[0091] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. Furthermore, the foregoing descriptions of specific embodiments of this specification are provided. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential sequence shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0092] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

[0093] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for monitoring attendance of electronic work badges based on face recognition, characterized in that: The method includes: Obtain the eyeglasses region in the face image and obtain the connected domain in the eyeglasses region; analyze the changes in the edge points of the connected domain to obtain the trend mutation edge points; The edge of the connected domain is segmented using the trend mutation edge points to obtain edge segments; the connected domain is screened according to the fitting curve of the edge points on each edge segment of each connected domain to obtain the suspected iris connected domain; Determine a suspected iris region based on the edges of adjacent suspected iris connected domains; obtain the iris possibility of a suspected iris region based on the uppermost edge segment and the lowermost edge segment of a connected domain adjacent to a suspected iris region; the suspected iris region with the greatest iris possibility is the iris region; The eye region is obtained based on the uppermost edge segment and the lowermost edge segment of the connected domain adjacent to the iris region; and the neighboring pixel points of each pixel point in the eye region are obtained in the non-eye region of the glasses region. Based on the neighboring pixels of each pixel in the eye area and the pixels in the non-glasses area, each pixel in the eye area is corrected to obtain a corrected eye area, and a corrected face image is obtained; and face recognition is performed using the corrected face image.

2. The method for monitoring attendance of electronic work badges based on face recognition according to claim 1, characterized in that: The analysis of the change of the edge points of the connected domain to obtain the trend mutation edge points includes: An equal number of adjacent edge points are obtained on both sides of an edge point on the edge of a connected domain, and are recorded as the adjacent edge points of the edge point; based on the coordinates of the edge point and the adjacent edge points of the edge point, a fitting curve is obtained using the least squares method; a tangent to the fitting curve is made through the position of the edge point on the fitting curve to obtain the tangent corresponding to the edge point; the angle between the tangent corresponding to the edge point and the horizontal axis of the rectangular coordinate system is the tangent angle corresponding to the edge point; the absolute value of the difference between the tangent angle corresponding to the edge point and the tangent angle corresponding to the edge points adjacent to it on the left and right is calculated respectively, and recorded as the left adjacent angle difference and the right adjacent angle difference; the absolute value of the difference between the right adjacent angle difference and the left adjacent angle difference is calculated and normalized to obtain the trend mutation possibility of the edge point; when the trend mutation possibility of the edge point is greater than the first preset threshold, the edge point is a trend mutation edge point.

3. The method for monitoring attendance of electronic work badges based on face recognition according to claim 1, characterized in that: The method of screening the connected domains according to the fitting curves of the edge points on each edge segment of each connected domain to obtain the suspected iris connected domains includes: A fitting curve corresponding to a connected domain is obtained by least squares circular fitting based on the coordinates of each edge point in an edge segment on the edge of the connected domain, and the variance of the residual between the coordinate values ​​of each edge point in the edge segment and the corresponding coordinate values ​​on the fitting curve corresponding to the edge segment is calculated, which is recorded as the residual variance corresponding to the edge segment; the minimum value of the residual variance corresponding to each edge segment on the edge of the connected domain is inverted by the sum of the first preset value to obtain the suspected iris possibility of the connected domain; if the suspected iris possibility of the connected domain is greater than a second preset threshold, the connected domain is considered to be a suspected iris connected domain.

4. The method for monitoring attendance of electronic work badges based on face recognition according to claim 1, characterized in that: The determining of the suspected iris region based on the edges of adjacent suspected iris connected regions includes: A first fitting curve is obtained by least squares circle fitting based on the edge points on the edge segment with the smallest residual variance on the edge of each suspected iris connected domain in adjacent suspected iris connected domains. The residual variance corresponding to the adjacent suspected iris connected domains is obtained according to the first fitting curve; if the residual variance corresponding to the adjacent suspected iris connected domains is less than a third preset threshold, the adjacent suspected iris connected domains are merged to obtain a suspected iris area.

5. The method for monitoring attendance of electronic work badges based on face recognition according to claim 1, characterized in that: The step of obtaining the iris possibility of a suspected iris region based on the uppermost edge segment and the lowermost edge segment of a connected domain adjacent to the suspected iris region includes: Obtain a trend mutation edge point on the edge of a suspected iris region, and use the trend mutation edge point on the edge of the suspected iris region to segment the edge of the suspected iris region to obtain edge segments, with the edge segment at the uppermost end being the uppermost edge segment and the edge segment at the lowermost end being the lowermost edge segment; similarly, obtain the uppermost edge segments and lowermost edge segments of other connected domains; Obtain different connected domains adjacent to the suspected iris region and whose uppermost edge segments are connected to the uppermost edge segments of the suspected iris region, forming an upper feature connected domain set corresponding to the suspected iris region; obtain different connected domains adjacent to the suspected iris region and whose lowermost edge segments are connected to the lowermost edge segments of the suspected iris region, forming a lower feature connected domain set corresponding to the suspected iris region; The iris possibility of the suspected iris area is obtained according to the uppermost edge segment, the lowermost edge segment of the suspected iris area and the uppermost edge segment of the connected domain in the upper feature connected domain set and the lowermost edge segment of the connected domain in the lower feature connected domain set.

6. The method for monitoring attendance of electronic work badges based on face recognition according to claim 5, characterized in that: The step of obtaining the iris possibility of the suspected iris region based on the uppermost edge segment, the lowermost edge segment of the suspected iris region, and the uppermost edge segment of the connected domain in the upper feature connected domain set and the lowermost edge segment of the connected domain in the lower feature connected domain set corresponding thereto includes: Obtain the absolute value of the difference in slopes corresponding to every two adjacent edge points in an uppermost edge segment, and average them to obtain the average slope change rate of the uppermost edge segment. Similarly, obtain the average slope change rate of the lowermost edge segment. Calculate the absolute value of the difference between the uppermost edge segment of the suspected iris area and the average value of the slope change rate of the uppermost edge segment of a connected domain in its corresponding upper feature connected domain set, add the absolute value of the difference to the hyperparameter and invert it to obtain the slope change rate similarity value corresponding to the uppermost edge segment of the connected domain in the upper feature connected domain set, and the sum of the slope change rate similarity values ​​corresponding to the uppermost edge segments of all connected domains in the upper feature connected domain set is the upper slope change similarity; similarly, obtain the lower slope change similarity based on the lowermost edge segment of the suspected iris area and the lowermost edge segments of each connected domain in its corresponding lower feature connected domain set; add the upper slope change similarity and the lower slope change similarity and normalize them to obtain the iris possibility of the suspected iris area.

7. The method for monitoring attendance of electronic work badges based on face recognition according to claim 1, characterized in that: The step of acquiring the eye region based on the uppermost edge segment and the lowermost edge segment of the connected domain adjacent to the iris region includes: Obtain different connected domains adjacent to the iris region and whose uppermost edge segments are connected to the uppermost edge segment of the iris region to form an upper feature connected domain set corresponding to the iris region, calculate the slope change rate similarity value corresponding to the uppermost edge segment of each connected domain in the upper feature connected domain set corresponding to the iris region in combination with the uppermost edge segment of the iris region, obtain the uppermost edge segment of the connected domain corresponding to the slope change rate similarity value with the largest value and greater than the third judgment threshold as the first uppermost edge segment to be merged, merge the first uppermost edge segment to be merged with the uppermost edge segment of the iris region to form a first merged region; obtain the upper feature connected domain set corresponding to the first merged region, and combine the uppermost edge segment of the first merged region with the uppermost edge segment of the first merged region. The uppermost edge segment calculates the slope change rate similarity value corresponding to the uppermost edge segment of each connected domain in the upper feature connected domain set corresponding to the first merged area, obtains the uppermost edge segment of the connected domain corresponding to the slope change rate similarity value with the largest value and greater than the third judgment threshold, and takes it as the second uppermost edge segment to be merged. The second uppermost edge segment to be merged is merged with the uppermost edge segment of the first merged area to form a second merged area, and so on, until there is no slope change rate similarity value corresponding to the uppermost edge segment of the connected domain that meets the third judgment threshold, and the merging is stopped; the same operation is performed on the lowermost edge segment of the area obtained after the merging is stopped, combined with the uppermost edges of other connected domains, to obtain the eye area.

8. The method for monitoring attendance of electronic work badges based on face recognition according to claim 1, characterized in that: The step of obtaining neighboring pixel points of each pixel point in the eye area in the non-eye area of ​​the glasses area includes: Calculate the distance between a pixel point in the eye area and each pixel point in the non-eye area in the glasses area, and take a preset number of pixels in the non-eye area in the glasses area with the smallest distance as the neighboring pixels of the pixel point in the eye area.

9. The method for monitoring attendance of electronic work badges based on face recognition according to claim 1, characterized in that: The method of correcting each pixel in the eye area based on neighboring pixels of each pixel in the eye area and pixels in the non-glasses area to obtain a corrected eye area and a corrected face image includes: Calculate the average values ​​of the R, G, and B channels of all pixels in the non-glasses area of ​​the face, and record them as the R channel skin standard value, the G channel skin standard value, and the B channel skin standard value; Calculate the average value of the difference between the R channel values ​​of all neighboring pixels of a pixel in the eye area and the R channel skin standard value, and record it as the R channel value deviation degree of the pixel in the eye area; similarly, obtain the G channel value deviation degree and the B channel value deviation degree of the pixel in the eye area; subtract the R channel value, G channel value and B channel value of the pixel in the eye area from the R channel value deviation degree, G channel value deviation degree and B channel value deviation degree respectively to obtain the corrected R channel value, G channel value and B channel value; similarly, correct all pixels in the eye area to obtain the corrected eye area, and then replace the R channel value, G channel value and B channel value of each pixel in the non-eye area within the eye area with the R channel skin standard value, G channel skin standard value and B channel skin standard value respectively to obtain the corrected face image.

Citation Information

Patent Citations

  • Iris splitting method suitable for low-quality iris image in complex application context

    CN101923645A

  • Iris recognition method and terminal

    CN107292242A