A face recognition method, device and equipment applied to enterprise management system
By distinguishing skin and non-skin pixels in face recognition, combining convex hull and connected domain analysis, and adjusting the LBP coding histogram weights, the problem of insufficient feature information distinction in different regions in the traditional LBPH algorithm is solved, and the accuracy of face recognition is improved.
Patent Information
- Application Number
- CN202510211249.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-02-25
AI Technical Summary
The traditional LBPH algorithm fails to distinguish the feature information of different facial regions in face recognition, resulting in low recognition accuracy.
By obtaining the RGB image and grayscale image of the face to be detected, using the color features of skin pixels and non-skin pixels, combined with the convex hull algorithm and connected domain analysis, the degree of face occlusion and the suspicion of facial features are evaluated, and the weight of the LBP coding histogram is adjusted to perform face recognition.
The accuracy of face recognition is improved, especially in the presence of facial obstructions, which can more accurately extract and utilize key feature information, thereby improving recognition accuracy.
Smart Images

Figure CN120318876B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a face recognition method, device and equipment applied to an enterprise management system. Background Art
[0002] Facial recognition is a biometric technology that uses feature extraction to represent facial features for automatic face recognition. It boasts high user acceptance, good concealment, and the ability to perform concurrent recognition. It is widely used in areas such as content retrieval and identity recognition. The widespread application of facial recognition technology has provided businesses with efficient, secure, and convenient management methods, such as employee attendance, access control systems, meeting check-in, visitor management, and security monitoring. Facial recognition typically involves three steps: face detection, feature extraction, and pattern recognition. Feature extraction of the RGB image of the face to be detected is a key step in facial recognition.
[0003] The LBPH (Local Binary Pattern Histogram) algorithm is a commonly used feature extraction method in current face recognition and is suitable for feature extraction of real-time face images. The traditional LBPH algorithm extracts features by calculating the LBP encoded histogram of the entire face image. However, it assigns equal importance to the feature information at all locations in the face image, which means that the features in different regions contribute equally to recognition. However, in actual applications, the amount of feature information carried by different regions of the face is different. Since the LBPH algorithm fails to distinguish these differences, it may lead to neglecting the regional features that are more critical to recognition during feature extraction. Therefore, this limitation of the traditional LBPH algorithm makes it less than ideal when extracting the most discriminative features, thereby reducing the accuracy of face recognition. Summary of the Invention
[0004] In view of the above, it is necessary to provide a face recognition method, device and equipment applied to enterprise management systems to solve the above problems.
[0005] According to one aspect of the present application, a face recognition method applied to an enterprise management system is provided, the method comprising:
[0006] Obtain the RGB image and grayscale image corresponding to the face to be detected;
[0007] Based on the color characteristics of each pixel in the RGB image of the face to be detected, skin pixels and non-skin pixels are obtained; the grayscale image of the face to be detected is divided into blocks, and the convex hull algorithm is used on all skin pixels in the grayscale image of the face to be detected. According to the distribution of the number of pixels in the convex hull in each pixel block, the face occlusion degree of each pixel block is obtained;
[0008] Connected domains are extracted from all non-skin pixels within the convex hull of the grayscale image of the face to be detected. The facial feature suspicion of each connected domain is determined based on the uniformity of the gradient distribution of the edge pixels of each connected domain within each convex hull, the color characteristics of the pixels, and the degree of color similarity between the pixels. The information carrying degree of each pixel block is determined based on the distribution of the facial feature suspicion of the connected domain where the pixels are located, combined with the degree of face occlusion.
[0009] The LBPH algorithm is used for the pixel blocks of the grayscale image of the face to be detected and the standard grayscale image, and the face recognition result is obtained based on the similarity between the LBP coding histograms and the information carrying degree.
[0010] The step of obtaining skin pixels and non-skin pixels is as follows:
[0011] The RGB image of the face to be detected is converted into a YIQ image, an I component interval is preset, and all pixels in the RGB image of the face to be detected whose I component values are within the I component interval are regarded as skin pixels, otherwise, they are regarded as non-skin pixels.
[0012] The face occlusion degree of each pixel block is specifically the ratio of the number of pixel points that do not belong to the convex hull in each pixel block to the total number of pixel points in the pixel block.
[0013] The degree of suspiciousness of facial features of each connected domain is obtained as follows:
[0014] According to the uniformity of the gradient distribution of the edge pixels of each connected domain in each convex hull, the degree of symmetry of the contour of each connected domain is obtained;
[0015] For each connected domain, the vector consisting of the I component value and the Q component value of each pixel in the YIQ image is used as the color feature vector of each pixel;
[0016] According to the similarity between the color feature vectors of each pixel in each connected domain and the pixels in the local range, the color uniformity coefficient of each pixel is obtained;
[0017] For each connected domain, calculate the mean of the cosine similarity between the color feature vectors of all two pixels, which is recorded as the first mean;
[0018] Calculate the mean of the color uniformity coefficients of all pixels and record it as the second mean;
[0019] Based on the degree of contour symmetry of each connected domain and the first mean and the second mean, the suspiciousness of the facial features of each connected domain is obtained; wherein the suspiciousness of the facial features is positively correlated with the degree of contour symmetry and negatively correlated with the first mean and the second mean.
[0020] The degree of symmetry of the outline of each connected domain is obtained as follows:
[0021] For each convex hull, the gradient direction angles of all edge pixels of each connected domain are obtained, and the histogram of the gradient direction angles of all edge pixels is obtained. According to the concentration degree of the frequencies corresponding to all intervals in the histogram, the degree of symmetry of the contour of each connected domain is obtained.
[0022] The step of obtaining the color uniformity coefficient of each pixel includes:
[0023] A window for each pixel point is preset, and the pixels in the window of each pixel point that are in the same connected domain as each pixel point are extracted. The average level of similarity of the color feature vector between each pixel point and each extracted pixel point is used as the color uniformity coefficient of each pixel point.
[0024] The information carrying degree of each pixel block is obtained as follows:
[0025] The facial feature suspicion degree of each non-skin pixel in the convex hull is specifically the facial feature suspicion degree of the connected domain where each non-skin pixel is located; the facial feature suspicion degree of each skin pixel in the convex hull is specifically 0;
[0026] Calculate the mean of the facial feature suspicion of all non-skin pixels in the convex hull of each pixel block, and record it as the third mean; obtain the ratio of the number of all pixels in the convex hull of each pixel block to the number of pixels in the pixel block; fuse the third mean with the ratio; and fuse the negative correlation mapping value of the facial occlusion degree of each pixel block with the normalized value of the fusion result as the information carrying degree of each pixel block.
[0027] The face recognition result is specifically:
[0028] The face matching degree between the grayscale image of the face to be detected and the standard grayscale image is recorded as R(m), and its formula is: Wherein, Lk and L(m,k) represent the LBP coded histogram of the kth pixel block of the grayscale image of the face to be detected and the standard face grayscale image respectively; χ() represents the chi-square function; Xk represents the information carrying degree of the kth pixel block of the grayscale image of the face to be detected; K represents the number of pixel blocks in the grayscale image of the face to be detected; α is a preset constant greater than zero; norm() is the normalization function;
[0029] The maximum value of the face matching degree between the grayscale image of the face to be detected and all standard grayscale images of the face is calculated. When the maximum value is greater than a preset matching threshold, the face recognition passes; otherwise, the face recognition fails.
[0030] According to another aspect of the present application, a face recognition device for an enterprise management system is provided, comprising:
[0031] The face image acquisition module is used to obtain the RGB image and grayscale image corresponding to the face to be detected;
[0032] The facial image analysis module is used to obtain skin pixels and non-skin pixels based on the color characteristics of each pixel in the RGB image of the face to be detected; divide the grayscale image of the face to be detected into blocks, and use the convex hull algorithm for all skin pixels in the grayscale image of the face to be detected, and obtain the face occlusion degree of each pixel block based on the distribution of the number of pixels in the convex hull in each pixel block; extract the connected domains of all non-skin pixels in the convex hull of the grayscale image of the face to be detected; obtain the facial feature suspicion of each connected domain based on the uniformity of the gradient distribution of the edge pixels of each connected domain in each convex hull and the color characteristics of the pixels, combined with the color similarity between the pixels; obtain the information carrying degree of each pixel block based on the distribution of the facial feature suspicion of the connected domain where the pixels in each pixel block are located, combined with the face occlusion degree;
[0033] The face image recognition module is used to use the LBPH algorithm on the pixel blocks of the grayscale image of the face to be detected and the standard grayscale image, and obtain the face recognition result based on the similarity between the LBP coding histograms and the information carrying degree.
[0034] According to another aspect of the present application, a face recognition device applied to an enterprise management system is provided, comprising a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, operations corresponding to the above-mentioned face recognition method applied to the enterprise management system are implemented.
[0035] In the above scheme, the RGB image and grayscale image corresponding to the face to be detected are first obtained, and the non-skin pixels are obtained based on the color features of the pixels in the RGB image of the face to be detected, which helps to improve the accuracy of subsequent facial feature extraction; the grayscale image of the face to be detected is divided into blocks, and combined with the convex hull algorithm, the face occlusion degree is obtained, which has the beneficial effect of measuring the possibility that the RGB image of the face to be detected is blocked by the occluder; further, the connected domain of all non-skin pixels in the convex hull is extracted, and the facial features suspicion is obtained according to the shape features and color features of the connected domain, which has the beneficial effect of distinguishing whether each connected domain is a facial feature, distinguishing the facial feature area and the occluder area from the shape features and color features, and providing facial features. The method improves the distinction between the pixel points corresponding to the occluders and the facial features of the person in the convex hull, and reduces the influence of the information carrying degree of the LBP coding histogram of the pixel blocks in the grayscale image of the face to be detected obtained by subsequent adaptive acquisition; based on the information carrying degree and the LBP coding histogram, the face recognition of the employee to be detected is completed, and its beneficial effect is that it takes into account the information carrying degree of the facial contour occluders and the facial area where the facial features are located in the face recognition image, accurately evaluates the facial feature information of different pixel blocks in the grayscale image of the face to be detected, improves the utilization degree of the most discriminative information in the detected face image, and thus improves the accuracy of the facial features extracted based on the LBPH algorithm in rapid face recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A flowchart of the steps of a face recognition method applied to an enterprise management system provided in this application;
[0037] Figure 2 Schematic diagram of the LBP coding histogram of the pixel block provided in this application;
[0038] Figure 3 This application provides a block diagram of a face recognition device used in an enterprise management system. DETAILED DESCRIPTION
[0039] In the description of the embodiments of this application, words such as "exemplary," "or," and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "or," and "for example" is intended to present the relevant concepts in a concrete manner.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art in the art of this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0041] It should also be noted that the terms "first" and "second" in this application and the accompanying drawings are used to distinguish similar objects, rather than to describe a specific order or sequence. The methods disclosed in the embodiments of this application or the methods shown in the flowcharts include one or more steps for implementing the methods. Without departing from the scope of this application, the order of executing multiple steps can be interchanged with each other, and some steps can also be deleted.
[0042] See also Figure 1 , which shows a flowchart of a face recognition method applied to an enterprise management system provided by one embodiment of the present application, the method comprising the following steps:
[0043] Step 1: Obtain the RGB image and grayscale image corresponding to the face to be detected.
[0044] A camera is used to obtain an RGB image of the employee's face. The image is used as the input of a face detection network (Multi-task convolutional neural network, MTCNN), which outputs an image of the employee's face area. The output image is then geometrically normalized to correct for size differences and angle tilts caused by changes in facial posture. The image is then normalized to a uniform format and size, resulting in an RGB image of the employee's face.
[0045] Step 2: Based on the color features of each pixel in the RGB image of the face to be detected, skin pixels and non-skin pixels are obtained; the grayscale image of the face to be detected is divided into blocks, and the convex hull algorithm is used on all skin pixels in the grayscale image of the face to be detected. According to the distribution of the number of pixels in the convex hull in each pixel block, the face occlusion degree of each pixel block is obtained.
[0046] In order to improve the utilization of the most discriminative information in the RGB image of the face to be detected by the Local Binary Pattern Histogram (LBPH) algorithm, the present application divides the grayscale image of the face to be detected obtained by converting the RGB image of the face to be detected into pixel blocks, analyzes the distribution of facial occlusions and facial features in the grayscale image of the face to be detected, assigns different weights to the LBP coded histograms extracted from different pixel blocks, and completes the recognition of the grayscale image of the face to be detected of the employee to be detected based on the LBP coded histograms and weights of all pixel blocks in the grayscale image of the face to be detected.
[0047] Specifically, the RGB image of the face to be detected is converted into a YIQ image. The conversion of RGB images into YIQ images is a well-known technology, and the specific process will not be repeated here. Since the hue of the facial skin color of Asians is generally between red and yellow, and contains a relatively large yellow component, the I component value of the facial skin color in the YIQ image varies within a specific range. Therefore, a preset I component value interval is used to distinguish between skin pixels and non-skin pixels in the RGB image of the face to be detected: all pixels in the RGB image of the face to be detected whose I component values are between the I component value interval are recorded as skin pixels; otherwise, they are recorded as non-skin pixels. In this embodiment, the I component value interval is set to [30,100], and the implementer can adjust it at will.
[0048] The RGB image of the face to be detected is grayscaled to obtain a grayscale image of the face to be detected. The grayscale processing of the RGB image is a well-known technique, and the specific process is not described in detail here. The grayscale image of the face to be detected is evenly divided into M pixel blocks and numbered. In this embodiment, the divided pixel blocks are numbered in order from top to bottom and from left to right in the grayscale image of the face to be detected to obtain all pixel blocks of the grayscale image of the face to be detected. The value of M is 16. The number of pixel blocks and the order in which the pixel blocks are numbered can be set by the implementer and are not limited by this application.
[0049] Because facial occluders, such as masks and hair, often obscure facial contours, often cover the edges of the face. Therefore, a convex hull algorithm is used to obtain the convex hull of all skin pixels in the grayscale image of the face to be detected. This convex hull algorithm is used to represent the facial area not obscured by facial occluders in the grayscale image. This convex hull algorithm is well known and the detailed process is omitted here.
[0050] The ratio of the number of pixels that do not belong to the convex hull in each pixel block to the total number of pixels in the pixel block is used as the face occlusion degree of each pixel block.
[0051] It should be understood that the face occlusion degree is used to characterize the degree to which the face area where the pixel block is located is blocked by the facial contour occluder. The larger the value of the face occlusion degree, the smaller the weight of the LBP coding histogram of the pixel block should be when performing face recognition on the grayscale image of the face to be detected.
[0052] Step 3: Connected domains are extracted from all non-skin pixels within the convex hull of the grayscale image of the face to be detected; the facial feature suspicion of each connected domain is obtained based on the uniformity of the gradient distribution of the edge pixels of each connected domain within each convex hull and the color characteristics of the pixels, combined with the degree of color similarity between the pixels; the information carrying degree of each pixel block is obtained based on the distribution of the facial feature suspicion of the connected domain where the pixels in each pixel block are located, combined with the degree of face occlusion.
[0053] However, the boundary generated by the convex hull algorithm includes the minimum convex boundary of all objects. However, if the outline of the object is occluded or incompletely visible, the convex hull may extend into the occluder or other non-target areas, thereby including some areas that are not part of the target object. Therefore, when using the convex hull algorithm, the area where facial features are located may be partially covered by occluders, causing the convex hull boundary to include some non-skin areas.
[0054] Based on the above analysis, connected domains are extracted for all non-skin pixel points in the convex hull of the grayscale image of the face to be detected. Each connected domain represents a non-skin area in the convex hull of the grayscale image of the face to be detected, and all connected domains of the convex hull are obtained. The extraction of connected domains is a well-known technology and will not be described in detail in this application.
[0055] Generally speaking, the contour edges of facial features have more obvious central symmetry characteristics than the contours of facial occluders, and the facial area where the facial contour occluder is located has a more uniform color distribution than the facial features area.
[0056] Based on the above analysis, for each convex hull, the gradient direction angles of all edge pixels of each connected domain are obtained, and the histogram of the gradient direction angles of all edge pixels is obtained. According to the concentration degree of the frequencies corresponding to all intervals in the histogram, the degree of symmetry of the contour of each connected domain is obtained.
[0057] It should be noted that in this embodiment, the gradient direction angle of each edge pixel is obtained using the Sobel operator; the concentration of multiple variables is measured by the inverse of the standard deviation. The Sobel operator and histogram extraction are well-known technologies, and the specific process will not be repeated here.
[0058] It should be understood that if the number distribution of edge pixels of all edge pixels in the connected domain at each gradient direction angle is more consistent, the standard deviation is smaller, the central symmetric distribution characteristics of the edge contour of the connected domain are more obvious, and the degree of contour symmetry is greater.
[0059] For each connected domain, the vector composed of the I component value and the Q component value of each pixel in the YIQ image is used as the color feature vector of each pixel; a window for each pixel is preset, and the pixels in the window of each pixel that are in the same connected domain as each pixel are extracted, and the average level of similarity between the color feature vectors of each pixel and each extracted pixel is used as the color uniformity coefficient of each pixel.
[0060] In this embodiment, the window for each pixel is specifically a 3×3 window centered on the pixel; the window size can be customized by the implementer. The similarity between vectors is measured using the absolute value of cosine similarity; the larger the absolute value of cosine similarity, the closer the colors of the pixels. The average of the absolute values of cosine similarity between each pixel and all other pixels is recorded as the color uniformity coefficient for each pixel, which is used to indicate the uniformity of color distribution within the facial region corresponding to the window region where the pixel is located. The calculation of cosine similarity is well known, and the specific process is not detailed here.
[0061] Furthermore, based on the degree of outline symmetry of each connected domain and the color uniformity coefficient of all pixels, combined with the color similarity between pixels, the facial features suspicion of each connected domain is obtained:
[0062] For each connected domain, the mean of the cosine similarity between the color feature vectors of all pixels is calculated, which is recorded as the first mean; the mean of the color uniformity coefficient of all pixels is calculated, which is recorded as the second mean; based on the degree of contour symmetry of each connected domain and the first mean and the second mean, the suspicion of the facial features of each connected domain is obtained; wherein the suspicion of the facial features is positively correlated with the degree of contour symmetry and negatively correlated with the first mean and the second mean.
[0063] In this embodiment, the facial feature suspiciousness is specifically calculated by multiplying the first mean by the second mean, and taking the ratio of the contour symmetry to the product as the facial feature suspiciousness. It should be noted that to prevent the denominator from being zero, a preset value of 0.01 is added to the denominator, which can be adjusted by the implementer.
[0064] It should be understood that the more obvious the central symmetric distribution characteristics of the edge contour corresponding to the connected domain are, that is, the greater the degree of contour symmetry, and the more uneven the color distribution within the connected domain is, that is, the smaller the overall color uniformity coefficient of all pixels in the connected domain is, and the smaller the cosine similarity of the color feature vectors between all the pixels is, the greater the possibility that the connected domain belongs to the facial features in the grayscale image of the face to be detected, that is, the greater the suspicion of the facial features.
[0065] According to the distribution of facial features suspicion in the connected domain where the pixels in each pixel block are located, combined with the degree of face occlusion, the information carrying degree of each pixel block is obtained:
[0066] If the nth pixel in the convex hull is a non-skin pixel, the facial feature suspicion of the connected domain corresponding to the pixel is recorded as the facial feature suspicion of the pixel; if the nth pixel in the convex hull is a skin pixel, the facial feature suspicion of the corresponding pixel is assigned to 0.
[0067] Calculate the mean of the facial feature suspicion of all non-skin pixels in the convex hull of each pixel block, and record it as the third mean; obtain the ratio of the number of all pixels in the convex hull of each pixel block to the number of pixels in the pixel block; fuse the mean with the ratio; and fuse the negative correlation mapping value of the facial occlusion degree of each pixel block with the normalized value of the fusion result as the information carrying degree of each pixel block.
[0068] In this embodiment, multiple variables are fused using a multiplication method, and negatively correlated mapping values are measured using the inverse. Normalization utilizes the maximum-minimum normalization method. Specifically, the information carrying rate of each pixel block is calculated by multiplying the third mean by the ratio, and then calculating the ratio of this product to the degree of facial occlusion as the information carrying rate of each pixel block. It should be noted that to prevent the denominator from being zero, a preset value of 0.01 is added to the denominator, which can be adjusted by the implementer.
[0069] It should be understood that in face recognition, since the facial features in the RGB image of the face to be detected can better reflect the facial features, and the occluders in the RGB image of the face to be detected will submerge or distort the facial features, the less the pixel block is blocked by the facial contour occluder, and the greater the proportion of pixels in the pixel block belonging to the facial features and the degree of suspicion, the more facial feature information the LBP coding histogram of the pixel block carries, that is, the greater the information carrying degree, the more the LBP coding histogram of the pixel block can reflect the facial features of the face area corresponding to the pixel block.
[0070] Step 4: Using the LBPH algorithm on the pixel blocks of the grayscale image of the face to be detected and the standard grayscale image, based on the similarity between the LBP coding histograms and the information carrying degree, the face recognition result is obtained.
[0071] The LBPH algorithm is used to extract the LBP coding histogram of each pixel block of the grayscale image of the face to be detected. In this embodiment, the scale of the LBPH algorithm is selected as (8, 1), and a unified mode is adopted to obtain the LBP coding histogram of each pixel block for subsequent face recognition of the grayscale image of the face to be detected. The LBPH algorithm is a well-known technology and the specific process will not be repeated here. In addition, the schematic diagram of the LBP coding histogram of the pixel block is as shown in FIG. Figure 2 shown.
[0072] For the mth standard face grayscale image in the database of the face recognition module, use the same method as the LBP coding histogram of the face grayscale image of the employee to be detected to obtain the LBP coding histogram of each pixel block of the standard face grayscale image, and obtain the face matching degree between the face grayscale image to be detected and the standard face grayscale image:
[0073] According to the similarity between the LBP coded histograms of the pixel blocks of the grayscale image of the face to be detected and the standard grayscale image, combined with the information carrying degree, the face matching degree between the grayscale image of the face to be detected and the standard grayscale image is obtained:
[0074] The face matching degree between the grayscale image of the face to be detected and the standard grayscale image is recorded as R(m), and its formula is: Wherein, Lk and L(m,k) represent the LBP coded histogram of the kth pixel block of the grayscale image of the face to be detected and the standard face grayscale image respectively; χ() represents the chi-square function, wherein the smaller the result of the χ() function is, the more similar the two histograms are. The chi-square comparison method is a well-known technology and the specific process is not repeated here; Xk represents the information carrying degree of the kth pixel block of the grayscale image of the face to be detected; K represents the number of pixel blocks in the grayscale image of the face to be detected; α is a preset constant greater than zero. In order to prevent the denominator from being 0, α is taken as 0.01; norm() is the normalization function, which adopts the sigmoid function.
[0075] It should be understood that the greater the information carrying capacity of the LBP coding histogram of the pixel block, the greater the influence of the histogram similarity between the LBP coding histograms of the k pixel blocks on the face matching results between the grayscale image of the face to be detected and the standard grayscale image of the face. If the similarity between the LBP coding histograms is higher, that is, the smaller χ(Lk,L(m,k)), the more similar the facial features of the grayscale image of the face to be detected and the standard grayscale image are, that is, the greater the face matching degree, the more likely the employee corresponding to the standard grayscale image of the face is the face recognition result of the employee to be detected.
[0076] The face matching degree between the grayscale image of the face to be detected and each standard face grayscale image in the database is calculated respectively, and the matching threshold r=0.9 is set, which can be set by the implementer; if the maximum value of the face matching degree obtained is greater than the matching threshold, the employee name corresponding to the standard face grayscale image corresponding to the maximum value is obtained from the face recognition module, such as Li Ming, and the voice broadcast module of the face recognition module issues a voice "Li Ming, face recognition passed", otherwise the voice broadcast module issues a voice "face recognition failed", completing the rapid recognition of the face of the employee to be detected.
[0077] Based on the same concept as the embodiment of the present invention, a face recognition device for an enterprise management system is proposed, comprising:
[0078] The face image acquisition module is used to obtain the RGB image and grayscale image corresponding to the face to be detected;
[0079] The facial image analysis module is used to obtain skin pixels and non-skin pixels based on the color characteristics of each pixel in the RGB image of the face to be detected; divide the grayscale image of the face to be detected into blocks, and use the convex hull algorithm for all skin pixels in the grayscale image of the face to be detected, and obtain the face occlusion degree of each pixel block based on the distribution of the number of pixels in the convex hull in each pixel block; extract the connected domains of all non-skin pixels in the convex hull of the grayscale image of the face to be detected; obtain the facial feature suspicion of each connected domain based on the uniformity of the gradient distribution of the edge pixels of each connected domain in each convex hull and the color characteristics of the pixels, combined with the color similarity between the pixels; obtain the information carrying degree of each pixel block based on the distribution of the facial feature suspicion of the connected domain where the pixels in each pixel block are located, combined with the face occlusion degree;
[0080] The face image recognition module is used to use the LBPH algorithm on the pixel blocks of the grayscale image of the face to be detected and the standard grayscale image, and obtain the face recognition result based on the similarity between the LBP coding histograms and the information carrying degree.
[0081] Among them, a face recognition device block diagram applied to enterprise management systems, such as Figure 3 shown.
[0082] Based on the same concept as the embodiment of the method of the present application, a face recognition device for an enterprise management system is proposed, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the operations corresponding to the above-mentioned face recognition method for an enterprise management system.
[0083] To summarize, first obtain the RGB image and grayscale image corresponding to the face to be detected, and obtain non-skin pixels based on the color features of the pixels in the RGB image of the face to be detected, which helps to improve the accuracy of subsequent facial feature extraction; divide the grayscale image of the face to be detected into blocks, and combine the convex hull algorithm to obtain the degree of face occlusion, which has the beneficial effect of measuring the possibility that the RGB image of the face to be detected is blocked by the occluder; further extract the connected domain of all non-skin pixels in the convex hull, and obtain the facial features suspicion based on the shape features and color features of the connected domain, which has the beneficial effect of distinguishing whether each connected domain is a facial feature, and distinguishing the facial feature area and the occluder area from the shape features and color features, thereby improving The method improves the discrimination between the pixel points corresponding to the occluders and the facial features of the person in the convex hull, and reduces the influence of the information carrying degree of the LBP coding histogram of the pixel blocks in the grayscale image of the face to be detected obtained by subsequent adaptive acquisition; based on the information carrying degree and the LBP coding histogram, the face recognition of the employee to be detected is completed, and its beneficial effect is that it takes into account the information carrying degree of the facial contour occluders and the facial area where the facial features are located in the face recognition image, accurately evaluates the facial feature information of different pixel blocks in the grayscale image of the face to be detected, improves the utilization degree of the most discriminative information in the detected face image, and thus improves the accuracy of the facial features extracted based on the LBPH algorithm in rapid face recognition.
[0084] It should be noted that the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the systems, methods and computer program products according to the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of the code, and the module, program segment or part of the code contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, which can depend on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in an order different from that disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified function or action, or may be implemented by a combination of dedicated hardware and computer instructions.
[0085] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A face recognition method applied to an enterprise management system, characterized in that: The method comprises the following steps: Obtain the RGB image and grayscale image corresponding to the face to be detected; Based on the color characteristics of each pixel in the RGB image of the face to be detected, skin pixels and non-skin pixels are obtained; the grayscale image of the face to be detected is divided into blocks, and the convex hull algorithm is used on all skin pixels in the grayscale image of the face to be detected. According to the distribution of the number of pixels in the convex hull in each pixel block, the face occlusion degree of each pixel block is obtained; Connected domains are extracted from all non-skin pixels within the convex hull of the grayscale image of the face to be detected. The facial feature suspicion of each connected domain is determined based on the uniformity of the gradient distribution of the edge pixels of each connected domain within each convex hull, the color characteristics of the pixels, and the degree of color similarity between the pixels. The information carrying degree of each pixel block is determined based on the distribution of the facial feature suspicion of the connected domain where the pixels are located, combined with the degree of face occlusion. The LBPH algorithm is used on the pixel blocks of the grayscale image of the face to be detected and the standard grayscale image, and the face recognition result is obtained based on the similarity between the LBP coding histograms and the information carrying degree; The information carrying degree of each pixel block is obtained as follows: The facial feature suspicion degree of each non-skin pixel in the convex hull is specifically the facial feature suspicion degree of the connected domain where each non-skin pixel is located; the facial feature suspicion degree of each skin pixel in the convex hull is specifically 0; Calculate the mean of the facial feature suspicions of all non-skin pixels in the convex hull of each pixel block, and record it as the third mean; obtain the ratio of the number of all pixels in the convex hull of each pixel block to the number of pixels in the pixel block; and fuse the negative correlation mapping value of the facial occlusion degree of each pixel block, the third mean, and the ratio to obtain a normalized value as the information carrying degree of each pixel block.
2. A face recognition method applied to an enterprise management system according to claim 1, characterized in that: The skin pixel points and non-skin pixel points are obtained as follows: The RGB image of the face to be detected is converted into a YIQ image, an I component interval is preset, and all pixels in the RGB image of the face to be detected whose I component values are within the I component interval are regarded as skin pixels, otherwise, they are regarded as non-skin pixels.
3. The face recognition method applied to an enterprise management system according to claim 1, characterized in that: The face occlusion degree of each pixel block is specifically the ratio of the number of pixel points that do not belong to the convex hull in each pixel block to the total number of pixel points in the pixel block.
4. The face recognition method applied to an enterprise management system according to claim 2, characterized in that: The degree of suspiciousness of facial features in each connected domain is obtained as follows: According to the uniformity of the gradient distribution of the edge pixels of each connected domain in each convex hull, the degree of symmetry of the contour of each connected domain is obtained; For each connected domain, the vector consisting of the I component value and the Q component value of each pixel in the YIQ image is used as the color feature vector of each pixel; According to the similarity between the color feature vectors of each pixel in each connected domain and the pixels in the local range, the color uniformity coefficient of each pixel is obtained; For each connected domain, calculate the mean of the cosine similarity between the color feature vectors of all two pixels, which is recorded as the first mean; Calculate the mean of the color uniformity coefficients of all pixels and record it as the second mean; Based on the degree of contour symmetry of each connected domain and the first mean and the second mean, the suspiciousness of the facial features of each connected domain is obtained; wherein the suspiciousness of the facial features is positively correlated with the degree of contour symmetry and negatively correlated with the first mean and the second mean.
5. The face recognition method applied to an enterprise management system according to claim 4, characterized in that: The degree of symmetry of the outline of each connected domain is obtained as follows: For each convex hull, the gradient direction angles of all edge pixels of each connected domain are obtained, and the histogram of the gradient direction angles of all edge pixels is obtained. According to the concentration degree of the frequencies corresponding to all intervals in the histogram, the degree of symmetry of the contour of each connected domain is obtained.
6. The face recognition method applied to an enterprise management system according to claim 4, characterized in that: Obtaining the color uniformity coefficient of each pixel includes: A window for each pixel point is preset, and the pixels in the window of each pixel point that are in the same connected domain as each pixel point are extracted. The average level of similarity of the color feature vector between each pixel point and each extracted pixel point is used as the color uniformity coefficient of each pixel point.
7. The face recognition method applied to an enterprise management system according to claim 1, characterized in that: The face recognition result is specifically: The face matching degree between the grayscale image of the face to be detected and the standard grayscale image is recorded as , its formula form is: , where 、 Respectively represent the LBP coding histogram of the k-th pixel block of the grayscale image of the face to be detected and the standard face grayscale image; () represents the chi-square function; represents the information carrying capacity of the kth pixel block in the grayscale image of the face to be detected; K represents the number of pixel blocks in the grayscale image of the face to be detected; is a preset constant greater than zero; norm() is a normalization function; The maximum value of the face matching degree between the grayscale image of the face to be detected and all standard grayscale images of the face is calculated. When the maximum value is greater than a preset matching threshold, the face recognition passes; otherwise, the face recognition fails.
8. A face recognition device used in an enterprise management system, implementing the method according to claim 1, characterized in that: The device includes: The face image acquisition module is used to obtain the RGB image and grayscale image corresponding to the face to be detected; The facial image analysis module is used to obtain skin pixels and non-skin pixels based on the color characteristics of each pixel in the RGB image of the face to be detected; divide the grayscale image of the face to be detected into blocks, and use the convex hull algorithm for all skin pixels in the grayscale image of the face to be detected, and obtain the face occlusion degree of each pixel block based on the distribution of the number of pixels in the convex hull in each pixel block; extract the connected domains of all non-skin pixels in the convex hull of the grayscale image of the face to be detected; obtain the facial feature suspicion of each connected domain based on the uniformity of the gradient distribution of the edge pixels of each connected domain in each convex hull and the color characteristics of the pixels, combined with the color similarity between the pixels; obtain the information carrying degree of each pixel block based on the distribution of the facial feature suspicion of the connected domain where the pixels in each pixel block are located, combined with the face occlusion degree; The face image recognition module is used to use the LBPH algorithm on the pixel blocks of the grayscale image of the face to be detected and the standard grayscale image, and obtain the face recognition result based on the similarity between the LBP coding histograms and the information carrying degree.
9. A face recognition device for an enterprise management system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, operations corresponding to the face recognition method applied to an enterprise management system according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Target tracking method based on multi-feature self-adaption fusion and on-line study
CN103198493A
Face detection method and device, computer equipment and storage medium
CN114283473A