CN115760816A - Method and device for determining illumination quality of face image and storage medium - Google Patents

Method and device for determining illumination quality of face image and storage medium Download PDF

Info

Publication number
CN115760816A
CN115760816A CN202211494122.1A CN202211494122A CN115760816A CN 115760816 A CN115760816 A CN 115760816A CN 202211494122 A CN202211494122 A CN 202211494122A CN 115760816 A CN115760816 A CN 115760816A
Authority
CN
China
Prior art keywords
coefficient
area
value
brightness
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211494122.1A
Other languages
Chinese (zh)
Inventor
倪春泉
江亚萍
陈明生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Rainbow Software Co ltd
Original Assignee
Rainbow Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rainbow Software Co ltd filed Critical Rainbow Software Co ltd
Priority to CN202211494122.1A priority Critical patent/CN115760816A/en
Publication of CN115760816A publication Critical patent/CN115760816A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Measurement Of The Respiration, Hearing Ability, Form, And Blood Characteristics Of Living Organisms (AREA)
  • Measuring And Recording Apparatus For Diagnosis (AREA)

Abstract

The invention discloses a method and a device for determining illumination quality of a face image and a storage medium. Wherein, the method comprises the following steps: analyzing a human face skin image from the human face image; acquiring a brightness coefficient and a brightness unevenness coefficient of a human face skin image; and determining the illumination quality of the face image according to the brightness coefficient and the brightness non-uniformity coefficient. The face illumination uniformity is determined by focusing only the face skin color area and showing a double peak phenomenon according to the uneven illumination, and finally face illumination quality evaluation is obtained by combining the face brightness determination, so that other image quality interference factors can be eliminated, and the image illumination brightness can be concentrated on the measurement.

Description

Method and device for determining illumination quality of face image and storage medium
Technical Field
The present disclosure relates to image processing technologies, and in particular, to a method, an apparatus, and a storage medium for determining illumination quality of a face image.
Background
The illumination quality of the face image can affect the face image recognition result, and when the illumination quality of the face image is poor, such as the illumination of the face image is extremely bright and dark or the illumination is uneven, the accuracy of the face image recognition result can be reduced. Therefore, an effective method for determining the illumination quality of the face is needed, which is beneficial to guiding the composition of image data or performing optimization processing on the image data, and is also beneficial to analyzing the reasons of false recognition and rejection of the face recognition task.
The existing face image quality determination method mainly comprises the following steps: carrying out overall brightness measurement based on the face image and the background image thereof, wherein in the method, the determination result of the illumination quality of the face image is greatly influenced by the illumination quality of the background image; if the illumination of the face image is normal, but the illumination of the background image is extremely dark or bright, the determination result of the illumination quality of the face image may be reduced; based on the prior with the characteristic difference of 0 between the left half-face image and the right half-face image, the quality of the local variable generated by the asymmetry of the left half-face image and the right half-face image caused by illumination is measured, the mode is strict for the prior, if the human face deviates a certain angle, the left half-face image and the right half-face image are not symmetrical, and the generated illumination quality evaluation index is not accurate.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The application provides a method and a device for determining the illumination quality of a face image and a storage medium, which can more accurately determine the illumination quality of the face image.
According to an aspect of the embodiments of the present invention, there is provided a method for determining illumination quality of a face image, including: analyzing a human face skin image from the human face image; acquiring a brightness coefficient and a brightness unevenness coefficient of the human face skin image; and determining the illumination quality of the face image according to the brightness coefficient and the brightness unevenness coefficient.
Optionally, obtaining the brightness coefficient and the brightness nonuniformity coefficient of the face skin image includes: dividing a histogram curve of the face skin image into a bright area and a dark area according to a preset pixel threshold; respectively acquiring the brightness coefficient and the brightness unevenness coefficient through the histogram curve, wherein the brightness unevenness coefficient is determined according to at least one of the following: a first coefficient for representing a difference in luminance between the bright area and the dark area, and a second coefficient for representing a difference in area between the bright area and the dark area.
Optionally, obtaining the luminance nonuniformity coefficient through the histogram curve includes: determining a first pixel value and a second pixel value from the bright area and the dark area, respectively; and combining the first pixel value, the second pixel value and the preset pixel threshold value to respectively determine the first coefficient and the second coefficient.
Optionally, determining a first pixel value and a second pixel value from the bright area and the dark area respectively includes: and determining the pixel value with the most frequent occurrence in the bright area and the dark area, wherein the pixel value corresponding to the peak value of the histogram curve peak of the bright area is a first pixel value, and the pixel value corresponding to the peak value of the histogram curve peak of the dark area is a second pixel value.
Optionally, determining the first coefficient by combining the first pixel value, the second pixel value, and the preset pixel threshold includes: calculating a difference value between the first pixel value and the pixel threshold value to obtain a first difference; calculating a difference value between the second pixel value and the pixel threshold value to obtain a second difference; determining the first coefficient by calculating an average of the first difference and the second difference.
Optionally, determining the second coefficient by combining the first pixel value, the second pixel value, and the preset pixel threshold includes: respectively acquiring the area of the bright area and the area of the dark area through the first pixel value, the second pixel value and the preset pixel threshold; and taking the ratio of the area of the bright area to the area of the dark area as the second coefficient.
Optionally, obtaining the area of the bright area and the area of the dark area includes: calculating the first pixel value, the second pixel value, the minimum value of difference values between every two of the preset pixel threshold value and the pixel boundary value, and taking the minimum value as the peak value width; taking the first pixel value as a central axis, and taking the area of histogram curve areas contained in a first left boundary and a first right boundary as the area of the bright area, wherein the distances between the first left boundary and the central axis and the distances between the first right boundary and the central axis are both the peak width; and taking the second pixel value as a central axis, and taking the area of a histogram curve region contained by a second left boundary and a second right boundary as the area of the dark region, wherein the distances between the second left boundary and the central axis and the distances between the second right boundary and the central axis are both the peak width.
Optionally, obtaining the luminance coefficient through the histogram curve includes: based on the histogram curve, calculating the mean value and the variance of the gray values of all the pixel points deviating from the central gray value; and taking the absolute value of the ratio of the mean value to the variance as the brightness coefficient.
Optionally, the determining, according to the brightness coefficient and the brightness nonuniformity coefficient, the illumination quality of the face image includes: weighting and summing the luminance coefficient, the first coefficient, and the second coefficient; and determining the illumination quality of the face image according to the summation result.
According to an aspect of the embodiments of the present invention, there is provided an apparatus for determining illumination quality of a face image, including: the analysis module is used for analyzing a human face skin image from the human face image; the processing module is used for acquiring a brightness coefficient and a brightness unevenness coefficient of the face skin image; and the evaluation module is used for determining the illumination quality of the face image according to the brightness coefficient and the brightness nonuniformity coefficient.
According to an aspect of the embodiments of the present invention, there is provided a computer-readable storage medium, where the storage medium includes a stored program, where the program includes any one of the above methods for determining illumination quality of a face image.
According to an aspect of the embodiments of the present invention, there is provided a processor, configured to execute a program, where the program executes any method for determining illumination quality of a face image when running.
In the embodiment of the invention, the following steps are executed: analyzing a human face skin image from the human face image; acquiring a brightness coefficient and a brightness unevenness coefficient of the human face skin image; and determining the illumination quality of the face image according to the brightness coefficient and the brightness non-uniformity coefficient. The face illumination uniformity evaluation is carried out by focusing on the face skin color area only and showing a double peak phenomenon according to uneven illumination, the face illumination quality evaluation is finally obtained by combining the face brightness evaluation, the evaluation is carried out on the measurement calculation of relevant dimensions based on the brightness pixel distribution of the whole image, the area semantic segmentation is not limited, the brightness contrast intensity of uneven areas can be measured, the misjudgment caused by slight face skin color unevenness and the like is reduced, other image quality interference factors can be well eliminated, and the evaluation in the aspect of image illumination brightness is concentrated.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. Other advantages of the present application can be realized and attained by the instrumentalities and combinations particularly pointed out in the specification and the drawings.
Drawings
The accompanying drawings are included to provide an understanding of the present disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the examples serve to explain the principles of the disclosure and not to limit the disclosure.
Fig. 1 is a flowchart of a method for determining illumination quality of a face image according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating a face skin image selected from a plurality of area images according to an embodiment of the present application;
FIG. 3 is a graph illustrating a pixel histogram curve generated based on the image shown in FIG. 2 according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a device for determining illumination quality of a face image according to an embodiment of the present application.
Detailed Description
The present application describes embodiments, but the description is illustrative rather than limiting and it will be apparent to those of ordinary skill in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are possible. Any feature or element of any embodiment may be used in combination with or instead of any other feature or element in any other embodiment, unless expressly limited otherwise.
The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive concept as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive aspects to form yet another unique inventive aspect, as defined by the claims. Thus, it should be understood that any of the features shown and/or discussed in this application may be implemented individually or in any suitable combination. Accordingly, the embodiments are not limited except as by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
Further, in describing representative embodiments, the specification may have presented the method and/or process as a particular sequence of steps. However, to the extent that the method or process does not rely on the particular order of steps set forth herein, the method or process should not be limited to the particular sequence of steps described. Other orders of steps are possible as will be understood by those of ordinary skill in the art. Therefore, the particular order of the steps set forth in the specification should not be construed as limitations on the claims. Further, the claims directed to the method and/or process should not be limited to the performance of their steps in the order written, and one skilled in the art can readily appreciate that the sequences may be varied and still remain within the spirit and scope of the embodiments of the present application.
The embodiment of the application provides a method for determining the illumination quality of a face image, and as shown in fig. 1, the method comprises the following steps:
step S101, analyzing a human face skin image from a human face image;
the face image may contain only a face; besides the human face, the human face can also comprise other parts of the human body (such as neck and shoulders), and can also comprise a background pattern;
furthermore, in order to obtain more accurate illumination quality evaluation, the method and the device can set angle and ambiguity parameter evaluation conditions for the human face, screen out high-quality human face skin images, and perform subsequent analysis flow on the human face images reaching the corresponding parameter setting range, thereby realizing more accurate subsequent illumination quality evaluation;
step S102, acquiring a brightness coefficient and a brightness unevenness coefficient of the human face skin image;
step S103 determines the illumination quality of the face image according to the brightness coefficient and the brightness unevenness coefficient.
The method for determining the illumination quality of the face image, which is disclosed by the embodiment of the application, only focuses on the skin area of the face, and eliminates the interference of the illumination quality of other parts of the image on the evaluation of the illumination quality of the face image. In addition, when the illumination quality of the face image is determined, the illumination brightness factor is considered, and the non-uniform factor of the illumination brightness of the face caused by illumination, human body posture and the like is also considered, so that the finally determined illumination quality is more accurate. Specifically, the interference caused by illumination evaluation under the conditions that part of illumination is only connected with a small part of bright and dark light and two large areas with the difference between the bright and dark areas being not obvious and the like is eliminated.
In an exemplary embodiment, a method for analyzing a face skin image from a face image includes:
the face image is decomposed based on a face analysis algorithm (such as a face matching algorithm based on deep learning), and a face skin image is selected from the face image. After the face image is analyzed, each semantic component in the face area is assigned with a label, and the plurality of areas comprise: hair, facial skin, eyes, nose, mouth; as shown in fig. 2, extracting a facial skin image from the parsed regions includes: the nose region and the facial skin region.
Dark parts such as hair of five sense organs and the like are removed through face analysis, only a face skin part is left for face illumination quality evaluation, and the condition that evaluation accuracy is influenced when background interference and other characteristic interference exist is eliminated, for example, the evaluation result is inaccurate under the condition that the face brightness is normal but the background is extremely bright or dark. According to the method and the device, only the face skin color area is focused, and the truest illumination quality evaluation result of the actual face area is obtained.
In an exemplary embodiment, the step S102 of acquiring the luminance coefficient and the luminance nonuniformity coefficient of the facial skin image includes:
generating a histogram curve based on the human face skin image;
and respectively acquiring the brightness coefficient and the brightness unevenness coefficient through the histogram curve.
In an exemplary embodiment, the obtaining the luminance coefficient through the histogram curve includes:
calculating the mean value and the variance of the gray values of all the pixel points deviating from the central gray value based on the histogram curve;
and taking the absolute value of the ratio of the mean value to the variance as the brightness coefficient.
Specifically, a histogram curve (also referred to as a gray histogram curve) of the face skin image is generated, and the histogram curve generated based on the face skin image shown in fig. 2 is shown in fig. 3, wherein the abscissa of the histogram represents the brightness in the image, and gradually transitions from full black to full white from left to right, and the range is [0,255]; the vertical axis represents the number (also called frequency) of pixels in the image in the brightness range, the overall brightness of the image can be obtained through a histogram curve, and the brightness coefficient is determined according to the embodiment of the application.
Further, as shown in fig. 3, the present application first calculates a mean da of gray scale deviation and a variance ma of gray scale deviation of the pixel histogram curve; the luminance coefficient is calculated based on da and ma.
In an exemplary embodiment, the method for calculating the mean da of the gray scale deviation and the variance ma of the gray scale deviation of the histogram curve includes:
Figure BDA0003964843980000071
Figure BDA0003964843980000072
wherein, N represents the total number of pixel points contained in the face skin image; p is a radical of formula i A pixel value (also called a gray value) representing the ith pixel point; 128 denotes the central gray value; j denotes the pixel value, hist j Indicating the frequency with which the pixel value j occurs.
The gray level deviation mean value da reflects the average brightness of the human face skin image, and if the mean value is moderate, the visual effect is good; the grayscale deviation variance ma reflects the degree to which the pixel value deviates from the center grayscale value, with larger values leading to more dispersed grayscale levels.
In an exemplary embodiment, calculating the luminance coefficient K according to da and ma includes:
K=|da|/|ma| (3)
the smaller the luminance coefficient, the less the luminance value deviates from the central gray value. The brightness evaluation of the image is completed according to the whole histogram curve, and the dispersion degree of the brightness data distribution is measured through the brightness coefficient statistics so as to measure the degree of the brightness value deviating from the central gray value.
In an exemplary embodiment, obtaining the luminance nonuniformity coefficients by the histogram curve includes:
dividing a histogram curve of the face skin image into a bright area and a dark area according to a preset pixel threshold;
obtaining the brightness unevenness coefficient through the histogram curve, wherein the brightness unevenness coefficient is determined according to at least one of: a first coefficient for representing the difference between the brightness of the bright area and the brightness of the dark area, and a second coefficient for representing the difference between the areas of the bright area and the dark area.
Specifically, the bright area refers to an area where the pixel value of each corresponding pixel point in the histogram curve is greater than or equal to a preset pixel threshold; the dark area refers to an area where the pixel value of each corresponding pixel point in the histogram curve is smaller than a preset pixel threshold. The method for determining the preset pixel threshold is not limited in the present application, and a maximum entropy method, a minimum cross entropy method, a maximum correlation method, a gray level entropy method, a variance method between maximum classes, and the like can be used. Preferably, a pixel threshold value T for distinguishing a bright area from a dark area can be searched by adopting a maximum inter-class variance method; for a dark area, the pixel value of each pixel point is smaller than T; for bright areas, the pixel value of each pixel point is greater than or equal to T.
Specifically, the histogram curve corresponding to the face skin image is divided into the bright area and the dark area, the face skin image is not firstly partitioned and then the partitioned areas are compared in the unevenness degree, the method is not limited by image partitioning, the unevenness degree of brightness and darkness of the face part is accurately described based on the distribution of the whole pixels, and the situations that the upper part, the lower part, the yin and yang face and the like are not considered are avoided.
The non-uniformity judgment is realized through at least one of the following indexes: a first coefficient and a second coefficient. Wherein the first coefficient is used for representing the brightness difference between the bright area and the dark area, namely the contrast intensity of the illumination of the uneven area; the second coefficient is a ratio indicating a difference in area between the bright area and the dark area, that is, a ratio corresponding to the illumination of the uneven area. Through the two indexes, misjudgment of uneven light caused by slight unevenness such as complexion can be avoided, and the brightness contrast intensity of uneven areas can be accurately measured without being limited by image area division, so that misjudgment of uneven face complexion degree is reduced.
For a face skin image, the double peaks shown in the histogram curve are generally a normal face skin color region and a skin color region affected by illumination, that is, the distribution of two core pixels of the face skin color. Further, the image is divided into regions based on semantic information or the prior of a symmetrical region of the face is determined according to the distance relationship between the double peak pixels and the threshold value and the area relationship between the double peak regions. Even if the illumination of the face is asymmetric in all directions and the brightness difference of all illumination ranges exists, the method and the device can objectively evaluate the illumination nonuniformity of the image based on accurate statistics and description of the distribution of core pixels of the complexion of the face. Specifically, the luminance nonuniformity index in the present application includes two indexes, namely a first coefficient and a second coefficient, and both of the two indexes depend on the peak pixel value and the preset pixel threshold value.
In an exemplary embodiment, the obtaining the luminance nonuniformity coefficient through the histogram curve includes:
determining a first pixel value and a second pixel value from the bright area and the dark area, respectively;
the second pixel value and the predetermined pixel threshold value are combined to determine the first coefficient and the second coefficient, respectively.
Specifically, before determining the luminance nonuniformity factor, the embodiment of the present application selects the first pixel value and the second pixel value from the bright area and the dark area respectively according to the same preset condition.
In an exemplary embodiment, the same preset condition includes: the most frequent pixel values occur in the region. Since the abscissa of the histogram of pixels represents a pixel value and the ordinate represents the frequency of occurrence of the corresponding pixel value, in an exemplary embodiment, determining the first pixel value and the second pixel value from the bright area and the dark area, respectively, comprises: and determining the pixel value with the most frequent occurrence in a bright area and a dark area, wherein the pixel value corresponding to the peak value of the histogram curve peak of the bright area is a first pixel value, and the pixel value corresponding to the peak value of the histogram curve peak of the dark area is a second pixel value.
As shown in fig. 3, since the luminance non-uniformity may have a peak around the pixel threshold T of the histogram curve, the maximum values pl, pr may be found at the left and right sides of the pixel threshold T, respectively, as the second pixel value and the first pixel value. Specifically, a peak is found in a bright area of a pixel histogram curve of a human face skin image, and a pixel value pr corresponding to the peak is used as a first pixel value; and searching for a peak value appearing on a pixel histogram curve of the face skin image in a dark area, and taking a pixel value pl corresponding to the peak value as a second pixel value.
The technical solution described in the embodiment of the present application is also applicable to the case where there is no peak around the pixel threshold T (i.e. there is no peak in the bright dark area), and if there is no peak on the left or right of the pixel threshold T, pl = T or pr = T may be set correspondingly. In addition, for the case that there are multiple secondary peaks in the bright area or the dark area, the secondary peak caused by illumination is the true main peak, the rest secondary peaks may be defects in a small part of the face or gradual change of the face, and the two secondary peaks are not too far apart. If the heights of the secondary wave crests are obviously different, namely the difference of the wave peak values between the secondary wave crests is larger than a difference threshold, selecting the secondary wave crest with the highest wave crest, and taking the pixel value corresponding to the wave crest as a pixel threshold; if the height difference of the secondary peaks is small, namely the difference of the peak values between the secondary peaks is smaller than the difference threshold, selecting a pixel value corresponding to any one secondary peak value, or determining a final pixel value obtained by averaging the pixel values of all the secondary peaks as the pixel threshold.
Experiments prove that the difference between a bright area and a dark area of an image can be described through pixel values corresponding to peak values on the left side and the right side of a pixel threshold value, and the difference between a conventional human face skin color area and a human face skin color area influenced by illumination can be accurately described.
In an exemplary embodiment, determining the first coefficient by combining the first pixel value, the second pixel value and the preset pixel threshold includes:
calculating a difference value between the first pixel value and the pixel threshold value to obtain a first difference;
calculating a difference value between the second pixel value and the pixel threshold value to obtain a second difference;
the first coefficient is determined by calculating an average of the first difference and the second difference.
For a human face skin image, the double peaks appearing in the histogram curve are generally a normal skin color area of the human face and a skin color area affected by illumination (or a skin color layering area of the human face like face blush). Furthermore, the contrast intensities of two core pixels can be described through the distance relation between the double-peak pixels and the threshold value, the final score can be reduced through smaller contrast intensity, and the influence of illumination uniformity description caused by uneven skin color (face blush and the like) of the user can be avoided.
Specifically, the difference degree between the pixel values of the bright area and the dark area, that is, the illumination contrast degree, can be obtained according to the distance difference between the first pixel value and the pixel threshold value and the distance difference between the second pixel value and the pixel threshold value. Taking fig. 3 as an example, the difference between the first pixel value pr and the pixel threshold T is (pr-T), and the difference between the second pixel value pl and the pixel threshold T is (T-pl);
the first coefficient is then:
Figure BDA0003964843980000101
the average distance of the distance threshold of the double wave crests is described by the first coefficient, the average distance represents a difference value of the pixel value of the point with the largest number of pixel values in the dark area with the corresponding value in the bright area with the light, the contrast intensity of the light in the uneven area can be measured more accurately, and in addition, light unevenness misjudgment caused by slight skin color unevenness can be avoided, for example, areas with the bright and dark areas, such as face halation, which are not obvious are formed, and the average distance exists in a histogram curve with smaller oscillation amplitude. The peak of the highest area is adopted, the distance between the dark peak and the bright peak is larger when the first coefficient is larger, the contrast intensity of illumination is larger, and the image is more uneven.
In addition, the embodiment of the application also takes the ratio of the area of the bright area to the area of the dark area of the histogram curve as a second coefficient, which can accurately describe the proportion of core pixels of different human face skin colors, and avoid the adverse effect of long-tail pixels on the illumination uniformity of the face.
In an exemplary embodiment, determining the second coefficient by combining the first pixel value, the second pixel value and the preset pixel threshold includes:
respectively acquiring the area of the bright area and the area of the dark area through the first pixel value, the second pixel value and the preset pixel threshold value;
and taking the ratio of the area of the bright area to the area of the dark area as the second coefficient.
The corresponding physical meaning of this application patent second coefficient is exactly the proportion that the different illumination of whole face corresponds, can reduce even the influence of the bright dark that the small part extremely strong light caused to final unevenness when aassessment unevenness.
Obtaining the area of the bright area and the area of the dark area, including:
calculating the minimum value of the difference values between the first pixel value, the second pixel value, the preset pixel threshold value and the pixel boundary value, and taking the minimum value as the peak value width;
taking the first pixel value as a central axis, and the area of a histogram curve region included in a first left boundary and a first right boundary is the area of the bright region, wherein the distances between the first left boundary and the first right boundary and the central axis are the peak width;
and taking the second pixel value as a central axis, wherein the area of a histogram curve region included by a second left boundary and a second right boundary is the area of the dark region, and the distances between the second left boundary and the central axis and the distances between the second right boundary and the central axis are both the peak width.
In addition, compared with the method using the regional full pixel segment, in order to describe the pixels of two core skin color states more accurately, the long-tail pixels are excluded and the measurement indexes are added, and the experiment shows that the area ratio of the area formed by a small distance of the pixels around the peak value can better describe the proportion of the two current core pixels.
Specifically, the peak range of the bright area and the dark area is limited by introducing the peak width, and the minimum value of the difference value between every two of the first pixel value, the second pixel value, the preset pixel threshold value and the pixel boundary value (including 0 and 255) is calculated and is used as the peak width. The minimum value is used as the peak value width, on one hand, the influence measurement index of the long-tail pixels can be reduced, and on the other hand, the area overlapping of the regions can be prevented. When the area of the bright area is selected, the first pixel value is taken as a central axis, and the area of histogram curve areas contained in the first left boundary and the first right boundary is taken as the area of the bright area, wherein the distances between the first left boundary and the first right boundary and the central axis are both peak width, and the dark area is the same as the peak width.
Taking fig. 3 as an example, the area al of the dark area is:
Figure BDA0003964843980000111
the area ar of the bright zone is:
Figure BDA0003964843980000112
wherein halfw = min (| 256-pr |, | pr-T |, | T-Pl |, | Pl-0 |), and T is the pixel threshold; hist i The frequency of occurrence of the pixel value i is the abscissa in the histogram curve corresponding to the pixel value i.
Correspondingly, the method for calculating the second coefficient may be:
Figure BDA0003964843980000121
the second coefficient is the area ratio of the bright area to the dark area, the range of the second coefficient is larger than 1, when the coefficient is just 1, the dark part and the bright part are just equal, the larger the second coefficient is, the larger the area of a certain area is, and the more uniform the illumination of the image is. By focusing on the pixels with the peak values in two skin color states, the excluded part is probably only connected with a small part of brightness caused by extremely strong light, so that the misjudgment on the image unevenness is reduced.
In an exemplary embodiment, determining the illumination quality of the face image according to the luminance coefficient and the luminance nonuniformity coefficient includes:
weighting and summing the luminance coefficient, the first coefficient and the second coefficient;
and determining the illumination quality of the face image according to the summation result.
Weighting and summing the luminance coefficient, the first coefficient and the second coefficient according to a weight, such as score = w 1 *K+w 2 *dis+w 3 * ratio, wherein w 1 ,w 2 ,w 3 The weights representing the three coefficients can be set adaptively according to experiments or requirements; determining the illumination quality of the face image according to a summation result score, wherein the greater the score value is, the better the illumination quality is; conversely, the smaller the score value, the worse the illumination quality.
The method only focuses on the face skin color area, carries out face illumination quality evaluation without background interference, carries out face illumination uniformity evaluation according to the phenomenon that uneven illumination presents double peaks, and finally obtains the face illumination quality evaluation by combining with face brightness evaluation.
The embodiment of the application provides a device for determining illumination quality of a face image, as shown in fig. 4, the device includes: the analysis module 410 is used for analyzing a face skin image from the face image; a processing module 420, configured to obtain a luminance coefficient and a luminance nonuniformity coefficient of the face skin image; the evaluation module 430 is configured to determine the illumination quality of the face image according to the luminance coefficient and the luminance nonuniformity coefficient.
The device for determining the illumination quality of the face image, which is disclosed by the embodiment of the application, only focuses on the skin area of the face, and eliminates the interference of the illumination quality of other parts of the image on the illumination quality evaluation of the face image. In addition, when the illumination quality of the face image is determined, the illumination brightness intensity factor is considered, and the non-uniform factor of the illumination brightness of the face caused by illumination, human body posture and the like is also considered, so that the finally determined illumination quality is more accurate. Specifically, the method and the device eliminate the interference on illumination evaluation under the conditions that parts of illumination are possibly only connected with small parts of brightness and darkness caused by extremely strong light, and the difference between the brightness and the darkness is not two obvious areas.
In an exemplary embodiment, the processing module 410 includes:
the first processing module is used for dividing the histogram curve of the human face skin image into a bright area and a dark area according to a preset pixel threshold value;
a second processing module, configured to obtain the luminance coefficient and the luminance nonuniformity coefficient through the histogram curve, respectively, where the luminance nonuniformity coefficient is determined according to at least one of: a first coefficient for representing the difference between the brightness of the bright area and the brightness of the dark area, and a second coefficient for representing the difference between the areas of the bright area and the dark area.
Specifically, the bright area refers to an area where the pixel value of each corresponding pixel point in the histogram curve is greater than or equal to a preset pixel threshold; the dark area refers to an area where the pixel value of each corresponding pixel point in the histogram curve is smaller than a preset pixel threshold. The method for determining the preset pixel threshold is not limited in the present application, such as a maximum entropy method, a minimum cross entropy method, a maximum correlation method, a gray level entropy method, a maximum inter-class variance method, and the like. Preferably, a pixel threshold value T for distinguishing a bright area from a dark area can be searched by adopting a maximum inter-class variance method; for the dark area, the pixel value of each pixel point is less than T; for bright areas, the pixel value of each pixel point is greater than or equal to T.
Specifically, the histogram curve corresponding to the face skin image is divided into the bright area and the dark area, the face skin image is not firstly partitioned and then the partitioned areas are compared in the unevenness degree, the image partitioning is not limited, the unevenness degree of the face part is accurately described based on the distribution of the whole pixels, and the situations that the upper part, the lower part, the yin and the yang face and the like are not considered are avoided.
In an exemplary embodiment, the second processing module includes a luminance coefficient unit, including:
the first processing unit is used for calculating the mean value and the variance of the gray values of all the pixel points deviating from the central gray value based on the histogram curve;
and a second processing unit configured to use an absolute value of the mean value and the variance ratio as the luminance coefficient.
The smaller the luminance coefficient, the less the luminance value deviates from the central gray value. The brightness evaluation of the image is completed according to the whole histogram curve, and the dispersion degree of the brightness data distribution is measured through the brightness coefficient statistics so as to measure the degree of the brightness value deviating from the central gray value.
In an exemplary embodiment, the second processing module further includes a non-uniformity coefficient unit, which includes:
a third processing unit for determining a first pixel value and a second pixel value from the bright area and the dark area, respectively;
a fourth processing unit, configured to determine the first coefficient and the second coefficient respectively by combining the first pixel value, the second pixel value, and the preset pixel threshold.
The non-uniformity is judged by at least one index as follows: a first coefficient and a second coefficient. Wherein, the first coefficient is used for expressing the brightness difference between the bright area and the dark area, namely the contrast intensity of the illumination in the non-uniformity area; the second coefficient is used for representing the area difference between the bright area and the dark area, namely the proportion corresponding to the illumination of the uneven-degree area, through the two indexes, the misjudgment of uneven skin color on uneven light can be avoided, and the brightness contrast intensity of the uneven area can be measured on the basis of not being limited by image area division, so that the misjudgment of the uneven face skin color degree can be reduced.
In an exemplary embodiment, the uneven-coefficient processing unit further includes a first uneven-coefficient sub-unit including:
the first processing subunit is used for calculating a difference value between the first pixel value and the pixel threshold value to obtain a first difference;
the second processing subunit is configured to calculate a difference between the second pixel value and the pixel threshold to obtain a second difference;
a third processing subunit for determining the first coefficient by calculating an average of the first difference and the second difference.
The average distance of the distance threshold of the double wave crests is described by the first coefficient, the difference value between the pixel value of the point with the largest number of pixel values in the dark illumination area and the corresponding value in the bright illumination area is represented, the contrast intensity of illumination in the uneven area can be measured more accurately, and light unevenness misjudgment caused by slight skin color unevenness can be avoided. The peak of the highest area is adopted, the distance between the dark peak and the bright peak is larger when the first coefficient is larger, the contrast intensity of illumination is larger, and the image is more uneven.
In addition, the embodiment of the application also takes the ratio of the area of the bright area to the area of the dark area of the histogram curve as a second coefficient, which can accurately describe the proportion of core pixels of different human face skin colors, and avoid the adverse effect of long-tail pixels on the illumination uniformity of the face.
In an exemplary embodiment, the uneven-coefficient unit further includes a second uneven-coefficient sub-unit including:
a fourth processing subunit, configured to obtain, through the first pixel value, the second pixel value, and the preset pixel threshold, an area of the bright area and an area of the dark area respectively;
a fifth processing subunit, configured to use a ratio of the area of the bright region to the area of the dark region as the second coefficient.
The corresponding physical meaning of this application patent second coefficient is exactly the proportion that the different illumination of whole face corresponds, can reduce the influence of the bright and dark that even a small part extremely strong light caused to final unevenness when aassessment unevenness. The second coefficient is the area ratio of the bright area to the dark area, the range of the second coefficient is larger than 1, when the coefficient is just 1, the dark part and the bright part are just equal, the larger the second coefficient is, the larger the area of a certain area is, and the more uniform the illumination of the image is.
The method only focuses on the face skin color area, carries out face illumination quality evaluation without background interference, carries out face illumination uniformity evaluation according to the phenomenon that uneven illumination presents double peaks, and finally obtains the face illumination quality evaluation by combining with face brightness evaluation.
Embodiments of the present application further provide a computer-readable storage medium storing one or more programs, which are executable by one or more processors to implement the method according to any of the foregoing embodiments.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program; wherein the program when running performs the method of any one of the embodiments described above.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as is well known to those skilled in the art.

Claims (12)

1. A method for determining the illumination quality of a face image comprises the following steps:
analyzing a human face skin image from the human face image;
acquiring a brightness coefficient and a brightness unevenness coefficient of the human face skin image;
and determining the illumination quality of the face image according to the brightness coefficient and the brightness unevenness coefficient.
2. The method of claim 1,
acquiring a brightness coefficient and a brightness unevenness coefficient of the human face skin image, wherein the brightness coefficient and the brightness unevenness coefficient comprise the following steps:
dividing a histogram curve of the face skin image into a bright area and a dark area according to a preset pixel threshold;
respectively acquiring the brightness coefficient and the brightness unevenness coefficient through the histogram curve, wherein the brightness unevenness coefficient is determined according to at least one of the following:
a first coefficient for representing a difference in luminance between the bright area and the dark area, and a second coefficient for representing a difference in area between the bright area and the dark area.
3. The method of claim 2,
obtaining the brightness unevenness coefficient through the histogram curve, including:
determining a first pixel value and a second pixel value from the bright region and the dark region, respectively;
and combining the first pixel value, the second pixel value and the preset pixel threshold value to respectively determine the first coefficient and the second coefficient.
4. The method of claim 3,
determining first and second pixel values from the bright and dark regions, respectively, comprising:
and determining the pixel value with the most frequent occurrence in the bright area and the dark area, wherein the pixel value corresponding to the peak value of the histogram curve peak of the bright area is a first pixel value, and the pixel value corresponding to the peak value of the histogram curve peak of the dark area is a second pixel value.
5. The method of claim 3,
determining the first coefficient in combination with the first pixel value, the second pixel value, and the preset pixel threshold, including:
calculating a difference value between the first pixel value and the pixel threshold value to obtain a first difference;
calculating a difference value between the second pixel value and the pixel threshold value to obtain a second difference;
determining the first coefficient by calculating an average of the first difference and the second difference.
6. The method of claim 3,
determining the second coefficient in combination with the first pixel value, the second pixel value, and the preset pixel threshold, including:
respectively acquiring the area of the bright area and the area of the dark area through the first pixel value, the second pixel value and the preset pixel threshold;
and taking the ratio of the area of the bright area to the area of the dark area as the second coefficient.
7. The method of claim 6,
obtaining the area of the bright area and the area of the dark area, including:
calculating the first pixel value, the second pixel value, the minimum value in the difference value between the preset pixel threshold value and the pixel boundary value, and taking the minimum value as the peak value width;
taking the first pixel value as a central axis, and taking the area of histogram curve areas contained in a first left boundary and a first right boundary as the area of the bright area, wherein the distances between the first left boundary and the central axis and the distances between the first right boundary and the central axis are both the peak width;
and taking the second pixel value as a central axis, and taking the area of a histogram curve region contained by a second left boundary and a second right boundary as the area of the dark region, wherein the distances between the second left boundary and the central axis and the distances between the second right boundary and the central axis are both the peak width.
8. The method of claim 2,
obtaining the brightness coefficient through the histogram curve, including:
based on the histogram curve, calculating the mean value and the variance of the gray values of all the pixel points deviating from the central gray value;
and taking the absolute value of the ratio of the mean value to the variance as the brightness coefficient.
9. The method according to any one of claims 2 to 8,
the determining the illumination quality of the face image according to the brightness coefficient and the brightness unevenness coefficient comprises:
weighting and summing the luminance coefficient, the first coefficient, and the second coefficient;
and determining the illumination quality of the face image according to the summation result.
10. An apparatus for determining illumination quality of a face image, comprising:
the analysis module is used for analyzing a human face skin image from the human face image;
the processing module is used for acquiring a brightness coefficient and a brightness unevenness coefficient of the face skin image;
and the evaluation module is used for determining the illumination quality of the face image according to the brightness coefficient and the brightness nonuniformity coefficient.
11. A computer-readable storage medium, characterized in that the storage medium includes a stored program, wherein the program executes the method for determining the illumination quality of a face image according to any one of claims 1 to 9.
12. A processor, characterized in that the processor is configured to execute a program, wherein the program executes the method for determining the illumination quality of the face image according to any one of claims 1 to 9.
CN202211494122.1A 2022-11-25 2022-11-25 Method and device for determining illumination quality of face image and storage medium Pending CN115760816A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211494122.1A CN115760816A (en) 2022-11-25 2022-11-25 Method and device for determining illumination quality of face image and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211494122.1A CN115760816A (en) 2022-11-25 2022-11-25 Method and device for determining illumination quality of face image and storage medium

Publications (1)

Publication Number Publication Date
CN115760816A true CN115760816A (en) 2023-03-07

Family

ID=85338420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211494122.1A Pending CN115760816A (en) 2022-11-25 2022-11-25 Method and device for determining illumination quality of face image and storage medium

Country Status (1)

Country Link
CN (1) CN115760816A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117975344A (en) * 2024-04-02 2024-05-03 吉林省中农阳光数据有限公司 Method and device for identifying uniqueness of cow face

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117975344A (en) * 2024-04-02 2024-05-03 吉林省中农阳光数据有限公司 Method and device for identifying uniqueness of cow face

Similar Documents

Publication Publication Date Title
US7116820B2 (en) Detecting and correcting red-eye in a digital image
CN107346545A (en) Improved confinement growing method for the segmentation of optic cup image
CN106503644B (en) Glasses attribute detection method based on edge projection and color characteristic
CN116309559B (en) Intelligent identification method for production flaws of medium borosilicate glass
Lecca STAR: a segmentation-based approximation of point-based sampling Milano Retinex for color image enhancement
Lyudvichenko et al. A semiautomatic saliency model and its application to video compression
CN110276764A (en) K-Means underwater picture background segment innovatory algorithm based on the estimation of K value
US20200294206A1 (en) Method of providing a sharpness measure for an image
CN115760816A (en) Method and device for determining illumination quality of face image and storage medium
CN111507426A (en) No-reference image quality grading evaluation method and device based on visual fusion characteristics
CN117557820B (en) Quantum dot optical film damage detection method and system based on machine vision
CN103489167A (en) Automatic image sharpening method
CN112561878A (en) Finger vein image quality evaluation method based on weighted fusion
CN115423870A (en) Pupil center positioning method and device
CN111145155A (en) Meibomian gland recognition method
JP7234086B2 (en) Biometric information acquisition device and program
CN117197064A (en) Automatic non-contact eye red degree analysis method
EP3048580B1 (en) Method of extracting the optic disc of a retinal image
CN108876845A (en) The determination method and apparatus at Fresnel line center
CN112581461B (en) No-reference image quality evaluation method and device based on generation network
CN118430465B (en) Backlight compensation method and system for intelligent display screen and display screen
CN110751064A (en) Blink frequency analysis method and system based on image processing
CN110674828A (en) Method and device for normalizing fundus images
CN118247277B (en) Self-adaptive enhancement method for lung CT image
CN117974645B (en) Bronchoscope image processing method based on computer vision

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination