A method and device for evaluating the quality of face images
By calculating the Laplacian variance value and gray average value of the face image, combined with the brightness ratio difference, an accurate evaluation of the face image quality is achieved, which solves the problem of low face recognition accuracy and hardware resources in the existing technology. It solves the problem of large occupation and improves the recognition accuracy and system performance.
Patent Information
- Application Number
- CN202011534287.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-22
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-12-22
AI Technical Summary
In practical applications, existing face recognition models suffer from reduced recognition accuracy due to face image quality issues, and existing evaluation methods rely on annotation quality that is not objective or takes up a large amount of hardware resources, causing delays.
By obtaining the face image to be evaluated, judging its category and selecting the corresponding key point extraction method, calculating the Laplacian variance value, the difference between the grayscale average and the brightness ratio, the image is blurred, light and dark, and yin and yang. judgment to achieve more accurate quality evaluation.
It improves the accuracy of face image quality evaluation and recognition accuracy, reduces the misrecognition rate, reduces hardware resource usage, and improves system performance.
Smart Images

Figure CN112528939B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of face image processing, and in particular to a face image quality evaluation method and device. Background Art
[0002] At present, with the development of machine learning and deep learning, many mainstream face recognition models have achieved an astonishing recognition accuracy of more than 99% on some face data sets, as hardware computing resources have been greatly improved. However, in actual production applications, these models have a much lower recognition accuracy due to the limitations of real-time performance and the quality of face images obtained in actual applications.
[0003] In particular, for face recognition in video surveillance scenarios, it is usually based on the surveillance camera continuously shooting the crowd area and obtaining video images, and then the intelligent face capture system calculates the video frame images to output a large number of captured face images. However, due to the relatively fixed position of the camera during the shooting process, there are partial occlusions in the crowd, too far away or light changes, resulting in uneven quality of continuous frames of the same person in the video. At the same time, low-quality face images caused by factors such as brightness, contrast, resolution, image blur and noise, as well as faces at different angles, will affect the recognition rate of the face recognition model. Therefore, in order to improve the recognition accuracy of the face recognition model, reduce the false recognition rate and improve the performance of the recognition system, it is necessary to construct a face image quality evaluation method to classify the captured face images and eliminate low-quality face images. At present, one of the existing evaluation methods is to rely on a large amount of well-annotated image data to train an SVM or CNN classifier, directly output the category probability of each image corresponding to the quality, and classify various situations of face image quality. This method relies on the quality of annotation, and it is difficult to unify the standards in the annotation process, resulting in a low recognition rate. In addition, the method based on deep learning requires a large amount of hardware resources and has a certain delay. In addition, there are also various characteristic indicators of facial images that are directly calculated, such as: image domain contrast, grayscale gradient difference, frequency component and Laplace variance value, etc., which directly evaluate the quality of facial images through indicators. This method uses the calculation indicators set by human experience as evaluation indicators, which is not objective.
[0004] Therefore, in order to improve the quality of face images and provide high-quality data for the subsequent face recognition process, a more accurate face image quality evaluation method is needed. Summary of the invention
[0005] The embodiment of the present invention provides a method and device for evaluating the quality of facial images, which can more accurately evaluate the quality of facial images, improve the classification accuracy of facial image quality, and thus improve the recognition accuracy of subsequent facial recognition.
[0006] The embodiment of the present invention provides a method for evaluating the quality of a face image, comprising:
[0007] Acquire a face image to be evaluated, and determine the category of the face image; the category of the face image includes: frontal face image and side face image;
[0008] According to the category judgment result of the face image, by selecting a corresponding key point extraction method, the face key points of the face image are extracted, and according to the face key points, the face key point area is divided in the face image; wherein the positions of the face key points extracted in the frontal face image include the positions of the facial features of the face image; the positions of the face key points extracted in the side face image include the positions of the facial features and the eyebrows of the face image;
[0009] Calculating the Laplace variance value of pixel data composed of all pixels in the face key point area, the grayscale average value, and the difference in brightness ratio between the pixel data of the left face area and the right face area divided according to the face key point area, and performing fuzzy face determination, light-dark face determination, and yin-yang face determination on the face image according to the Laplace variance value, the grayscale average value, and the difference in brightness ratio;
[0010] According to the determination results of the blurred face determination, the light and dark face determination and the yin-yang face determination, the quality of the face image is classified to obtain a quality evaluation result of the face image.
[0011] Further, according to the category judgment result of the face image, by selecting a corresponding key point extraction method, the face key points of the face image are extracted, and according to the face key points, the face key point area is divided in the face image, specifically:
[0012] If the category judgment result of the face image is the frontal face image, the distances from the facial key points of the left eye, the right eye, the left corner of the mouth, the lip center, and the right corner of the mouth in the face image to the central key point are calculated respectively by taking the nose of the face image as the central key point; a second distance is generated by multiplying each of the distances by a preset ratio, and the area range composed of all the facial key points is expanded in the direction of each of the facial key points to the range of the corresponding second distance, so as to generate a sparse key point area of the frontal face;
[0013] If the category judgment result of the facial image is the side face image, dense key point extraction is performed on the facial image through a preset dense facial key point model to generate a dense key point area of the side face; wherein the preset dense facial key point model is trained through facial picture data.
[0014] Furthermore, the preset dense facial key point model is trained through facial image data, specifically:
[0015] Acquire a face image to be recognized as training data, and determine the number and position of dense key point markers; wherein the training data includes: a training set, a validation set, and a test set;
[0016] Annotating the data to be trained according to the number and position of the marks of the dense key points;
[0017] The dense face key point model to be trained is trained by using the training data to generate
[0018] The dense facial key point model is trained and perfected.
[0019] Furthermore, the grayscale average value is calculated as follows:
[0020] Converting the face image into a grayscale image;
[0021] All pixels in the face key point area of the grayscale image are accumulated, and the accumulated average value is calculated to calculate the grayscale average value.
[0022] Further, the fuzzy face determination, light and dark face determination and yin-yang face determination are performed on the face image according to the Laplace variance value, the grayscale mean value and the difference of the brightness ratio, specifically:
[0023] It is determined whether the difference between the Laplace variance value, the grayscale average value and the brightness ratio is within the corresponding preset threshold ranges, so as to perform blurred face determination, light and dark face determination and yin-yang face determination on the face image.
[0024] Accordingly, the present embodiment also provides a device for evaluating the quality of a face image, comprising: a data acquisition unit, a key point region division unit, a determination unit, and a quality evaluation unit;
[0025] The data acquisition unit is used to acquire a face image to be evaluated and determine the category of the face image; the categories of the face image include: frontal face image and side face image;
[0026] The key point region division unit is used to extract the face key points of the face image by selecting the corresponding key point extraction method according to the category judgment result of the face image, and divide the face key point region in the face image according to the face key points; wherein the positions of the face key points extracted in the frontal face image include the positions of the facial features of the face image; the positions of the face key points extracted in the side face image include the positions of the facial features and the eyebrows of the face image;
[0027] The determination unit is used to calculate the Laplace variance value of pixel data composed of all pixels in the face key point area, the grayscale average value, and the difference in brightness ratio between the pixel data of the left face area and the right face area divided according to the face key point area, and perform blurry face determination, light and dark face determination, and yin-yang face determination on the face image according to the Laplace variance value, the grayscale average value, and the difference in brightness ratio;
[0028] The quality evaluation unit is used to classify the quality of the face image according to the judgment results of the blurred face judgment, the light and dark face judgment and the yin-yang face judgment, so as to obtain the quality evaluation result of the face image.
[0029] Further, the key point region division unit includes a key point region calculation unit;
[0030] The key point area calculation unit is used for, if the category judgment result of the face image is the frontal face image, calculating the distances from the key points of the facial features of the left eye, the right eye, the left corner of the mouth, the center of the lip, and the right corner of the mouth in the face image to the central key point by taking the nose of the face image as the central key point; multiplying each of the distances by a second distance generated by a preset ratio, and expanding the area range composed of all the key points of the facial features to the range of the corresponding second distance in the direction of each of the key points of the facial features, so as to generate a sparse key point area of the frontal face;
[0031] If the category judgment result of the facial image is the side face image, dense key point extraction is performed on the facial image through a preset dense facial key point model to generate a dense key point area of the side face; wherein the preset dense facial key point model is trained through facial picture data.
[0032] Further, the key point region calculation unit includes a side face key point model training unit;
[0033] The side face key point model training unit is used to obtain a face image to be recognized as training data, and determine the number and position of the marks of the dense key points; wherein the training data includes: a training set, a verification set and a test set;
[0034] Annotating the data to be trained according to the number and position of the marks of the dense key points;
[0035] The dense face key point model to be trained is trained by using the training data to generate
[0036] The dense facial key point model is trained and perfected.
[0037] Further, the determination unit includes a grayscale calculation unit;
[0038] The grayscale calculation unit is used to convert the face image into a grayscale image;
[0039] All pixels in the face key point area of the grayscale image are accumulated, and the accumulated average value is calculated to calculate the grayscale average value.
[0040] Further, the determination unit includes a category determination unit;
[0041] The category determination unit is used to determine whether the difference between the Laplace variance value, the grayscale average value and the brightness ratio is within the corresponding preset threshold range, so as to perform blurred face determination, light and dark face determination and yin-yang face determination on the face image.
[0042] Implementing the embodiments of the present invention has the following beneficial effects:
[0043] The embodiment of the present invention provides a method and device for evaluating the quality of a face image. The method obtains a face image to be evaluated and determines the category of the face image. The category of the face image includes: frontal face image and side face image. According to the category judgment result, the corresponding key point extraction method is selected to extract the face key points of the corresponding face image, and the face key point area is divided in the face image. By calculating the Laplace variance value of the pixels in the face key point area, the grayscale average value of the grayscale pixels in the face key point area, and the difference in the brightness ratio between the left face area and the right face area of the face image, the blur, brightness, and left and right half face quality of the face image are digitized, and the face image is judged as blurry face, light and dark face, and yin and yang face, so as to classify the quality of the face image to evaluate the quality of the face image. The scheme of this embodiment can achieve more accurate evaluation of the quality of the face image and more accurate classification of the quality category of the face image, thereby improving the evaluation accuracy of the quality of the face image and improving the recognition accuracy of subsequent face recognition.
[0044] Further, if the category judgment result of the face image is a frontal face image, the distances from the facial key points of the left eye, right eye, left corner of the mouth, lip center, and right corner of the mouth in the face image to the central key point are calculated by taking the nose of the face image as the central key point; the second distance generated by multiplying each distance by a preset ratio is used to expand the area range composed of all facial key points in the direction of each facial key point by the corresponding second distance to generate a sparse key point area of the front face; if the category judgment result of the face image is a side face image, the face image is densely extracted by a preset dense face key point model to generate a dense key point area of the side face; wherein the preset dense face key point model is trained by face picture data. By adopting the scheme of this embodiment, the front face and side face images can be further subdivided and processed, and different key point marking positions and different key point area generation methods are used for processing according to the different clarity of the front face and the side face, thereby improving the accuracy of subsequent quality evaluation calculations. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 It is a flowchart of an embodiment of a method for evaluating the quality of a facial image provided by the present invention;
[0046] Figure 2 It is a structural schematic diagram of an embodiment of a facial image quality evaluation device provided by the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of an embodiment of a method for evaluating the quality of a facial image provided by the present invention; Figure 1 As shown, the specific steps of the method for evaluating the quality of a face image include steps 101 to 104:
[0049] Step 101: Obtain a face image to be evaluated and determine the category of the face image; the categories of face images include: frontal face image and side face image.
[0050] In this embodiment, a large amount of surveillance video data can be obtained by monitoring a high-resolution camera, and surveillance videos can be obtained through a video decoding module. The facial images are extracted from the continuous frames of the surveillance video through an intelligent face capture system, and a large number of facial images are output. The quality of these facial images is uneven. Secondly, due to the changes in the monitoring scene, the photos taken by the camera are often divided into frontal faces and side faces, and the side faces are mostly. Therefore, through the facial image angle resolution module, the front and side faces of the face are first distinguished, and it is determined that all facial images belong to the front face or the side face, which is convenient for the subsequent use of corresponding fast processing methods for the front face images, and another processing method based on deep learning is used for the side face images to improve the pertinence of portrait processing.
[0051] Step 102: Based on the category judgment result of the face image, the face key points of the face image are extracted by selecting the corresponding key point extraction method, and the face key point area is divided in the face image according to the face key points; wherein the positions of the face key points extracted in the frontal face image include the positions of the facial features of the face image; and the positions of the face key points extracted in the side face image include the positions of the facial features and the eyebrows of the face image.
[0052] In this embodiment, face key point detection is a key step in the field of face recognition and analysis. It is the premise and breakthrough for other face-related problems such as automatic face recognition, expression analysis, three-dimensional face reconstruction and three-dimensional animation. Face key point detection refers to locating the key points of the face, including eyebrows, eyes, nose, mouth, and points in the facial contour area, given a face image. Face key points are important feature points of various parts of the face, usually contour points and corner points. The number of face key points has experienced a development process from the initial 5 points to more than 200 points today. Moreover, fewer key points means lower computing consumption and faster speed, but it must also be ensured that the key points can cover key organs and provide sufficient feature information for subsequent face computing applications. Therefore, based on the judgment result of the face image, a sparse key point extraction method is adopted for the front face to generate a key point area that wraps the eyes, nose, mouth, and eyebrows. For the side face, a dense key point extraction method is adopted to generate a key point area that wraps the eyes, nose, mouth, eyebrows, and facial contour. Since the sparse key point extraction method for the front face only marks a single key point based on the position of the facial features, the side face uses multiple key points to cover the position of each facial organ. Therefore, the number of key points for the front face is far less than that for the side face. This design can process faces at different angles in a targeted manner and improve the processing speed. According to the area surrounded by the key points, the face image can be further divided into key areas. The areas surrounded by these key points will replace the main information of the entire face and participate in the analysis and calculation in subsequent calculations.
[0053] As another example of this embodiment, according to the category judgment result of the face image, the face key points of the face image are extracted by selecting the corresponding key point extraction method, and the face key point area is divided in the face image according to the face key points, specifically: if the category judgment result of the face image is a frontal face image, then by taking the nose of the face image as the central key point, the distances from the facial key points of the left eye, right eye, left corner of the mouth, lip center, and right corner of the mouth in the face image to the central key point are calculated respectively; by multiplying each distance by a preset ratio to generate a second distance, the area range composed of all the facial key points is expanded in the direction of each facial key point by the corresponding second distance to generate a sparse key point area of the front face; if the category judgment result of the face image is a side face image, then by using a preset dense facial key point model, dense key point extraction is performed on the face image to generate a dense key point area of the side face; wherein the preset dense facial key point model is trained with face picture data.
[0054] In this embodiment, according to the classification result of classifying the facial image in step 101, it is determined whether the image belongs to the front face or the side face, so as to select different key point extraction methods to extract key points. When the judgment result is that the facial image is a front face image, a method of expanding the key point area to extract sparse facial key points is adopted. By using the key points containing the facial features, the remaining key points are expanded outward based on the nose as the center, so that the area composed of the key points can be expanded, thereby covering the key facial features. After expansion, the area covered by these key points is the sparse key point area of the front face. Since the number of key points of the facial features is small relative to the side face, only a single key point of the facial feature position is required, and the facial situation of the front face is relatively clear, so the calculation speed for the front face will be faster.
[0055] When the judgment result is that the face image is a side face image, due to the variability of the monitoring scene, most of the faces taken are presented in the side face position, resulting in the failure of the facial key point expansion method to adaptively process the side face image. Therefore, for the key point extraction of the side face image, a deep learning training method can be used to extract relatively dense key points in the side face image by taking advantage of the high adaptability of the pre-trained deep learning model. These key points are densely distributed in the contours of the face, eyebrows, and facial features, and no longer use a single key point to represent a facial feature. These dense key points are distributed around the contours of each part, and the area wrapped by these key points is the dense key point area of the side face. In addition, both key point areas wrap around the facial features and do not touch the position range of the forehead, hair, and background outside the facial contour. The key features of the face are reasonably represented by replacing the entire face image with the key area of the face, so that the accuracy of the subsequent quality evaluation calculation is improved. At the same time, the distinction between the front and side faces speeds up the subsequent calculation.
[0056] As another example of this embodiment, the preset dense facial key point model is trained through facial image data, specifically: obtaining a facial image to be identified as training data, and determining the number and position of dense key point markers; wherein the training data includes: a training set, a verification set, and a test set; annotating the training data according to the number and position of dense key point markers; training the dense facial key point model to be trained through the training data to generate a fully trained dense facial key point model.
[0057] In this embodiment, the number of dense key points is determined, and 98 key points are preferably selected in this embodiment. A face picture data set is selected and made into a training set, a validation set, and a test set, so that each picture set contains face pictures of various angles, and the annotation tool is used to annotate each picture with 98 key points of the face. A suitable CNN algorithm model is selected as the dense face key point model to be trained, and the training set is used as the input of the algorithm model for training, and the output result of the model is obtained, and compared with the result of manual annotation, the gradient is calculated and back propagation calculation is performed, and the parameters of the model are adjusted, and it is continuously iterated and trained multiple times until the model converges and the training is completed; finally, a model with the best test effect is selected on the test set as the final perfect dense face key point model.
[0058] Step 103: Calculate the Laplace variance value, grayscale average value, and brightness ratio difference between the pixel data of the left face area and the right face area divided according to the face key point area of the pixel data composed of all pixels in the face key point area, and perform blurred face judgment, light and dark face judgment, and yin-yang face judgment on the face image according to the Laplace variance value, grayscale average value, and brightness ratio difference.
[0059] In this embodiment, for the calculation of Laplace variance value and grayscale average value, the key point area of the image needs to be converted into a grayscale image. For the calculation of Laplace variance value, it is necessary to filter the image with Laplace operator, normalize the values in the filtered area and calculate the average value to calculate the variance. Laplace operator is the second-order derivative of the image, which can detect the rapid change of the grayscale value of the image. Laplace operator is often used for edge detection of the image. In normal images, the boundaries are clear and the variance is large after Laplace calculation; blurred images have less boundary information and small variance. Therefore, when the facial features are clearly visible, the Laplace variance value is large, and when the facial features are blurred, the Laplace variance value is small. Therefore, it is only necessary to manually find the boundary between the clear and blurred facial features as the threshold value to quantitatively evaluate the face in each picture.
[0060] For the grayscale value average, the grayscale average calculation process is as follows: convert the face image into a grayscale image; accumulate all pixels in the face key point area of the grayscale image, and calculate the accumulated average value to calculate the grayscale average. In the calculation process, it is only necessary to sum up the pixel values of the grayscale image in the face key area and then take the average. The formula for calculating the grayscale average is as follows:
[0061]
[0062] Among them, M is the height of the face image, N is the width of the face image, gray is the grayscale image, mask is the key point mask, the face key area is 1, and the non-face key area is 0.
[0063] For the calculation of the brightness difference between the left and right halves of the face, the face is divided into the left and right halves according to the key areas of the face, and then the RBG of the left and right halves are converted to HSV to obtain their respective brightness. Finally, the summed brightness is divided by the normalized half-face pixel value to obtain the ratio value of each half face. The ratio difference between the left and right halves of the face is used as the final yin-yang face determination indicator. The calculation process of the ratio difference rate is as follows:
[0064]
[0065]
[0066] Among them, m represents the total pixel value, lv represents the brightness of the left half of the face, lface represents the RGB data of the left half of the face, rv represents the brightness of the right half of the face, rface represents the RGB data of the right half of the face, lvrate and rvrate represent the brightness ratio values of the left half of the face and the right half of the face respectively.
[0067] As another example of this embodiment, based on the difference between the Laplace variance value, the grayscale mean and the brightness ratio, blurred face judgment, light and dark face judgment and yin and yang face judgment are performed on the face image. Specifically, it is determined whether the difference between the Laplace variance value, the grayscale mean and the brightness ratio is within the corresponding preset threshold range, so as to perform blurred face judgment, light and dark face judgment and yin and yang face judgment on the face image.
[0068] In this embodiment, a suitable Laplace variance threshold is set. If the threshold is less than the threshold, the face is judged to be blurred; a suitable grayscale average threshold is set. If the threshold is less than the threshold, the face is judged to be a dark face; then the key area of the face is divided into the left half face and the right half face, and a threshold for the HSV brightness difference between the left and right half faces is set. If the threshold is greater than the threshold, the face is judged to be a yin-yang face. For the above threshold selection, two sets of pictures are manually divided in advance, such as: selecting the same number of clear faces and blurred faces. The Laplace variance threshold is used as an example below. A threshold range is selected in advance, and the computer searches for the threshold in the range. The computer program for image evaluation and judgment is run based on the threshold to obtain the evaluation result, which is compared with the result of manual calibration, and the threshold with high accuracy is used as the Laplace variance threshold.
[0069] Step 104: Classify the quality of the face image according to the judgment results of blurred face judgment, light and dark face judgment, and yin-yang face judgment, and obtain the quality evaluation result of the face image.
[0070] In this embodiment, the quality category of the current face image is determined according to the judgment result of the threshold. In application, the above blurred face, dark face and yin-yang face are all cases of poor face image quality. Therefore, for the same face, only when the Laplace variance value, grayscale average value and ratio difference value meet the requirements, the subsequent face recognition is performed. If any of them does not meet the requirements, the subsequent recognition of the face frame is directly abandoned.
[0071] The specific steps of the embodiment of the present invention may refer to, but are not limited to, the quality evaluation method of the face image in the above embodiment; Figure 2 , Figure 2 It is a schematic diagram of the structure of an embodiment of the face image quality evaluation device provided by the present invention. The face image quality evaluation device comprises: a data acquisition unit 201, a key point area division unit 202, a determination unit 203 and a quality evaluation unit 204;
[0072] The data acquisition unit 201 is used to acquire the face image to be evaluated and determine the category of the face image; the categories of the face image include: frontal face image and side face image;
[0073] The key point region division unit 202 is used to extract the face key points of the face image by selecting the corresponding key point extraction method according to the category judgment result of the face image, and divide the face key point region in the face image according to the face key points; wherein the positions of the face key points extracted in the frontal face image include the positions of the facial features of the face image; the positions of the face key points extracted in the side face image include the positions of the facial features and the eyebrows of the face image;
[0074] The determination unit 203 is used to calculate the Laplace variance value of the pixel data composed of all the pixels in the key point area of the face, the grayscale average value, and the difference in the brightness ratio between the pixel data of the left face area and the right face area divided according to the key point area of the face, and perform blurry face determination, light and dark face determination, and yin-yang face determination on the face image according to the Laplace variance value, the grayscale average value, and the difference in the brightness ratio;
[0075] The quality evaluation unit 204 is used to classify the quality of the face image according to the judgment results of blurred face judgment, bright and dark face judgment, and yin-yang face judgment, and obtain the quality evaluation result of the face image.
[0076] In this embodiment, the key point region division unit 202 includes a key point region calculation unit;
[0077] The key point area calculation unit is used for, if the category judgment result of the face image is a frontal face image, calculating the distances from the key points of the facial features of the left eye, the right eye, the left corner of the mouth, the center of the lip, and the right corner of the mouth in the face image to the central key point respectively by taking the nose of the face image as the central key point; multiplying each distance by a second distance generated by a preset ratio, and expanding the area range composed of all the key points of the facial features to the range of the corresponding second distance in the direction of each key point of the facial features, so as to generate a sparse key point area of the front face;
[0078] If the category judgment result of the face image is a side face image, dense key point extraction is performed on the face image through a preset dense face key point model to generate a dense key point area of the side face; wherein the preset dense face key point model is trained through face picture data.
[0079] In this embodiment, the key point region calculation unit includes a side face key point model training unit;
[0080] The side face key point model training unit is used to obtain the face image to be recognized as the training data, and determine the number and position of the dense key point marks; wherein the training data includes: a training set, a verification set and a test set;
[0081] Label the training data according to the number and location of dense key points;
[0082] The dense facial key point model to be trained is trained using the training data to generate
[0083] Train a perfect dense facial landmark model.
[0084] In this embodiment, the determination unit 203 includes a grayscale calculation unit;
[0085] The grayscale calculation unit is used to convert the face image into a grayscale image;
[0086] All pixels in the facial key point area of the grayscale image are accumulated and the accumulated average is calculated to calculate the grayscale average.
[0087] In this embodiment, the determination unit 203 includes a category determination unit;
[0088] The category determination unit is used to determine whether the difference between the Laplace variance value, the grayscale average value and the brightness ratio is within the corresponding preset threshold range, so as to perform blurred face determination, light and dark face determination and yin-yang face determination on the face image.
[0089] The embodiment of the present invention provides a method and device for evaluating the quality of a face image. The method obtains a face image to be evaluated and determines the category of the face image. The category of the face image includes: frontal face image and side face image. According to the category judgment result, the corresponding key point extraction method is selected to extract the face key points of the corresponding face image, and the face key point area is divided in the face image. By calculating the Laplace variance value of the pixels in the face key point area, the grayscale average value of the grayscale pixels in the face key point area, and the difference in the brightness ratio between the left face area and the right face area of the face image, the blur, brightness, and left and right half face quality of the face image are digitized, and the face image is judged as blurry face, light and dark face, and yin and yang face, so as to classify the quality of the face image to evaluate the quality of the face image. The scheme of this embodiment can achieve more accurate evaluation of the quality of the face image and more accurate classification of the quality category of the face image, thereby improving the evaluation accuracy of the quality of the face image and improving the recognition accuracy of subsequent face recognition.
[0090] Further, if the category judgment result of the face image is a frontal face image, the distances from the facial key points of the left eye, right eye, left corner of the mouth, lip center, and right corner of the mouth in the face image to the central key point are calculated by taking the nose of the face image as the central key point; the second distance generated by multiplying each distance by a preset ratio is used to expand the area range composed of all facial key points in the direction of each facial key point by the corresponding second distance to generate a sparse key point area of the front face; if the category judgment result of the face image is a side face image, the face image is densely extracted by a preset dense face key point model to generate a dense key point area of the side face; wherein the preset dense face key point model is trained by face picture data. By adopting the scheme of this embodiment, the frontal face and side face images can be further subdivided and processed, and different key point marking positions and different key point area generation methods are used for processing according to the different clarity of the frontal face and the side face, thereby improving the accuracy of subsequent quality evaluation calculations.
[0091] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for evaluating the quality of a face image, characterized in that: include: Obtaining a face image to be evaluated, and determining the category of the face image; The categories of the face images include: frontal face images and side face images; According to the category judgment result of the face image, by selecting a corresponding key point extraction method, the face key points of the face image are extracted, and according to the face key points, the face key point area is divided in the face image; wherein the positions of the face key points extracted in the frontal face image include the positions of the facial features of the face image; the positions of the face key points extracted in the side face image include the positions of the facial features and the eyebrows of the face image; Calculating the Laplace variance value of pixel data composed of all pixels in the face key point area, the grayscale average value, and the difference in brightness ratio between the pixel data of the left face area and the right face area divided according to the face key point area, and performing fuzzy face determination, light-dark face determination, and yin-yang face determination on the face image according to the Laplace variance value, the grayscale average value, and the difference in brightness ratio; Classifying the quality of the face image according to the determination results of the blurred face determination, the light and dark face determination, and the yin-yang face determination, to obtain a quality evaluation result of the face image; The method of extracting the facial key points of the facial image by selecting a corresponding key point extraction method according to the category judgment result of the facial image, and dividing the facial key point area in the facial image according to the facial key points, is specifically as follows: If the category judgment result of the face image is the frontal face image, the distances from the facial key points of the left eye, the right eye, the left corner of the mouth, the lip center, and the right corner of the mouth in the face image to the central key point are calculated respectively by taking the nose of the face image as the central key point; a second distance is generated by multiplying each of the distances by a preset ratio, and the area range composed of all the facial key points is expanded in the direction of each of the facial key points to the range of the corresponding second distance, so as to generate a sparse key point area of the frontal face; If the category judgment result of the facial image is the side face image, dense key point extraction is performed on the facial image through a preset dense facial key point model to generate a dense key point area of the side face; wherein the preset dense facial key point model is trained through facial picture data.
2. The method for evaluating the quality of a face image according to claim 1, characterized in that: The preset dense facial key point model is trained through facial image data, specifically: Acquire a face image to be recognized as training data, and determine the number and position of dense key point markers; wherein the training data includes: a training set, a validation set, and a test set; Annotating the data to be trained according to the number and position of the marks of the dense key points; The dense face key point model to be trained is trained by using the training data to generate The dense facial key point model is trained and perfected.
3. The method for evaluating the quality of a face image according to claim 1, characterized in that: The grayscale average value calculation process is specifically as follows: Converting the face image into a grayscale image; All pixels in the face key point area of the grayscale image are accumulated, and the accumulated average value is calculated to calculate the grayscale average value.
4. The method for evaluating the quality of a face image according to claim 1, characterized in that: According to the Laplace variance value, the grayscale average value and the difference of the brightness ratio, blurry face determination, light and dark face determination and yin-yang face determination are performed on the face image, specifically: It is determined whether the difference between the Laplace variance value, the grayscale average value and the brightness ratio is within the corresponding preset threshold ranges, so as to perform blurred face determination, light and dark face determination and yin-yang face determination on the face image.
5. A facial image quality assessment device, characterized in that: include: Data acquisition unit, key point area division unit, determination unit and quality evaluation unit; The data acquisition unit is used to acquire a face image to be evaluated and determine the category of the face image; the categories of the face image include: frontal face image and side face image; The key point region division unit is used to extract the face key points of the face image by selecting the corresponding key point extraction method according to the category judgment result of the face image, and divide the face key point region in the face image according to the face key points; wherein the positions of the face key points extracted in the frontal face image include the positions of the facial features of the face image; the positions of the face key points extracted in the side face image include the positions of the facial features and the eyebrows of the face image; The determination unit is used to calculate the Laplace variance value of pixel data composed of all pixels in the face key point area, the grayscale average value, and the difference in brightness ratio between the pixel data of the left face area and the right face area divided according to the face key point area, and perform blurry face determination, light and dark face determination, and yin-yang face determination on the face image according to the Laplace variance value, the grayscale average value, and the difference in brightness ratio; The quality evaluation unit is used to classify the quality of the face image according to the judgment results of the blurred face judgment, the bright and dark face judgment, and the yin-yang face judgment, so as to obtain the quality evaluation result of the face image; The key point area division unit includes a key point area calculation unit; The key point area calculation unit is used for, if the category judgment result of the face image is the frontal face image, calculating the distances from the key points of the facial features of the left eye, the right eye, the left corner of the mouth, the center of the lip, and the right corner of the mouth in the face image to the central key point by taking the nose of the face image as the central key point; multiplying each of the distances by a second distance generated by a preset ratio, and expanding the area range composed of all the key points of the facial features to the range of the corresponding second distance in the direction of each of the key points of the facial features, so as to generate a sparse key point area of the frontal face; If the category judgment result of the facial image is the side face image, dense key point extraction is performed on the facial image through a preset dense facial key point model to generate a dense key point area of the side face; wherein the preset dense facial key point model is trained through facial picture data.
6. The facial image quality assessment device according to claim 5, characterized in that: The key point area calculation unit includes a side face key point model training unit; The side face key point model training unit is used to obtain a face image to be recognized as training data, and determine the number and position of the marks of the dense key points; wherein the training data includes: a training set, a verification set and a test set; Annotating the data to be trained according to the number and position of the marks of the dense key points; The dense face key point model to be trained is trained by using the training data to generate The dense facial key point model is trained and perfected.
7. The facial image quality assessment device according to claim 5, characterized in that: The determination unit includes a grayscale calculation unit; The grayscale calculation unit is used to convert the face image into a grayscale image; All pixels in the face key point area of the grayscale image are accumulated, and the accumulated average value is calculated to calculate the grayscale average value.
8. The facial image quality assessment device according to claim 5, characterized in that: The determination unit includes a category determination unit; The category determination unit is used to determine whether the difference between the Laplace variance value, the grayscale average value and the brightness ratio is within the corresponding preset threshold range, so as to perform blurred face determination, light and dark face determination and yin-yang face determination on the face image.
Citation Information
Patent Citations
Face definition judgment method
CN107977639A
Face image quality evaluation method
CN110619628A
Automatic face auditing method, system, device and readable storage medium
CN111222433A
Face recognition method and apparatus
WO2018001092A1
