Exposure control method and device, electronic equipment and storage medium
A technology for exposure control and exposure parameters, which is applied in the field of image processing and can solve problems such as inaccurate exposure control.
Active Publication Date: 2021-08-31
ZHEJIANG DAHUA TECH
13 Cites 3 Cited by
AI-Extracted Technical Summary
Problems solved by technology
[0003] Embodiments of the present invention provide an exposure control method, device, electronic...
Method used
In the computer-readable storage medium that provides in the embodiment of the present invention, computer program is stored, and when computer program is executed by processor, realizes that image is carried out face detection by face detection algorithm, obtains face region; Determine described people The pixel average value of the Y, U, V three channels of the face area, according to the pixel average value of the Y, U, V three channels to determine the brightness value on the RGB domain; according to the brightness value on the RGB domain and the preset The target brightness value determines the exposure parameter adjustment amount, and performs exposure control based on the exposure parameter adjustment amount. In the embodiment of the present invention, according to the luminance value on the RGB domain and the preset target luminance value, the adjustment amount of the exposure parameter is determined, and the exposure control is performed based on the adjustment amount of the exposure parameter, thereby improving the accuracy of the exposure control. At the same time, the problem of low accuracy of exposure adjustment caused by exposure parameters actually acting on the Raw domain is avoided.
In the embodiment of the present invention, when the processor executes the stored program on the memory, it is realized that the face detection is carried out to the image by the face detection algorithm to obtain the face area; determine the Y, U, V of the face area The pixel average value of the three channels, determine the brightness value on the RGB domain according to the pixel average value of the Y, U, V three channels; determine the exposure parameter adjustment according to the brightness value on the RGB domain and the preset target brightness value An amount, and exposure control is performed based on the exposure parameter adjustment amount. In the embodiment of the present invention, according to the luminance value on the RGB domain and the preset target luminance value, the adjustment amount of the exposure parameter is determined, and the exposure control is performed based on the adjustment amount of the exposure parameter, thereby improving the accuracy of the exposure control. At the same time, the problem of low accuracy of exposure adjustment caused by exposure parameters actually acting on the Raw domain is avoided.
Obtain the G value of RGB domain according to the statistical value of YUV domain according to conversion formula, then obtain corresponding brightness value according to Gamma table anti-mapping, compare this brightness value with target brightness value again and determine exposure adjustment amount. Compared with patent 1, directly using the YUV statistical value to compare the target brightness to determine the exposure adjustment amount is more in line with the actual exposure adjustment amount required by the image on the Raw domain, and improves the exposure accuracy; the formula used for converting YUV to RGB is not limited to the one used in this case The enumerated formulas and all variations derived therefrom are also protected in this case.
The embodiment of the present invention converts YUV statistical luminance value to RGB domain, and obtai...
Abstract
The invention discloses an exposure control method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the face detection of an image through a face detection algorithm to obtain a face region; determining a pixel average value of three channels of Y, U and V of the face area, and determining a brightness value on an RGB domain according to the pixel average value of the three channels of Y, U and V; determining an exposure parameter adjustment amount according to the brightness value on the RGB domain and a preset target brightness value, and performing exposure control based on the exposure parameter adjustment amount. According to the embodiment of the invention, the exposure parameter adjustment amount is determined according to the brightness value on the RGB domain and the preset target brightness value, and exposure control is carried out based on the exposure parameter adjustment amount, so the accuracy of exposure control is improved; meanwhile, the problem of relatively low accuracy of exposure adjustment caused by the fact that exposure parameters actually act on the Raw domain is avoided.
Application Domain
Television system detailsColor television details
Technology Topic
ExposureReal-time computing +5
Image
Examples
- Experimental program(8)
Example Embodiment
[0061] Example 1:
[0062] figure 1 A schematic diagram of the exposure control process provided by the embodiment of the present invention, the process includes the following steps:
[0063] S101: Perform face detection on the image through a face detection algorithm to obtain a face area.
[0064] S102: Determine the pixel average value of the Y, U, V three channels of the human face area, and determine the brightness value on the RGB domain according to the pixel average value of the Y, U, V three channels.
[0065] S103: Determine an exposure parameter adjustment amount according to the brightness value on the RGB domain and a preset target brightness value, and perform exposure control based on the exposure parameter adjustment amount.
[0066] The exposure control method provided by the embodiment of the present invention is applied to an electronic device, and the electronic device may be a PC, a tablet computer, etc., or an image acquisition device such as a camera. If the electronic device is a device such as a PC or a tablet computer, the camera sends the captured image to the electronic device, and the electronic device intelligently analyzes the image to control the exposure of the camera. If the electronic device is a camera, after the camera collects the image, it realizes exposure control by intelligently analyzing the image.
[0067] When the electronic device performs exposure control, for the acquired image, it first detects the face of the image through the face detection algorithm. The face detection algorithm generally obtains a rectangular area including the entire face, and the rectangle can be region as the face region.
[0068] After the electronic device determines the face area, it separately determines the pixel values of the Y, U, and V channels of each pixel in the face area. Then, according to the pixel value of each pixel point Y, U, V three channels in the face area and the number of pixels in the face area, the pixel average value of the Y, U, V three channels of the face area is determined. Take the determination of the pixel average value of the Y channel as an example for illustration. The calculation formula is: avgY=sumY/sumPixels; where, avgY represents the pixel average value of the Y channel, sumY represents the sum of Y values of all pixels in the face area, and sumPixels represents the total number of pixels in the face area. The process of determining the average value of pixels in the U and V channels of the face area is similar to the above formula and will not be repeated here.
[0069] After determining the pixel average of the Y, U, and V channels of the face area, determine the brightness value on the RGB domain according to the pixel average of the Y, U, and V channels. For example, the electronic device pre-stores the pixel value ranges of the three channels Y, U, and V corresponding to the luminance values on different RGB domains, and then determines the human The pixel value ranges to which the pixel averages of the Y, U, and V channels of the face area belong respectively, and then determine the brightness value on the RGB domain according to the pre-saved correspondence.
[0070] The preset target brightness value is stored in the electronic device. After the brightness value on the RGB domain is determined, the exposure parameter adjustment amount is determined according to the brightness value on the RGB domain and the preset target brightness value, and then the adjustment amount of the exposure parameter is determined at the current exposure parameter Basically, the exposure parameters are adjusted according to the adjustment amount of the exposure parameters, so as to realize the exposure control. Wherein, the process of determining the adjustment amount of the exposure parameter according to the luminance value of the face area and the preset target luminance value belongs to the prior art, and will not be repeated here.
[0071] In the embodiment of the present invention, by counting the average value of the face area pixels on the YUV domain, and then mapping the average value of the face area pixels on the YUV domain to the brightness value on the RGB domain, the brightness value on the RGB domain is more in line with the actual brightness, according to The brightness value on the RGB domain and the preset target brightness value determine the adjustment amount of the exposure parameter, and perform exposure control based on the adjustment amount of the exposure parameter, thereby improving the accuracy of the exposure control. At the same time, the problem of low accuracy of exposure adjustment caused by exposure parameters actually acting on the Raw domain is avoided.
Example Embodiment
[0072] Example 2:
[0073] Face detection is performed on the image through the face detection algorithm, and the obtained face area is a rectangular area of the face, and the face generally only occupies the middle part of the rectangular area. If the brightness statistics are performed on the pixels in the entire rectangular area, the brightness of the background pixels will be introduced, which will increase the statistical brightness error and cause inaccurate exposure control. In order to solve the above-mentioned technical problems, on the basis of the above-mentioned embodiments, in the embodiment of the present invention, the face detection is performed on the image through the face detection algorithm, and the obtained face area includes:
[0074] Use the face detection algorithm to detect the face of the image to obtain the rectangular area of the face;
[0075] An area of a preset size in the central part of the rectangular area of the human face is used as the area of the human face.
[0076] In the embodiment of the present invention, firstly, face detection is performed on an image by a face detection algorithm to obtain a rectangular area of a human face; then, an area of a preset size in the center of the rectangular area of a human face is selected as the human face area. When selecting, the central pixel point of the rectangular area of the human face can be determined first, and then the human face area is still determined centering on the central pixel point. That is to say, the center pixel point of the face area and the center pixel point of the face rectangular area are the same pixel point. The area of the preset size in the embodiment of the present invention may be an area occupying a preset ratio of the rectangular area of the human face, and the preset ratio may be one fourth, one third, and so on. That is, the rectangular face area is reduced according to a preset ratio to obtain the final face area. Preferably, the aspect ratio of the face area is the same as the aspect ratio of the rectangular area of the face.
[0077] Because in the embodiment of the present invention, firstly, face detection is performed on the image by a face detection algorithm to obtain a rectangular face area; The brightness influence of background pixels is reduced, thereby improving the accuracy of exposure control.
Example Embodiment
[0078] Example 3:
[0079] In order to make the determination of the brightness value on the RGB domain more accurate, on the basis of the above-mentioned embodiments, in the embodiment of the present invention, the determination of the brightness on the RGB domain according to the pixel average value of the three channels of Y, U and V Values include:
[0080] According to the pixel average of the Y, U, and V three channels and the YUV to RGB formula, the G value of the RGB domain is obtained;
[0081] Determine the first multiple relationship between the G value bit of the RGB domain and the Gamma table value domain bit, and determine the G' value corresponding to the G value of the RGB domain according to the first multiple relationship;
[0082] Using the G' value as an input value, look up the Index value corresponding to the G' value in the Gamma table;
[0083] Determine the second multiple relationship between the Index value bit and the bit used by the exposure algorithm to calculate the brightness, and determine the brightness value on the RGB domain corresponding to the Index value according to the second multiple relationship.
[0084] In the embodiment of the present invention, the electronic device determines the G value of the RGB domain according to the YUV to RGB formula G=avgY-0.3455*(avgU-128)-0.7169*(avgV-128). In the formula, avgY represents the pixel average value of the Y channel, avgU represents the pixel average value of the U channel, and avgV represents the pixel average value of the V channel. G represents the G value of the RGB domain.
[0085] The electronic device obtains the G value bit of the RGB domain and the Gamma table value field bit. And determine the G value bit of the RGB domain and the first multiple relationship of the Gamma table value domain bit, combine the above-mentioned first multiple relationship on the basis of the G value of the RGB domain, determine the G' value corresponding to the G value of the RGB domain. If the first multiple relationship is the ratio of the bits in the Gamma table value domain to the G value bits in the RGB domain, then multiply the G value in the RGB domain by the first multiple relationship to obtain the G' value.
[0086] There are different Index values corresponding to different G' values in the pre-saved Gamma table of the electronic device, and then the G' value is used as an input value, and the Index value corresponding to the G' value is searched in the Gamma table. Generally, as the G' value increases, the corresponding Index value also increases.
[0087] Finally, the electronic device obtains the bit of the Index value and the bit used by the exposure algorithm to calculate the brightness, then determines the second multiple relationship between the bit of the Index value and the bit used by the exposure algorithm to calculate the brightness, and determines the corresponding index value according to the second multiple relationship. The brightness value on the RGB domain. If the second multiplier relationship is the ratio of the bits used by the exposure algorithm to calculate the brightness and the Index value bits, the Index value is multiplied by the second multiplier relationship to obtain the brightness value in the RGB domain.
[0088] In the embodiment of the present invention, first, according to the pixel average value of the three channels of Y, U, and V and the YUV-to-RGB formula, the G value in the RGB domain is obtained, and then the G value bit is aligned with the currently used Gamma table value field Bit. Obtain G'; then use the search method to use G' as an input value, and find the Index value corresponding to the corresponding value from the Gamma table; finally align the Index value bit with the bit used by the exposure algorithm to calculate the brightness, and obtain the final Brightness value on the RGB domain. The luminance value in the RGB domain determined by the solution provided by the embodiment of the present invention is more consistent with the actual luminance, therefore, the luminance value in the RGB domain determined in the embodiment of the present invention is more accurate.
PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.