A method of exposure statistics based on face
By combining image data processing and face detection in facial recognition technology, and using adaptive exposure adjustment methods, the problem of inaccurate brightness evaluation in the existing technology is solved, accurate exposure control in complex scenarios is achieved, and the Identify accuracy.
Patent Information
- Application Number
- CN202110829650.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-22
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2041-07-22
AI Technical Summary
In the prior art, facial recognition technology cannot accurately adjust the exposure range of the area of interest (face area) when evaluating the brightness of the picture, especially when the scene is complex and changeable or the brightness of the background and face are large, resulting in light metering. The accuracy of the control is affected.
Capture image data through the camera, perform normalization processing and histogram information statistics, set partition parameters to adjust the initial global statistical brightness, and combine face detection and skin color detection, use scene adaptive methods to adjust exposure to reduce background interference, ensuring that Brightness accuracy.
Accurate exposure statistics on face areas in complex scenes are achieved, background interference is reduced, exposure accuracy and adaptability are improved, and brightness flickering problems are avoided.
Smart Images

Figure CN113591649B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automatic exposure technology, and in particular to an exposure statistics method based on human face. Background Art
[0002] With the continuous advancement of science and technology, facial recognition technology, a biotechnology that identifies people based on their facial features, has been widely used in many neighborhood scenarios such as security, finance, transportation, education, and medical care.
[0003] In the prior art, face recognition technology has the following deficiencies: 1. Conventional exposure algorithms cannot accurately evaluate the appropriate brightness range of the image based only on the global information statistics of the image; 2. The photometry method cannot accurately characterize the region of interest (face area) to adjust the exposure to a reasonable range; 3. When the scene is complex and changeable, it is not possible to accurately perform a reasonable photometry control method according to established standards and methods; 4. Based on the face exposure method, relying on face detection technology, determining the range where the face is located cannot completely eliminate the interference of the background area. When the background and face brightness areas are very different, the accuracy of photometry is seriously affected. In view of the shortcomings of the prior art, the present invention provides an accurate and effective face exposure statistics method. Summary of the invention
[0004] 1. Technical issues to be solved
[0005] In view of the deficiencies in the prior art, the present invention discloses a face-based exposure statistics method to solve the problems raised in the above background technology.
[0006] (II) Technical solution
[0007] To achieve the above objectives, the present invention is implemented through the following technical solutions: a face-based exposure statistics method, comprising the following steps:
[0008] Step S1, firstly, the camera captures image data;
[0009] Step S2, normalize the image, quantize it to 0-255, count the histogram information of the image, calculate the information entropy of the image, and record the pixel value when the information entropy of the image is maximum as the initial global statistical brightness;
[0010] Step S3, setting partition parameters: pixel brightness threshold and number threshold of underexposed area, pixel brightness threshold and number threshold of normal area, pixel brightness threshold and number threshold of overexposed area, and counting the number of pixels in the dark area, bright area and normal area of the histogram according to the partition parameters;
[0011] Step S4, adjusting the initial reference brightness according to the number of pixels in the overexposed and underexposed areas. When the number of pixels in the underexposed area is greater than the set threshold, the global statistical brightness is increased; when the number of pixels in the overexposed area is greater than the set threshold, the global statistical brightness is reduced; when there are both underexposed and overexposed areas in the picture, the global statistical brightness is appropriately increased or decreased according to the number of underexposed and overexposed pixels to achieve scene adaptation. When the scene is complex and changeable, a suitable global statistical brightness is provided for brightness statistics in most scenes or in an unmanned state, which is used as the final global statistical brightness v1;
[0012] Step S5, performing face detection on the image, acquiring pixels of the face detected near the face frame, arranging the histogram, and setting two thresholds, a dark threshold and a bright threshold;
[0013] Step S6, performing skin color detection and classification on the pixel points counted in step S5. Since the face detection frame captures the pixels at the face position, it also contains the information of the background frame. If the brightness difference between the background and the face is too large, it will also cause misjudgment. Therefore, the pixel points are converted from the RGB domain to the YUV domain, and the component U is used as the threshold for skin color judgment. If the U component of the pixel point is within the set range, it is considered that the pixel point is a face area rather than a background area, so as to calculate the brightness mean value v2 of the face;
[0014] Step S7, in step S4, the final global statistical brightness v1 is obtained, and the statistical brightness of the face area obtained in step S6 is recorded as v2. In order to prevent the face area from having a significant impact on the statistics of the picture and causing problems such as flickering, the statistical brightness ratio of the face is controlled so that the final brightness statistics Y=v1*0.7+v2*0.3 when the face is detected. At this time, the exposure is adjusted based on the comparison between the current brightness Y and the target value until the current actual brightness Y is consistent with the target value or is within the error setting range.
[0015] Step S8, if the exposure information and brightness information v1 have not changed, and no face is detected, there is no need to refresh the brightness statistics function. If the environment changes significantly or a face is detected, the brightness is refreshed again, and the current Y is compared with the target value to continuously complete the iteration.
[0016] Preferably, in step S3, the partition parameters are adjusted accordingly according to the actual scenario.
[0017] Preferably, in step S5, brightness below the dark threshold and brightness above the bright threshold are excluded to prevent statistics of over-bright and over-dark data and to prevent impact on facial baseline brightness statistics.
[0018] Preferably, in step S7, if the brightness of the face is not detected in the picture, then the brightness statistics of the picture are Y=v1, and only the information of v1 is used as the statistical value.
[0019] The present invention discloses a face-based exposure statistics method, which has the following beneficial effects:
[0020] 1. The face-based exposure statistics method adopts the method of the present invention. Compared with the existing exposure methods, it can adapt to the scene and provide appropriate statistical brightness when the scene is complex and changeable. It can perform reasonable exposure according to the information of the area of interest (face area), and can effectively eliminate the brightness error caused by the large difference between the background and the face, thereby improving the accuracy and adaptability of exposure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is the overall system structure diagram of the present invention;
[0022] Figure 2 is a calculation structure diagram of the global brightness of the present invention;
[0023] Figure 3 This is a statistical structure diagram of face brightness of the present invention. DETAILED DESCRIPTION
[0024] Embodiment 1:
[0025] The embodiment of the present invention discloses a method for statistical exposure based on human face, such as Figure 1-3 As shown, the following steps are included:
[0026] Step S1, firstly, the camera captures image data;
[0027] Step S2, normalize the image, quantize it to 0-255, count the histogram information of the image, calculate the information entropy of the image, and record the pixel value when the information entropy of the image is maximum as the initial global statistical brightness;
[0028] The pixel value when the information entropy of the image is maximum is recorded as Y_target, which is the initial global statistical brightness. The information entropy calculation formula is as follows:
[0029] Step S3, setting partition parameters: pixel brightness threshold and number threshold of underexposed area, pixel brightness threshold and number threshold of normal area, pixel brightness threshold and number threshold of overexposed area, and counting the number of pixels in the dark area, bright area and normal area of the histogram according to the partition parameters;
[0030] The pixel brightness and number thresholds N1 and Y1 in the underexposed area, the pixel brightness and number thresholds N2 and Y2 in the normal area, and the pixel brightness and number thresholds N3 and Y3 in the overexposed area are counted according to the initial parameters and recorded as nu1, nu2, and nu3 in the underexposed area, normal area, and overexposed area of the histogram. The parameters N1, Y1, N2, Y2, N3, and Y3 can be adjusted according to the actual scene. Generally, N2 is much larger than N1 and N3.
[0031] Step S4, adjusting the initial reference brightness according to the number of pixels in the overexposed and underexposed areas. When the number of pixels in the underexposed area is greater than the set threshold, the global statistical brightness is increased; when the number of pixels in the overexposed area is greater than the set threshold, the global statistical brightness is reduced; when there are both underexposed and overexposed areas in the picture, the global statistical brightness is appropriately increased or decreased according to the number of underexposed and overexposed pixels to achieve scene adaptation. When the scene is complex and changeable, a suitable global statistical brightness is provided for brightness statistics in most scenes or in an unmanned state, which is used as the final global statistical brightness v1;
[0032]
[0033] The following formula is used to calculate the final global statistical brightness v1 of the image. When the number of pixels in the underexposed area is greater than the set threshold, the baseline brightness is increased. When the number of pixels in the overexposed area is greater than the set threshold, the baseline brightness is reduced. When there are both underexposed and overexposed areas in the picture, the global statistical brightness is appropriately increased or decreased according to the number of underexposed and overexposed pixels to achieve scene adaptation. When the scene is complex and changeable, it can also provide appropriate global statistical brightness for brightness statistics in most scenes or in unmanned states.
[0034] Step S5, performing face detection on the image, acquiring pixels of the face detected near the face frame, arranging the histogram, and setting two thresholds, a dark threshold and a bright threshold;
[0035] If a face is detected, the pixels in the face frame are extracted for statistics. A low threshold and a high threshold for brightness are set according to the needs to prevent the brightness from being too low or too high, which will affect the final statistical information.
[0036] Step S6, performing skin color detection and classification on the pixel points counted in step S5. Since the face detection frame captures the pixels at the face position, it also contains the information of the background frame. If the brightness difference between the background and the face is too large, it will also cause misjudgment. Therefore, the pixel points are converted from the RGB domain to the YUV domain, and the component U is used as the threshold for skin color judgment. If the U component of the pixel point is within the set range, it is considered that the pixel point is a face area rather than a background area, so as to calculate the brightness mean value v2 of the face;
[0037] 6. Distinguish the background and face of the pixels counted in 5, and use the skin color information to distinguish. First, perform RGB2YUV conversion, and obtain the Y, U, and V values of the statistical pixels according to the following formula.
[0038] Y=0.299R+0.587G+0.114B
[0039] U=-0.1687R-0.3313G+0.5B+128
[0040] V=0.5R-0.4187G-0.0813B+128
[0041] Step S7, in step S4, the final global statistical brightness v1 is obtained, and the statistical brightness of the face area obtained in step S6 is recorded as v2. In order to prevent the face area from having a significant impact on the statistics of the picture and causing problems such as flickering, the statistical brightness ratio of the face is controlled so that the final brightness statistics Y=v1*0.7+v2*0.3 when the face is detected. At this time, the exposure is adjusted based on the comparison between the current brightness Y and the target value until the current actual brightness Y is consistent with the target value or is within the error setting range.
[0042] A reasonable skin color threshold is set according to component U, and all points that meet the conditions are extracted as face statistics information. The actual skin color U value is read in the range of (82,142) through image color reading software. Therefore, (82,142) is used as the skin color threshold, and all pixels that meet the conditions are extracted. The pixels that meet the conditions are face areas and are used for face statistics information. The mean value of the pixels in the face area is recorded as the face area brightness statistics V2.
[0043] Step S8, if the exposure information and brightness information v1 have not changed, and no face is detected, there is no need to refresh the brightness statistics function. If the environment changes significantly or a face is detected, the brightness is refreshed again, and the current Y is compared with the target value to continuously complete the iteration.
[0044] In step S3, the partition parameters are adjusted accordingly according to the actual scenario.
[0045] In step S5, brightness below the dark threshold and brightness above the bright threshold are excluded to prevent statistics of over-bright and over-dark data and to prevent the impact on the face baseline brightness statistics.
[0046] In step S7, if the brightness of the face is not detected in the picture, then the brightness statistics of the picture are Y=v1, and only the information of v1 is used as the statistical value.
[0047] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A face-based exposure statistics method, characterized in that: The following steps are involved: Step S1, firstly, the camera captures image data; Step S2, normalize the image, quantize it to 0-255, count the histogram information of the image, calculate the information entropy of the image, and record the pixel value when the information entropy of the image is maximum as the initial global statistical brightness; Step S3, setting partition parameters: pixel brightness threshold and number threshold of underexposed area, pixel brightness threshold and number threshold of normal area, pixel brightness threshold and number threshold of overexposed area, and counting the number of pixels in the dark area, bright area and normal area of the histogram according to the partition parameters; Step S4, adjusting the initial reference brightness according to the number of pixels in the overexposed and underexposed areas. When the number of pixels in the underexposed area is greater than the set threshold, the global statistical brightness is increased; when the number of pixels in the overexposed area is greater than the set threshold, the global statistical brightness is reduced; when there are both underexposed and overexposed areas in the picture, the global statistical brightness is appropriately increased or decreased according to the number of underexposed and overexposed pixels to achieve scene adaptation. When the scene is complex and changeable, a suitable global statistical brightness is provided for brightness statistics in most scenes or in an unmanned state, which is used as the final global statistical brightness v1; Step S5, performing face detection on the image, acquiring pixels of the face detected near the face frame, arranging the histogram, and setting two thresholds, a dark threshold and a bright threshold; Step S6, performing skin color detection and classification on the pixel points counted in step S5. Since the face detection frame captures the pixels at the face position, it also contains the information of the background frame. If the brightness difference between the background and the face is too large, it will also cause misjudgment. Therefore, the pixel points are converted from the RGB domain to the YUV domain, and the component U is used as the threshold for skin color judgment. If the U component of the pixel point is within the set range, it is considered that the pixel point is a face area rather than a background area, so as to calculate the brightness mean value v2 of the face; Step S7, in step S4, the final global statistical brightness v1 is obtained, and the statistical brightness of the face area obtained in step S6 is recorded as v2. In order to prevent the face area from having a significant impact on the statistics of the picture and causing problems such as flickering, the statistical brightness ratio of the face is controlled so that the final brightness Y when the face is detected is v1*0.7+v2*0.
3. At this time, the exposure is adjusted based on the comparison between the current brightness Y and the target value until the current actual brightness Y is consistent with the target value or within the error setting range; Step S8: If the exposure information and brightness information v1 have not changed, and no face is detected, then there is no need to refresh the brightness statistics function. If the environment changes greatly or a face is detected, the brightness is refreshed again, and the current Y is compared with the target value to continuously complete the iteration; The pixel brightness and number thresholds N1 and Y1 in the underexposed area, the pixel brightness and number thresholds N2 and Y2 in the normal area, and the pixel brightness and number thresholds N3 and Y3 in the overexposed area are counted according to the initial parameters and recorded as nu1, nu2, and nu3 in the underexposed area, normal area, and overexposed area of the histogram; the parameters N1, Y1, N2, Y2, N3, and Y3 can be adjusted according to the actual scene, and generally N2 is much larger than N1 and N3; Step S4, adjusting the initial reference brightness according to the number of pixels in the overexposed and underexposed areas. When the number of pixels in the underexposed area is greater than the set threshold, the global statistical brightness is increased; when the number of pixels in the overexposed area is greater than the set threshold, the global statistical brightness is reduced; when there are both underexposed and overexposed areas in the picture, the global statistical brightness is appropriately increased or decreased according to the number of underexposed and overexposed pixels to achieve scene adaptation. When the scene is complex and changeable, a suitable global statistical brightness is provided for brightness statistics in most scenes or in an unmanned state, which is used as the final global statistical brightness v1; 2. The face-based exposure statistics method according to claim 1, characterized in that: In step S3, the partition parameters are adjusted accordingly according to the actual scenario.
3. The face-based exposure statistics method according to claim 1, characterized in that: In step S5, brightness below the dark threshold and brightness above the bright threshold are excluded to prevent statistics of over-bright and over-dark data and to prevent the impact on the face baseline brightness statistics.
4. The face-based exposure statistics method according to claim 1, characterized in that: In step S7, if the brightness of the face is not detected in the picture, then the brightness statistics of the picture are Y=v1, and only the information of v1 is used as the statistical value.
Citation Information
Patent Citations
Character image processing method and device
CN109862282A
A control method based on face region exposure
CN109918993A
Exposure method and system
CN112446249A
