Automatic exposure method, terminal, storage medium and program product

By using brightness distribution information to correct the brightness characterization information during the automatic exposure process, the exposure inaccuracy caused by high image contrast is solved, and the exposure accuracy and the suitability of image brightness are improved.

CN118574008BActive Publication Date: 2025-05-02HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411056434.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2025-05-02
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

In the automatic exposure process, especially when the image contrast is high, the prior art can easily lead to inaccurate exposure and problems such as overexposure or insufficient exposure.

Method used

By obtaining the brightness distribution information of the image, the correction parameters of the brightness characterization information of the image area are determined, and the exposure parameters are adjusted to acquire more accurate images.

Benefits of technology

The exposure accuracy is improved, and the impact of high contrast on exposure parameter adjustment is reduced, making the brightness of the acquired image more suitable for human eyes to view.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118574008B_ABST
    Figure CN118574008B_ABST
Patent Text Reader

Abstract

The present application provides an automatic exposure method, terminal, storage medium and program product, which relates to the field of image processing technology. The method includes: obtaining a first image acquired according to a first exposure parameter; obtaining brightness characterization information of an image area set in the first image; obtaining brightness distribution information of the first image based on the obtained brightness characterization information; determining a correction parameter of the brightness characterization information of the image area according to the brightness distribution information; correcting the brightness characterization information of the image area according to the correction parameter corresponding to the image area; adjusting the first exposure parameter according to the corrected brightness characterization information and the reference brightness characterization information, and acquiring a second image according to the adjusted first exposure parameter. Applying the automatic exposure scheme provided by the present application can improve the exposure accuracy when acquiring images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an automatic exposure method, terminal, storage medium and program product. Background Art

[0002] The camera components inside devices like mobile phones and tablets include lenses and photosensitive elements. When a terminal uses the camera component to capture an image, light passes through the lens and strikes the photosensitive element. The amount of light received by the photosensitive element is called exposure. Exposure is determined by parameters such as exposure time, aperture size, and gain. A higher exposure results in a brighter image; conversely, a lower exposure results in a lower brightness.

[0003] The terminal generally has an automatic exposure function. After the automatic exposure function is turned on, the terminal can autonomously control the above exposure parameters according to the brightness of the currently collected image, thereby adjusting the exposure to an appropriate range. The brightness of the image collected according to the adjusted exposure parameters is suitable for human viewing. This can be called accurate exposure.

[0004] However, when the contrast of the currently acquired image is high, it is easy to cause the brightness of the image acquired according to the adjusted exposure parameters to be too high (overexposure) or too low (underexposure), that is, inaccurate exposure. Summary of the Invention

[0005] In view of this, the present application provides an automatic exposure method, terminal, storage medium and program product to improve the exposure accuracy when capturing images.

[0006] In a first aspect, an embodiment of the present application provides an automatic exposure method, comprising:

[0007] Obtaining a first image captured according to first exposure parameters;

[0008] Obtaining brightness representation information of a set image area in the first image;

[0009] Obtaining brightness distribution information of the first image based on the obtained brightness representation information;

[0010] determining, based on the brightness distribution information, correction parameters for brightness representation information of the image area;

[0011] Correcting the brightness representation information of the image area according to the correction parameters corresponding to the image area;

[0012] The first exposure parameter is adjusted according to the corrected brightness representation information and the reference brightness representation information, and the second image is captured according to the adjusted first exposure parameter.

[0013] As can be seen from the above, when automatic exposure is performed using the solution provided in the embodiments of the present application, after capturing a first image according to first exposure parameters, the first exposure parameters are not adjusted directly based on the brightness representation information of the image region in the first image. Instead, the brightness distribution information of the first image is taken into account and the brightness representation information of the image region in the first image is corrected based on the brightness distribution information. This correction can reduce the interference caused by the brightness distribution in the first image on subsequent adjustment of the exposure parameters, making the corrected brightness representation information more suitable for subsequent adjustment of the exposure parameters. Furthermore, in the case of high contrast in the first image, the impact of high contrast on subsequent adjustment of the exposure parameters can also be reduced, making the adjustment of the first exposure parameters more reasonable, reducing the possibility of underexposure or overexposure in the second image captured according to the adjusted exposure parameters, making the brightness of the second image more suitable for human viewing, and improving exposure accuracy.

[0014] In one embodiment of the present application, if a first proportion of a first image area represented by the brightness distribution information is greater than a second proportion of a second image area, the correction parameter corresponding to the first image area is used to reduce the brightness representation information of the first image area, wherein the first image area is an image area whose brightness representation information is greater than a first brightness threshold, and the second image area is an image area whose brightness representation information is less than a second brightness threshold;

[0015] If the brightness distribution information indicates that the first proportion is smaller than the second proportion, the correction parameter corresponding to the first image area is used to increase the brightness representation information of the first image area.

[0016] It can be seen that in this way, based on the relationship between the proportion of bright areas and the proportion of dark areas in the first image, the correction parameters for increasing or decreasing the brightness of the bright areas can be adaptively determined. After adjusting the brightness representation information according to the correction parameters, the adverse effects of excessively large or small bright areas on subsequent adjustment of exposure parameters can be reduced, making the exposure parameters determined according to the adjusted brightness representation information more reasonable and accurate.

[0017] In one embodiment of the present application, if a first proportion of a first image area represented by the brightness distribution information is greater than a second proportion of a second image area, the correction parameter corresponding to the second image area is used to increase the brightness representation information of the second image area, wherein the first image area is an image area whose brightness representation information is greater than a first brightness threshold, and the second image area is an image area whose brightness representation information is less than a second brightness threshold;

[0018] If the brightness distribution information indicates that the first proportion is smaller than the second proportion, the correction parameter corresponding to the second image area is used to reduce the brightness representation information of the second image area.

[0019] It can be seen that in this way, based on the relationship between the proportion of bright areas and the proportion of dark areas in the first image, the correction parameters used to increase or decrease the brightness of the dark areas can be adaptively determined. After adjusting the brightness representation information according to the correction parameters, the adverse effects of the dark area being too large or too small on the subsequent adjustment of the exposure parameters can be reduced, so that the exposure parameters determined according to the adjusted brightness representation information are more reasonable and accurate.

[0020] In one embodiment of the present application, determining, based on the brightness distribution information, a correction parameter for the brightness representation information of the image area includes:

[0021] Determine a target correction array based on the brightness distribution information, wherein a mapping relationship exists between an index of the target correction array and the brightness representation information, and an element in the target correction array represents an adjustment weight corresponding to the brightness representation information. If the brightness distribution information represents that the first proportion is greater than the second proportion, then the element corresponding to the first category index of the target correction array is smaller than the element corresponding to the second category index. If the brightness distribution information represents that the first proportion is smaller than the second proportion, then the element corresponding to the first category index is larger than the element corresponding to the second category index. The first category index is: an index of the brightness representation information mapping of the first image area, and the second category index is: an index of the brightness representation information mapping of the second image area.

[0022] Based on the element corresponding to the target index in the target correction array, a correction parameter corresponding to the brightness representation information of the image area is determined, wherein the target index is: an index of the brightness representation information mapping of the image area.

[0023] As can be seen from the above, in this embodiment, a target correction array is determined based on brightness distribution information. A mapping relationship exists between the index of the target correction array and the brightness representation information. The elements in the target correction array represent adjustment weights corresponding to the brightness representation information, and the size of the elements in the target correction array is related to the brightness distribution information. Specifically, when the brightness distribution indicates that the proportion of bright areas in the first image is relatively large, the adjustment weights corresponding to the bright areas in the target correction array are used to reduce the brightness of the bright areas, and the adjustment weights corresponding to the dark areas are used to increase the brightness of the dark areas. When the brightness distribution indicates that the proportion of dark areas in the first image is relatively large, the adjustment weights corresponding to the bright areas in the target correction array are used to increase the brightness of the bright areas, and the adjustment weights corresponding to the dark areas are used to reduce the brightness of the dark areas. In this way, when determining correction parameters based on the target correction array, correction parameters for adjusting the brightness representation information of bright and dark areas can be determined separately for high-contrast images. This reduces the impact of large bright or dark areas in the image on subsequent adjustment of exposure parameters, making the adjustment of the first exposure parameters more reasonable and accurate, and improving exposure accuracy.

[0024] In one embodiment of the present application, determining a target correction array based on the brightness distribution information includes:

[0025] If the brightness distribution information indicates that the first image is an extremely bright image, the first initial correction array is directly determined as the target correction array, wherein the extremely bright image is: an image in which the first proportion is greater than a first determination threshold, and the element corresponding to the first category index of the first initial correction array is smaller than the element corresponding to the second category index.

[0026] When the brightness distribution information characterizes that the first image is an extremely bright image, the first initial correction array is directly determined as the target correction array. Based on the target initial correction array, correction parameters for reducing the brightness of the bright area and increasing the brightness of the dark area can be determined. That is, the brightness of the bright area in the extremely bright image is suppressed and the brightness of the dark area in the extremely bright image is increased. This is equivalent to performing brightness correction on the extremely bright image, reducing the impact of large-area bright areas in the image on subsequent adjustment of exposure parameters.

[0027] In one embodiment of the present application, determining a target correction array based on the brightness distribution information includes:

[0028] If the brightness distribution information characterizes that the first image is an image transitioning from an extremely bright image to a light-dark balanced image, then for each index, interpolation processing is performed on the first element corresponding to the index in the first initial correction array and the second element corresponding to the index in the second initial correction array, and the obtained interpolation result is used as the element corresponding to the index in the target correction array, wherein the light-dark balanced image is an image in which the difference between the first proportion and the second proportion is less than a second judgment threshold, and the extreme difference of the elements in the second initial correction array is not greater than a preset difference.

[0029] It can be seen that when the brightness distribution information characterizes the first image as an image transitioning from an extremely bright image to a bright-dark balanced image, the brightness distribution information of the first image is taken into consideration, and the first initial correction array corresponding to the extremely bright image and the second initial correction array corresponding to the bright-dark balanced image are interpolated. This can more accurately and reasonably determine the target correction array suitable for the current first image, so that the brightness correction of the first image can be more accurately performed based on the determined target correction array.

[0030] In one embodiment of the present application, determining a target correction array based on the brightness distribution information includes:

[0031] If the brightness distribution information indicates that the first image is a bright-dark balanced image, the second initial correction array is directly determined as the target correction array.

[0032] The range of elements in the second initial correction array is small, that is, the sizes of elements in the second initial correction array are relatively close. Therefore, the adjustment weights corresponding to the bright area and the adjustment weights corresponding to the dark area in the second initial correction array are close. The second initial correction array is directly determined as the target correction array. Based on the approximation of the correction parameters determined for the bright area and the dark area based on the target initial correction array, the brightness of the bright and dark balanced image can be fine-tuned more reasonably.

[0033] In one embodiment of the present application, determining a target correction array based on the brightness distribution information includes:

[0034] If the brightness distribution information characterizes that the first image is an image transitioning from a bright and dark balanced image to an extremely dark image, then for each index, interpolation processing is performed on the second element corresponding to the index in the second initial correction array and the third element corresponding to the index in the third initial correction array, and the obtained interpolation result is used as the element corresponding to the index in the target correction array, wherein the extremely dark image is: an image in which the second proportion is greater than the third judgment threshold, and the element corresponding to the first category index of the third initial correction array is greater than the element corresponding to the second category index.

[0035] It can be seen that when the brightness distribution information characterizes the first image as an image transitioning from a bright and dark balanced image to an extremely dark image, the brightness distribution information of the first image is taken into consideration, and the second initial correction array corresponding to the bright and dark balanced image and the second initial correction array corresponding to the extremely dark image are interpolated. This can more accurately and reasonably determine the target correction array suitable for the current first image, so that the brightness correction of the first image can be more accurately performed based on the determined target correction array.

[0036] In one embodiment of the present application, determining a target correction array based on the brightness distribution information includes:

[0037] If the brightness distribution information indicates that the first image is an extremely dark image, the third initial correction array is directly determined as the target correction array.

[0038] The adjustment weights for the indexes mapping bright areas in the third initial correction array are greater than the adjustment weights for the indexes mapping dark areas. That is, the adjustment weights in the first initial correction array are used to increase the brightness of bright areas and decrease the brightness of dark areas. Thus, when the brightness distribution information indicates that the first image is extremely dark, the third initial correction array is directly determined as the target correction array. Based on the target initial correction array, correction parameters for increasing the brightness of bright areas and decreasing the brightness of dark areas can be determined. This suppresses the brightness of dark areas in extremely dark images and increases the brightness of bright areas in extremely dark images. This is equivalent to performing brightness correction on extremely dark images, reducing the impact of large dark areas in the image on subsequent adjustments to exposure parameters.

[0039] In one embodiment of the present application, interpolating the first element corresponding to the index in the first initial correction array and the second element corresponding to the index in the second initial correction array, and using the obtained interpolation result as the element corresponding to the index in the target correction array, includes:

[0040] The first element with index i in the first initial correction array and the second element with index i in the second initial correction array are interpolated according to the following expression, and the interpolation result is used as the element weight[i] corresponding to index i in the target correction array:

[0041] ;

[0042] in, represents the first element, represents the second element, represents the brightness distribution information, A first parameter determined based on a value range of the brightness representation information;

[0043] or

[0044] The interpolation processing is performed on the second element corresponding to the index in the second initial correction array and the third element corresponding to the index in the third initial correction array, and the obtained interpolation result is used as the element corresponding to the index in the target correction array, including:

[0045] The second element with index i in the second initial correction array and the third element with index i in the third initial correction array are interpolated according to the following expression, and the interpolation result is used as the element weight[i] corresponding to index i in the target correction array:

[0046] ;

[0047] in, represents the third element, is a second parameter determined based on the value range, is a third parameter determined based on the value range.

[0048] In this way, based on the above expression, the two elements with the same index in the two initial correction arrays can be quickly interpolated, and the target correction array can be obtained according to the interpolation result. The brightness distribution information is taken into account in the interpolation process, so that the target correction array obtained by interpolation is more suitable for the determined brightness distribution information.

[0049] In one embodiment of the present application, determining the correction parameter corresponding to the obtained brightness representation information based on the element corresponding to the target index in the target correction array includes:

[0050] For the target index mapped to the obtained brightness representation information, the correction parameter corresponding to the obtained brightness representation information is determined in the following manner:

[0051] If the target index is within a first index interval or a second index interval, directly determining the element corresponding to the target index in the target correction array as the correction parameter corresponding to the obtained brightness representation information, wherein the first index interval is an index interval including indexes less than a first value, and the second index interval is an index interval including indexes greater than a second value;

[0052] If the target index is outside the first index interval and the second index interval, the fourth element and the fifth element are interpolated, and the interpolation result is used as the correction parameter corresponding to the obtained brightness representation information, wherein the fourth element is: the element corresponding to the target index in the target correction array, and the fifth element is: the element located after the fourth element in the target correction array.

[0053] It can be seen that in this embodiment, after obtaining the target correction array, according to the different index intervals to which the target index mapped by the brightness representation information belongs, it is selected whether to directly determine the element corresponding to the target index in the target correction array as the correction parameter or to obtain the correction parameter through interpolation calculation, thereby improving the accuracy of the final determined correction parameter.

[0054] In one embodiment of the present application, interpolating the fourth element and the fifth element and using the interpolation result as the correction parameter corresponding to the obtained brightness representation information includes:

[0055] Interpolate the fourth and fifth elements according to the following expression, and use the interpolation result as the correction parameter corresponding to the brightness representation information obtained :

[0056] ;

[0057] in, represents the target index, represents the fourth element, represents the fifth element, represents the brightness representation value obtained, The fourth parameter is determined based on the length of the target correction array and the value range of the brightness representation information.

[0058] In this way, based on the above expression, the fourth element corresponding to the target index and the fifth element corresponding to the next index of the target index can be quickly interpolated, and a more accurate correction parameter can be obtained according to the interpolation result.

[0059] In one embodiment of the present application, a first number of elements included in the target correction array is less than a second number of values ​​included in a value range of the brightness representation information. Before determining the correction parameter corresponding to the brightness representation information of the image area based on the element corresponding to the target index in the target correction array, the method further includes:

[0060] determining a compression ratio based on the first number and the second number;

[0061] The obtained brightness representation information is compressed according to the compression ratio to obtain a target index mapped by the obtained brightness representation information.

[0062] In this case, the first number of elements included in the target correction array can be smaller than the second number of values ​​included in the value range of the brightness representation information. Subsequent compression can be performed to compress the brightness representation information into the index value range of the target correction array. This reduces the number of elements included in the target correction array, thereby reducing the storage space required for the target correction array and lowering storage resource consumption.

[0063] In one embodiment of the present application, the number of the image regions is greater than 1, and the adjusting the first exposure parameter according to the corrected brightness representation information and the reference brightness representation information includes:

[0064] determining a position weight of each image region according to the position of each image region in the first image, wherein the position weight reflects the importance of the image region in the first image;

[0065] performing weighted summation on the corrected brightness representation information according to the position weight of each image region to obtain overall brightness representation information of the first image;

[0066] The first exposure parameter is adjusted based on the overall brightness representation information and the reference brightness representation information.

[0067] In this way, the overall brightness representation information obtained by weighted summing the brightness representation information of each image region according to the position weight also reflects the importance of each image region and can better reflect the overall brightness of the image.

[0068] In a second aspect, an embodiment of the present application provides a terminal, including:

[0069] one or more processors and memory;

[0070] The memory is coupled to the one or more processors, and is used to store computer program code, where the computer program code includes computer instructions. The one or more processors call the computer instructions to enable the terminal to execute the method described in the first aspect.

[0071] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, comprising a computer program, which, when executed on a terminal, enables the terminal to execute the method described in the first aspect.

[0072] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes executable instructions. When the executable instructions are executed on a terminal, the terminal executes the method described in the first aspect.

[0073] In the fifth aspect, an embodiment of the present application provides a chip system, which is applied to a terminal. The chip system includes one or more processors, and the processors are used to call computer instructions to enable the terminal to input data into the chip system and execute the method described in the first aspect for automatic exposure.

[0074] The beneficial effects of the solutions provided by the embodiments in the second to fifth aspects can be referred to the beneficial effects of the solutions provided by the embodiments in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0076] Figure 1 A schematic diagram of the structure of a terminal provided in an embodiment of the present application;

[0077] Figure 2 A software structure block diagram applicable to a terminal provided in an embodiment of the present application;

[0078] Figure 3a A schematic diagram of a first type of accurately exposed image provided in an embodiment of the present application;

[0079] Figure 3b A schematic diagram of a first inaccurate exposure image provided in an embodiment of the present application;

[0080] Figure 4a A schematic diagram of a second accurate exposure image provided in an embodiment of the present application;

[0081] Figure 4b A schematic diagram of a second inaccurate exposure image provided in an embodiment of the present application;

[0082] Figure 5 A schematic flow chart of a first automatic exposure method provided in an embodiment of the present application;

[0083] Figure 6 A schematic flow chart of a second automatic exposure method provided in an embodiment of the present application;

[0084] Figure 7 A schematic diagram of a first target correction array determination method provided in an embodiment of the present application;

[0085] Figure 8a A schematic diagram of the first interpolation process provided in an embodiment of the present application;

[0086] Figure 8b A schematic diagram of the second interpolation process provided in an embodiment of the present application;

[0087] Figure 9 A schematic diagram of a second target correction array determination method provided in an embodiment of the present application;

[0088] Figure 10 A schematic diagram of a first correction parameter determination method provided in an embodiment of the present application;

[0089] Figure 11 A schematic diagram of a second correction parameter determination method provided in an embodiment of the present application;

[0090] Figure 12 A schematic diagram of an overall automatic exposure process provided in an embodiment of the present application;

[0091] Figure 13a is a schematic diagram of an image collected using relevant technology;

[0092] Figure 13b A schematic diagram of an image captured using the solution provided in an embodiment of the present application;

[0093] Figure 14 A schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0094] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0095] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first instruction and the second instruction are intended to distinguish different user instructions and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0096] It should be noted that, in this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.

[0097] The solution provided in the embodiments of the present application can be applied to any terminal that can capture images and has automatic exposure function, such as mobile phones, tablet computers, desktop computers, smart watches, wearable electronic devices, vehicle-mounted equipment, smart cars, robots, etc.

[0098] For example, Figure 1 The figure shows a schematic diagram of the structure of the terminal 100. The terminal 100 may include a processor 110, a display screen 120, an internal memory 130, a Subscriber Identification Module (SIM) card interface 140, a Universal Serial Bus (USB) interface 150, a charging management module 160, a battery management module 161, a battery 162, a sensor module 170, a mobile communication module 180, a wireless communication module 190, antenna 1 and antenna 2, etc. The sensor module 170 may include a pressure sensor 170A, a fingerprint sensor 170B, a touch sensor 170C, an ambient light sensor 170D, an image sensor 170E, etc.

[0099] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0100] The processor 110 may include one or more processing units, such as a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent components or integrated into one or more processors. In some embodiments, the terminal 100 may also include one or more processors 110. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution. In other embodiments, the processor 110 may also include a memory for storing instructions and data. For example, the memory in the processor 110 may be a cache memory. This memory may store instructions or data that have just been used or are being recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can directly call the instruction or data from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the terminal 100 in processing data or executing instructions.

[0101] In some embodiments, processor 110 may include one or more interfaces. These interfaces may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a General-Purpose Input / Output (GPIO) interface, a SIM card interface, and / or a USB interface. The USB interface 150 is an interface that complies with USB standards and may be, for example, a Mini USB interface, a Micro USB interface, or a USB Type-C interface. The USB interface 150 can be used to connect a charger to charge the terminal 100, or to transfer data between the terminal 100 and peripheral devices. The USB interface 150 can also be used to connect headphones to play audio.

[0102] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is for illustrative purposes only and does not constitute a structural limitation on the terminal 100. In other embodiments of the present application, the terminal 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0103] The wireless communication function of the terminal 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 180, the wireless communication module 190, the modem processor, and the baseband processor.

[0104] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0105] Terminal 100 implements display functions through a GPU, display screen 120, and an application processor. The GPU is a microprocessor for image processing that connects display screen 120 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0106] The display screen 120 is used to display images, videos, and the like. The display screen 120 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniLED, a microLED, a micro-oLED, or a quantum dot light-emitting diode (QLED). In some embodiments, the terminal 100 may include one or more display screens 120.

[0107] In some embodiments of the present application, when the display panel adopts materials such as OLED, AMOLED, FLED, etc., the above Figure 1 The display screen 120 can be bent. Here, the display screen 120 can be bent to any angle at any position and can be maintained at that angle. For example, the display screen 120 can be folded in half from the middle to the left or right. It can also be folded in half from the middle to the top or bottom.

[0108] The display screen 120 of the terminal 100 may be a flexible screen. Currently, flexible screens have attracted much attention due to their unique characteristics and huge potential. Compared with traditional screens, flexible screens are more flexible and bendable, which can provide users with a new way of interaction based on the bendable characteristics, and can meet more user demands for the terminal. For terminals equipped with a foldable display, the foldable display on the terminal can be switched between a small screen in a folded form and a large screen in an unfolded form at any time. Therefore, users are using the split-screen function on terminals equipped with a foldable display more and more frequently.

[0109] The terminal 100 can implement a shooting function through an ISP, an image sensor 170E, a video codec, a GPU, a display screen 120, and an application processor.

[0110] The ISP processes data fed back by the image sensor 170E. For example, when shooting, the shutter is opened, and light is transmitted through the lens to the image sensor 170E. The light signal is converted into an electrical signal, which the image sensor 170E then passes to the ISP for processing, transforming it into a visible image. The ISP can perform algorithmic optimization on image noise, brightness, and color. It can also optimize parameters such as exposure and color temperature for the captured scene.

[0111] Image sensor 170E is used to capture photos or videos. An optical image of an object is projected onto image sensor 170E through a lens. Image sensor 170E may include a charge-coupled device (CCD) or complementary metal-oxide-semiconductor (CMOS) phototransistor. Image sensor 170E may include a photosensitive element that receives light from the external environment, converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard red, green, blue (RGB) or YUV format. In some embodiments, terminal 100 may include one or N image sensors 170E, where N is a positive integer greater than one.

[0112] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the terminal 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0113] Video codecs are used to compress or decompress digital video. Terminal 100 may support one or more video codecs. This allows terminal 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0114] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU enables intelligent cognitive applications in the terminal 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0115] The internal memory 130 can be used to store one or more computer programs, each of which includes instructions. The processor 110 can execute the instructions stored in the internal memory 130, thereby enabling the terminal 100 to perform the automatic exposure method provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 130 may include a program storage area and a data storage area. The program storage area may store an operating system; it may also store one or more applications (such as a gallery, contacts, etc.). The data storage area may store data created during the use of the terminal 100 (such as photos, contacts, etc.). Furthermore, the internal memory 130 may include high-speed random access memory and non-volatile memory, such as one or more disk storage components, flash memory components, and Universal Flash Storage (UFS). In some embodiments, the processor 110 can execute the instructions stored in the internal memory 130 and / or instructions stored in a memory provided within the processor 110, thereby enabling the terminal 100 to perform the automatic exposure method provided in some embodiments of the present application, as well as other applications and data processing.

[0116] The internal memory 130 can be used to store the relevant programs of the automatic exposure method provided in the embodiment of the present application, and the processor 110 can be used to call the relevant programs of the automatic exposure method stored in the internal memory 130 when displaying information to execute the automatic exposure method of the embodiment of the present application.

[0117] The sensor module 170 may include a pressure sensor 170A, a fingerprint sensor 170B, a touch sensor 170C, an ambient light sensor 170D, and the like.

[0118] Pressure sensor 170A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 170A can be located on display screen 120. There are many types of pressure sensors 170A, including resistive, inductive, and capacitive pressure sensors. A capacitive pressure sensor may comprise at least two parallel plates made of conductive material. When force is applied to pressure sensor 170A, the capacitance between the electrodes changes, and terminal 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to display screen 120, terminal 100 detects the touch operation based on pressure sensor 170A. Terminal 100 can also calculate the touch location based on the detection signal from pressure sensor 170A. In some embodiments, touch operations applied to the same touch location but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed; when a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0119] The fingerprint sensor 170B is used to collect fingerprints. The terminal 100 can use the collected fingerprint characteristics to implement functions such as unlocking, accessing application locks, taking photos, and answering calls.

[0120] Touch sensor 170C, also known as a touch-sensitive device, can be provided on display screen 120. Touch sensor 170C and display screen 120 form a touch screen, also known as a touchscreen. Touch sensor 170C is used to detect touch operations applied thereto or in the vicinity thereof. Touch sensor 170C can transmit the detected touch operations to an application processor to determine the type of touch event. Visual output related to the touch operations can be provided via display screen 120. In other embodiments, touch sensor 170C can also be provided on the surface of terminal 100, in a different location from display screen 120.

[0121] Ambient light sensor 170D is used to sense ambient light brightness. Terminal 100 can adaptively adjust the brightness of display screen 120 based on the perceived ambient light brightness. Ambient light sensor 170D can also be used to automatically adjust white balance during photography. Ambient light sensor 170D can also transmit information about the device's environment to the GPU.

[0122] The ambient light sensor 170D is also used to obtain the brightness, light ratio, color temperature, etc. of the collection environment.

[0123] Figure 2 The software system of the terminal can adopt a layered architecture, event-driven architecture, micro-kernel architecture, micro-service architecture, or cloud architecture.

[0124] A layered architecture divides the terminal's software system into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the software system can be divided into five layers: applications, application framework, system libraries, hardware abstraction layer (HAL), and kernel.

[0125] The application layer can include a series of application packages. The application layer runs applications by calling the application programming interface (API) provided by the application framework layer. Figure 2 As shown, the application package may include applications such as camera, video, gallery, browser, etc. It can be understood that the port of each of the above applications can be used to receive data.

[0126] The application framework layer provides API and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, and a Dynamic Host Configuration Protocol (DHCP) module.

[0127] Among them, the window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0128] Content providers are used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, etc.

[0129] The view system includes visual controls, such as controls that display application icons, controls that display text, controls that display buttons, and so on.

[0130] The resource manager provides various resources for applications, such as localized strings, application icons, images, layout files, video files, and so on.

[0131] The notification manager enables applications to display notification information in the status bar, which can be used to convey informational messages and disappear automatically after a short stay without user interaction.

[0132] The system library includes multiple functional modules, such as a surface manager, a 3D graphics processing library, a 2D graphics engine, and a file library. The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.

[0133] The hardware abstraction layer can contain multiple library modules, such as a hard disk library module and a display library module. The terminal system can load the corresponding library module for the device hardware, thereby enabling the process to access the device hardware. For example, the terminal system can load the corresponding library module for the hard disk, thereby enabling the process to access the system configuration file stored on the hard disk.

[0134] The kernel layer is the layer between hardware and software. The kernel layer is deployed with an operating system, which is used to drive the hardware and make it work. The kernel layer includes at least a hard disk drive, a display driver, a camera driver, a sensor driver, and a motor driver, etc., which are not limited in the embodiments of the present application. It is understandable that the hard disk drive, display driver, camera driver, sensor driver, and motor driver, etc. can all be considered as a driver node. Each of the above-mentioned driver nodes includes an interface that can be used to receive data.

[0135] The operating system deployed in the kernel layer of the terminal can execute the automatic exposure solution provided in the embodiment of the present application in response to the user opening the camera APP and turning on the automatic exposure function.

[0136] First, the application scenarios of the solutions provided in the embodiments of the present application are introduced.

[0137] The application scenario of the solution provided in the embodiment of the present application is: after the terminal turns on the automatic exposure function, the photographic component is called to capture images.

[0138] In related technologies, the terminal generally first calculates the average brightness of the currently captured image, and adjusts the exposure parameters based on the difference between the above average brightness and the preset brightness, so that the average brightness of the image captured according to the adjusted exposure parameters approaches the above preset brightness.

[0139] However, if the area of ​​the image with higher brightness accounts for a large proportion, the above average brightness will be much greater than the preset brightness. The terminal will reduce the overall brightness by adjusting the exposure parameters. At this time, large bright areas will be suppressed too dark, resulting in the overall brightness of the image collected according to the adjusted exposure parameters being low and underexposed.

[0140] See also Figure 3a and Figure 3b ,in, Figure 3a This is a schematic diagram of a first type of accurately exposed image provided in an embodiment of the present application. Figure 3b This is a schematic diagram of a first type of inaccurate exposure image provided in an embodiment of the present application.

[0141] Figure 3a The image area where the sky and clouds are located has a higher brightness and can be called a bright area, while the image area where tall buildings are located has a lower brightness and can be called a dark area. It can be seen that the bright area accounts for a larger proportion and the dark area accounts for a smaller proportion. In this way, when the exposure parameters are adjusted using the above-mentioned method in the related art, large areas of bright areas are suppressed too dark, and the overall brightness of the image collected according to the adjusted exposure parameters will be lower, such as Figure 3b As shown, the brightness of the image areas where the sky and clouds are located, as well as the brightness of the image areas where tall buildings are located, are all low, which is inconsistent with the actual scene seen by human eyes, or in other words, is not suitable for human eyes to see.

[0142] On the other hand, if the area of ​​the image with lower brightness accounts for a large proportion, the above average brightness will be much lower than the preset brightness. The terminal will increase the overall brightness by adjusting the exposure parameters. At this time, large dark areas will be too bright, resulting in a higher overall brightness of the image collected according to the adjusted exposure parameters, which will cause overexposure.

[0143] See also Figure 4a and Figure 4b ,in, Figure 4a This is a schematic diagram of a second accurate exposure image provided in an embodiment of the present application. Figure 4b A schematic diagram of a second inaccurate exposure image provided in an embodiment of the present application.

[0144] Figure 4a The image area where the sky is located has a higher brightness and can be called a bright area. The image area where tall buildings and trees are located has a lower brightness and can be called a dark area. It can be seen that the dark area accounts for a larger proportion and the bright area accounts for a smaller proportion. In this way, when the exposure parameters are adjusted using the above method in the related art, the large dark area is overbrightened, and the overall brightness of the image collected according to the adjusted exposure parameters will be higher. Figure 4b As shown, the brightness of the image area where the sky is located, as well as the brightness of the image area where the tall buildings and trees are located, are all relatively high. In particular, the brightness of the tall building on the left is extremely high, making it impossible to distinguish details. This is inconsistent with the actual scene seen by the human eye, or in other words, it is not suitable for human viewing.

[0145] In view of the above situation, an embodiment of the present application provides an automatic exposure solution to improve the exposure accuracy when capturing images.

[0146] The automatic exposure solution provided in the embodiment of the present application is described in detail below.

[0147] See also Figure 5 , is a flow chart of the first automatic exposure method provided in an embodiment of the present application, the method includes the following steps S501-S506.

[0148] Step S501: Obtain a first image captured according to first exposure parameters.

[0149] After the terminal starts the camera application, it can capture images according to exposure parameters. The above exposure parameters may include exposure time, gain, aperture size, etc.

[0150] The first exposure parameter can be the exposure parameter currently being applied by the terminal when capturing an image. Specifically, it can be the exposure parameter used by default after the terminal starts the camera application, it can be an exposure parameter manually selected by the user, or it can be an exposure parameter adjusted by the terminal based on the image brightness of the last captured image. The embodiments of the present application are not limited to this.

[0151] Step S502: Obtain brightness representation information of a set image area in the first image.

[0152] In terms of quantity, the image area set in the first image may be one or more; in terms of coverage area, the image area set in the first image may cover the entire area of ​​the first image or a portion of the area of ​​the first image.

[0153] In one case, the image regions defined above may be image regions obtained by dividing the first image into regions, which may also be referred to as image grids. This embodiment of the application does not limit the size or number of the image grids. For example, the size of each image grid may be 16×16 or 32×32, and the number may vary depending on the size of the first image and the size of the image grids, such as 64 or 128.

[0154] Luminance representation information, also known as luminance (luma) statistics, reflects the brightness of an image region. Specifically, it can be any information that can reflect image brightness. The following example describes how to obtain luminance representation information.

[0155] In one embodiment, if the color mode of the first image is a color mode with a brightness value component, such as a (Luminance, Y) brightness (Chrominance, U) density (Chroma, V) mode, the average value of the Y values ​​of the pixels included in the image area can be directly calculated, and the calculation result can be used as the brightness representation information of the image area.

[0156] In another embodiment, if the color mode of the first image is not a color mode with a brightness value component, the color mode of the first image can be converted into a color mode with a brightness value component, and then the average value of the brightness value components of the pixels included in the image area is calculated, and the obtained calculation result is used as the brightness representation information of the image area.

[0157] The above-mentioned mode conversion can be performed by using the conversion relationship between various color modes to convert the color mode of the first image into a color mode with grayscale value components, which is not limited in this embodiment of the present application.

[0158] For example, when the color mode of the first image is red (R), green (G), blue (B), hue (H), saturation (S), brightness (B), etc., the grayscale component of the pixel is not recorded in the first image. Therefore, the color mode of the first image can be converted to YUV mode according to the color mode conversion formula. In this way, the Y value of the pixel of the converted first image is the brightness value of the pixel.

[0159] In another embodiment, if the color mode of the first image is not a color mode with a brightness value component, the pixel value components corresponding to the color channel in the pixels included in the image area can be accumulated for each color channel, and the ratio between the accumulated value and the number of pixels included in the image area is calculated to obtain the average pixel component corresponding to each color channel. Then, the brightness conversion formula is used to perform weighted summation on the average pixel components of each color channel, and the calculation result is used as the brightness representation information of the image area.

[0160] Step S503: Obtaining brightness distribution information of the first image based on the obtained brightness representation information.

[0161] The brightness distribution information reflects the brightness distribution of the first image. Based on the brightness distribution information, it can be determined which image areas in the first image have higher brightness, which image areas have moderate brightness, and which image areas have lower brightness.

[0162] The brightness distribution information may be any information that can reflect the brightness distribution of the first image. The embodiment of the present application does not limit this and is described below by way of example.

[0163] In a first case, the brightness distribution information may include a first proportion of a first image area in the first image.

[0164] The first image region is an image region whose brightness representation information is greater than a first brightness threshold.

[0165] The brightness representation information reflects the brightness of the image region. The first image region whose brightness representation information is greater than the first brightness threshold is essentially the region with higher brightness in the first image. For ease of understanding and description, the first image region is referred to as the bright region in some of the following descriptions. For example, the brightness distribution information may be 70%, indicating that the proportion of the bright region in the first image is 70%.

[0166] In the second case, the brightness distribution information may include a second proportion of the second image area in the first image.

[0167] The second image region is an image region whose brightness representation information is less than a second brightness threshold, and the second brightness threshold is less than the first brightness threshold.

[0168] The brightness representation information reflects the brightness of the image region. The second image region whose brightness representation information is less than the second brightness threshold is essentially the region with lower brightness in the first image. For ease of understanding and description, the second image region is referred to as the dark region in some of the following descriptions. For example, the brightness distribution information may be 80%, indicating that the dark region accounts for 80% of the first image.

[0169] The first brightness threshold and the second brightness threshold can be set by the staff according to experience and / or actual needs, and the embodiment of the present application does not limit this.

[0170] In a third case, the brightness distribution information may include both the first ratio and the second ratio. In this way, the brightness distribution information can reflect both the ratio of bright areas and the ratio of dark areas in the first image.

[0171] In a fourth case, the brightness distribution information may be a ratio between the number of image regions corresponding to different brightness representation information and the total number of image regions.

[0172] In this case, the brightness distribution information does not directly reflect the proportion of bright areas or dark areas in the first image, but directly reflects the proportion of image areas corresponding to each brightness characterization information. Based on the above information, the first brightness threshold and the second brightness threshold, the proportion of bright areas and / or dark areas in the first image can also be calculated.

[0173] For example, the brightness distribution information reflects that the image area corresponding to the brightness representation information L1 accounts for 20%, the image area corresponding to the brightness representation information L2 accounts for 40%, and the image area corresponding to the brightness representation information L3 accounts for 40%. If L1 and L2 are greater than the first brightness threshold L0, and L3 is less than L0, then the first proportion of the first image area (bright area) whose brightness representation information is greater than the first brightness threshold L0 is: 20%+25%=45%.

[0174] Specifically, since the brightness representation information of the image area has been obtained in the above steps, in this step, the proportions of each category involved in the above four situations can be counted to obtain brightness distribution information.

[0175] Step S504: determining correction parameters of brightness representation information of the image region according to the brightness distribution information.

[0176] As can be seen from the above description, the brightness distribution information can directly or indirectly reflect the proportion of bright areas and / or dark areas in the image. Based on the above-mentioned proportion of bright areas and / or dark areas, the correction parameters of the brightness representation information of the image area can be determined to adjust the brightness representation information.

[0177] The following describes the effects of the above correction parameters according to different situations.

[0178] When determining the correction parameters for bright areas, there are two cases:

[0179] In the first case, if the brightness distribution information represents that the first proportion of the first image area is greater than the second proportion of the second image area, the correction parameter corresponding to the first image area is used to reduce the brightness representation information of the first image area, in other words, to reduce the brightness of the bright area.

[0180] The first proportion is greater than the second proportion, that is, the proportion of the bright area in the image is greater than the proportion of the dark area. At this time, the correction parameter determined for the bright area is used to reduce the brightness representation information of the bright area.

[0181] In the second case, if the brightness distribution information indicates that the first proportion is smaller than the second proportion, the correction parameter corresponding to the first image area is used to increase the brightness representation information of the first image area.

[0182] The first proportion is smaller than the second proportion, that is, the dark area proportion in the image is greater than the bright area proportion. At this time, the correction parameter determined for the bright area is used to increase the brightness representation information of the bright area, in other words, to improve the brightness of the bright area.

[0183] When the first ratio is greater than the second ratio, it indicates that the ratio of bright areas in the first image is high. At this time, the correction parameters determined for the bright areas in the first image are used to reduce the brightness of the bright areas. In this way, after adjusting the brightness representation value of the bright areas according to the correction parameters, it is equivalent to weakening the brightness of the large-area bright areas, which can reduce the adverse effects of the excessively large bright areas on the subsequent adjustment of exposure parameters. Conversely, when the first ratio is less than the second ratio, it indicates that the ratio of bright areas in the first image is low. At this time, the correction parameters determined for the bright areas in the first image are used to increase the brightness of the bright areas. In this way, after adjusting the brightness representation value of the bright areas according to the correction parameters, it is equivalent to enhancing the brightness of the small-area bright areas, which can reduce the adverse effects of the excessively small bright areas on the subsequent adjustment of exposure parameters.

[0184] It can be seen that in this way, based on the relationship between the proportion of bright areas and the proportion of dark areas in the first image, the correction parameters for increasing or decreasing the brightness of the bright areas can be adaptively determined. After adjusting the brightness representation information according to the correction parameters, the adverse effects of excessively large or small bright areas on subsequent adjustment of exposure parameters can be reduced, making the exposure parameters determined according to the adjusted brightness representation information more reasonable and accurate.

[0185] Similar to determining the correction parameters for bright areas, determining the correction parameters for dark areas can be divided into the following two cases, which are briefly explained below:

[0186] In the first case, if the first proportion is greater than the second proportion, the correction parameter corresponding to the second image area is used to increase the brightness representation information of the second image area.

[0187] In the second case, if the brightness distribution information indicates that the first proportion is smaller than the second proportion, the correction parameter corresponding to the second image area is used to reduce the brightness representation information of the second image area.

[0188] When the first ratio is greater than the second ratio, it indicates that the proportion of dark areas in the first image is low. At this time, the correction parameters determined for the dark areas in the first image are used to increase the brightness of the dark areas. In this way, after adjusting the brightness representation value of the dark areas according to the correction parameters, it is equivalent to enhancing the brightness of small-area dark areas, which can reduce the adverse effects of the small dark area on the subsequent adjustment of exposure parameters; conversely, when the first ratio is less than the second ratio, it indicates that the proportion of dark areas in the first image is high. At this time, the correction parameters determined for the dark areas in the first image are used to reduce the brightness of the dark areas. In this way, after adjusting the brightness representation value of the bright areas according to the correction parameters, it is equivalent to weakening the brightness of large-area dark areas, which can reduce the adverse effects of the large dark area on the subsequent adjustment of exposure parameters.

[0189] It can be seen that in this way, based on the relationship between the proportion of bright areas and the proportion of dark areas in the first image, the correction parameters used to increase or decrease the brightness of the dark areas can be adaptively determined. After adjusting the brightness representation information according to the correction parameters, the adverse effects of the dark area being too large or too small on the subsequent adjustment of the exposure parameters can be reduced, so that the exposure parameters determined according to the adjusted brightness representation information are more reasonable and accurate.

[0190] It should be noted that, based on the brightness distribution information, the correction parameters may be determined solely for the bright area, solely for the dark area, or for both the bright area and the dark area.

[0191] For example, if the proportion of bright areas is high, on the one hand, the correction parameters for reducing the brightness of the bright areas can be determined, and on the other hand, the correction parameters for increasing the brightness of the dark areas can be determined; if the proportion of bright areas is low, on the one hand, the correction parameters for increasing the brightness of the bright areas can be determined, and on the other hand, the correction parameters for reducing the brightness of the dark areas can be determined.

[0192] The specific method for determining the above correction parameters is introduced below.

[0193] In one embodiment, a target correction array can be determined based on the brightness distribution information, and correction parameters for the brightness representation information can be determined based on the index mapped to the target correction array by the brightness representation information of the image region. The specific implementation method will be described in subsequent embodiments and will not be described in detail here.

[0194] In another embodiment, the difference between the first proportion and the second proportion can be calculated based on the brightness distribution information, and the correction parameter corresponding to the above difference can be determined based on the correspondence between the pre-set difference and the correction parameter, as the correction parameter corresponding to the brightness representation information of the image area.

[0195] Among them, the above-mentioned correspondence relationship can be the correspondence relationship between the difference and the correction parameters of the first image area. In this case, the correction parameters corresponding to the above-mentioned difference are determined as the correction parameters of the first image area; the above-mentioned correspondence relationship can be the correspondence relationship between the difference and the correction parameters of the second image area. In this case, the correction parameters corresponding to the above-mentioned difference are determined as the correction parameters of the second image area; of course, the above-mentioned correspondence relationship can be the correspondence relationship between the difference and the correction parameters of the first image area and the correction parameters of the second image area. In this case, the correction parameters corresponding to the above-mentioned difference are respectively determined as the correction parameters of the first image area and the correction parameters of the second image area.

[0196] In another embodiment, if the brightness distribution information represents that the first proportion is greater than the second proportion, the correction parameter of the first image area can be directly determined as the first preset parameter, and the correction parameter of the second image area can be directly determined as the second preset parameter; if the brightness distribution information represents that the first proportion is less than the second proportion, the correction parameter of the first image area can be directly determined as the third preset parameter, and the correction parameter of the second image area can be determined as the fourth preset parameter.

[0197] Step S505: Correcting the brightness representation information of the image area according to the correction parameters corresponding to the image area.

[0198] Specifically, the brightness representation information of the image area may be corrected according to a preset calculation method, such as multiplication or difference calculation.

[0199] In one case, the product of the brightness representation information of the image region and its correction parameter may be calculated, and the calculation result may be used as the corrected brightness representation information.

[0200] Step S506: adjusting the first exposure parameter according to the corrected brightness representation information and the reference brightness representation information, and capturing the second image according to the adjusted first exposure parameter.

[0201] The above-mentioned reference brightness representation information is a pre-set average brightness value of the expected image. Specifically, according to Weber's law, the human eye's perception of light is nonlinear, and an 18% reflectivity appears most appropriate to the human eye. The brightness value corresponding to 18% grayscale can be determined as the reference brightness representation information.

[0202] In one implementation, the overall brightness representation information of the first image may be calculated first, and then the first exposure parameter may be adjusted in the following manner:

[0203] If the overall brightness characterization information is greater than the reference brightness characterization information, the value of at least one first exposure parameter among the exposure time, gain, and aperture size is reduced; if the overall brightness characterization information is less than the reference brightness characterization information, the value of at least one first exposure parameter among the exposure time, gain, and aperture size is increased.

[0204] The following describes how to obtain the overall brightness representation information.

[0205] First, the position weight of each image area is determined according to the position of each image area in the first image. Then, the corrected brightness representation information is weighted summed according to the position weight of each image area to obtain the overall brightness representation information of the first image.

[0206] Different regions of interest (ROIs) can be set in the first image, with each ROI corresponding to a different position weight. Thus, the ROI to which each image region belongs can be first determined, and the position weight of the ROI to which each image region belongs can be determined as the position weight of each image region. In this way, the brightness representation information of each image region is weighted and summed according to the position weight to obtain the overall brightness representation information, which also reflects the importance of each image region and can better reflect the overall brightness of the image.

[0207] In another embodiment, the average brightness representation information of the image region can be directly calculated as the average brightness representation information. Then, the first exposure parameter can be adjusted based on the difference between the average brightness representation information and the reference brightness representation information. The specific adjustment method is similar to the previous real-time method, the only difference being that the overall brightness representation information is replaced by the average brightness representation information. This will not be further described here.

[0208] As can be seen from the above, when the solution provided in the embodiment of the present application is applied for automatic exposure, the brightness distribution information of the first image is obtained based on the brightness characterization information of the image area set in the first image captured according to the first exposure parameters. In this way, the correction parameters of the brightness characterization information of the image area can be determined based on the brightness distribution information, so that the brightness characterization information of the image area can be corrected according to the correction parameters corresponding to the image area. The first exposure parameters are adjusted according to the corrected brightness characterization information and the reference brightness characterization information, and the second image is captured according to the adjusted first exposure parameters.

[0209] As can be seen, after capturing the first image according to the first exposure parameters, the first exposure parameters are not adjusted directly based on the brightness representation information of the image region in the first image. Instead, the brightness distribution information of the first image is taken into account and the brightness representation information of the image region in the first image is corrected based on this brightness distribution information. This correction reduces the interference caused by the brightness distribution of the first image on subsequent adjustment of the exposure parameters, making the corrected brightness representation information more suitable for subsequent adjustment of the exposure parameters. Furthermore, if the first image has high contrast, the impact of high contrast on subsequent adjustment of the exposure parameters is also reduced, making the adjustment of the first exposure parameters more reasonable, reducing the possibility of underexposure or overexposure in the second image captured according to the adjusted exposure parameters, making the brightness of the second image more suitable for human viewing, and improving exposure accuracy.

[0210] exist Figure 5 Based on the illustrated embodiment, when determining the correction parameters for the brightness representation information of the image region based on the brightness distribution information in step S504, a target correction array can be first determined based on the brightness distribution information, and then the correction parameters for the brightness representation information can be determined based on the index mapped to the brightness representation information of the image region in the target correction array. In view of the above, the embodiment of the present application provides a second automatic exposure method.

[0211] See also Figure 6 , is a flow chart of a second automatic exposure method provided in an embodiment of the present application, the method includes the following steps S601-S607.

[0212] Step S601: Obtain a first image captured according to first exposure parameters.

[0213] Step S602: Obtain brightness representation information of a set image area in the first image.

[0214] Step S603: Obtaining brightness distribution information of the first image based on the obtained brightness representation information.

[0215] The above steps S601 to S603 are the same as the above Figure 5In the illustrated embodiment, steps S501 to S503 are the same and will not be described in detail here.

[0216] Step S604: Determine a target correction array according to the brightness distribution information.

[0217] The target correction array is first introduced below.

[0218] There is a mapping relationship between the index of the target correction array and the brightness representation information, and the elements in the target correction array represent the adjustment weight corresponding to the brightness representation information.

[0219] For example, if the target correction array weight[]={o1, o2, ..., on}, it means that the adjustment weight corresponding to the brightness representation information mapped by index 0 is o1, the adjustment weight corresponding to the brightness representation information mapped by index 1 is o2, and so on.

[0220] Among them, the index of the target correction array and the brightness representation information can be a one-to-one correspondence, that is, each index in the target correction array corresponds to a value of the brightness representation information. In this case, the first number of elements included in the target correction array is equal to the values ​​included in the value range of the brightness representation information; the index of the target correction array and the brightness representation information can also be a one-to-many relationship, that is, each index in the target correction array corresponds to multiple values ​​of the brightness representation information. In this case, the first number of elements included in the target correction array is less than the values ​​included in the value range of the brightness representation information.

[0221] Furthermore, if the brightness distribution information indicates that the first proportion is greater than the second proportion, then the element corresponding to the first type of index in the target correction array is smaller than the element corresponding to the second type of index.

[0222] The first type of index is: the index of the brightness representation information mapping of the first image area, and the second type of index is: the index of the brightness representation information mapping of the second image area.

[0223] That is, if the brightness distribution information indicates that the proportion of bright areas is greater than the proportion of dark areas, then the element corresponding to the bright areas in the target correction array is smaller than the element corresponding to the dark areas. In other words, the adjustment weight determined for the bright areas according to the target correction array is smaller than the adjustment weight determined for the dark areas. This is equivalent to using the adjustment weight determined for the bright areas according to the target correction array to reduce the brightness of the bright areas, while using the adjustment weight determined for the dark areas according to the target correction array to increase the brightness of the dark areas.

[0224] Conversely, if the brightness distribution information indicates that the first percentage is less than the second percentage, the element corresponding to the first index is greater than the element corresponding to the second index. Similarly, this is equivalent to using the adjustment weights determined for bright areas based on the target correction array to increase the brightness of bright areas, and using the adjustment weights determined for dark areas based on the target correction array to decrease the brightness of dark areas.

[0225] The following describes how to determine the target correction array.

[0226] In one embodiment, the target correction array can be determined in different ways based on the three initial correction arrays and the image type represented by the brightness distribution information. The specific implementation is detailed in the subsequent embodiments and will not be described in detail here.

[0227] In another embodiment, the correction array corresponding to the brightness distribution information may be determined according to a preset correspondence between the brightness distribution information and the correction array.

[0228] Step S605: determining a correction parameter corresponding to the brightness representation information of the image region based on the element corresponding to the target index in the target correction array.

[0229] The target index is the index of the brightness representation information mapping of the image area.

[0230] When the index of the target correction array and the brightness representation information are in a one-to-one correspondence, the brightness representation information of the image area can be directly used as the target index to determine the element corresponding to the target index, and then the correction parameter can be determined based on the element.

[0231] When the first number of elements included in the target correction array is smaller than the second number of values ​​included in the value range of the brightness representation information, before performing the above step S605, the following step A may be further performed:

[0232] A compression ratio is determined based on the first number and the second number, and the obtained brightness representation information is compressed according to the compression ratio to obtain a target index mapped to the obtained brightness representation information.

[0233] The compression ratio can be obtained by calculating the ratio of the second quantity to the first quantity.

[0234] For example, the length of the target correction array is 64, that is, the first number is 64, and the value range of the brightness representation information is a positive integer less than or equal to 1024, that is, the second number is 1024, then the compression ratio is 1024 / 64=16.

[0235] In this way, the ratio of the brightness representation information to the above compression ratio can be calculated, the brightness representation information can be compressed into the index value range of the target correction array, and the obtained result can be rounded as the target index for brightness representation information mapping.

[0236] In this case, the first number of elements included in the target correction array can be smaller than the second number of values ​​included in the value range of the brightness representation information. Subsequent compression can be performed to compress the brightness representation information into the index value range of the target correction array. This reduces the number of elements included in the target correction array, thereby reducing the storage space required for the target correction array and lowering storage resource consumption.

[0237] Specifically, the correction parameter may be determined according to the element corresponding to the target index in the following manner.

[0238] In one implementation, it is first determined whether the target index belongs to a set index range, and the correction parameter is determined in different ways according to the determination result. Specific implementation methods are detailed in subsequent embodiments and are not described in detail here.

[0239] In another implementation, the element corresponding to the target index may be directly determined as the correction parameter.

[0240] Step S606: Correcting the brightness representation information of the image area according to the correction parameters corresponding to the image area.

[0241] Step S607: adjusting the first exposure parameter according to the corrected brightness representation information and the reference brightness representation information, and capturing the second image according to the adjusted first exposure parameter.

[0242] The above steps S606-S607 are the same as the above Figure 5 In the illustrated embodiment, steps S505 to S506 are the same and will not be described in detail here.

[0243] As can be seen from the above, in this embodiment, a target correction array is determined based on brightness distribution information. A mapping relationship exists between the index of the target correction array and the brightness representation information. The elements in the target correction array represent adjustment weights corresponding to the brightness representation information, and the size of the elements in the target correction array is related to the brightness distribution information. Specifically, when the brightness distribution indicates that the proportion of bright areas in the first image is relatively large, the adjustment weights corresponding to the bright areas in the target correction array are used to reduce the brightness of the bright areas, and the adjustment weights corresponding to the dark areas are used to increase the brightness of the dark areas. When the brightness distribution indicates that the proportion of dark areas in the first image is relatively large, the adjustment weights corresponding to the bright areas in the target correction array are used to increase the brightness of the bright areas, and the adjustment weights corresponding to the dark areas are used to reduce the brightness of the dark areas. In this way, when determining correction parameters based on the target correction array, correction parameters for adjusting the brightness representation information of bright and dark areas can be determined separately for high-contrast images. This reduces the impact of large bright or dark areas in the image on subsequent adjustment of exposure parameters, making the adjustment of the first exposure parameters more reasonable and accurate, and improving exposure accuracy.

[0244] The following first introduces the image type represented by the brightness distribution information mentioned in the above step S604.

[0245] In one embodiment of the present application, it can be considered that the brightness distribution information can represent the following five image types:

[0246] 1. Extremely bright images

[0247] The extremely bright image is an image whose first proportion is greater than the first determination threshold, that is, an image including a large bright area.

[0248] The above-mentioned first determination threshold can be set by the staff based on experience and / or actual needs, and this application does not limit this.

[0249] For example, the first determination threshold may be 70%, 75%, etc.

[0250] 2. Balanced light and dark images

[0251] The bright-dark balanced image is an image in which the difference between the first proportion and the second proportion is smaller than the second determination threshold, that is, an image in which the area of ​​the bright region and the area of ​​the dark region are close.

[0252] The above-mentioned second determination threshold can be set by the staff based on experience and / or actual needs, and this application does not limit this.

[0253] For example, the second determination threshold may be 15%, 20%, etc.

[0254] 3. Extremely dark images

[0255] For example, the first determination threshold and the third determination threshold may be 70%, 75%, etc., and the second determination threshold may be 15%, 20%, etc.

[0256] The extremely dark image is an image in which the second ratio is greater than the third determination threshold.

[0257] The third determination threshold mentioned above can be set by staff based on experience and / or actual needs, and this application does not impose any limitation on this.

[0258] For example, the third determination threshold may be 70%, 75%, etc.

[0259] 4. Images transitioning from extremely bright images to balanced bright and dark images

[0260] An image that transitions from an extremely bright image to a light-dark balanced image can be understood as an image in which the area of ​​the bright area included is between the area of ​​the bright area included in the extremely bright image and the area of ​​the bright area included in the light-dark balanced image, that is, an image in which the area of ​​the bright area included is larger than the area of ​​the dark area, but the area of ​​the bright area is not too large.

[0261] Specifically, if the first proportion is greater than the second proportion, the first proportion is not greater than the above-mentioned first judgment threshold, and the difference between the first proportion and the second proportion is not less than the second judgment threshold, it can be determined that the first image is an image transitioning from an extremely bright image to a bright and dark balanced image.

[0262] 5. Images that transition from a balanced light and dark image to an extremely dark image

[0263] An image that transitions from a light and dark balanced image to an extremely dark image can be understood as an image in which the area of ​​the dark area included is between the area of ​​the light and dark balanced image and the area of ​​the dark area included in the extremely dark image, that is, an image in which the area of ​​the dark area included is larger than the area of ​​the bright area, but the area of ​​the dark area is not too large.

[0264] Specifically, if the first proportion is smaller than the second proportion, the second proportion is not greater than the third judgment threshold, and the difference between the first proportion and the second proportion is not less than the second judgment threshold, it can be determined that the first image is an image transitioning from a light and dark balanced image to an extremely dark image.

[0265] Next, according to the image type represented by the brightness distribution information, the method of determining the target correction array based on the three initial correction arrays mentioned in the above step S604 is introduced in different situations.

[0266] See first Figure 7 , Figure 7 The method of determining the correction array based on the image type represented by the brightness distribution information is intuitively shown. The following is a detailed description of each case. Figure 7 The method shown in . Figure 7 The first array, the second array, and the third array in respectively represent the first initial correction array, the second initial correction array, and the third initial correction array mentioned above.

[0267] In the first case, if the brightness distribution information indicates that the first image is an extremely bright image, the first array is directly determined as the target correction array.

[0268] When the value of the brightness distribution information is within a first value range, it can be determined that the brightness distribution information indicates that the first image is an extremely bright image. The first value range may include multiple values, in which case the brightness distribution information of multiple values ​​all indicates that the first image is an extremely bright image, or it may include only one value, in which case the brightness distribution information of only one value indicates that the first image is an extremely bright image.

[0269] The elements corresponding to the first type of indexes in the first initial correction array are smaller than the elements corresponding to the second type of indexes, that is, the elements corresponding to the indexes of the bright area mapping are larger than the elements corresponding to the indexes of the dark area mapping.

[0270] The embodiment of the present application does not limit the length of the first initial correction array, and the staff can set it based on experience. The first initial correction array is introduced below with an example.

[0271] For example, the first initial correction array can be an array of length 64 : {x1, x2, x3, …, x63, x64}, where, assuming that the indexes of x1-x32 are the indexes of the dark area mapping and the indexes of x33-x64 are the indexes of the bright area mapping, then x1-x32 are all greater than x33-x64.

[0272] It can be seen that the adjustment weights for the indexes mapping bright areas in the first initial correction array are smaller than the adjustment weights for the indexes mapping dark areas. That is, the adjustment weights in the first initial correction array are used to reduce the brightness of bright areas and increase the brightness of dark areas. Thus, when the brightness distribution information indicates that the first image is an extremely bright image, the first initial correction array is directly determined as the target correction array. Based on the target initial correction array, correction parameters for reducing the brightness of bright areas and increasing the brightness of dark areas can be determined. This suppresses the brightness of bright areas in the extremely bright image and increases the brightness of dark areas in the extremely bright image. This is equivalent to performing brightness correction on the extremely bright image, reducing the impact of large bright areas in the image on subsequent adjustments to exposure parameters.

[0273] In the second case, if the brightness distribution information indicates that the first image is transitioning from an extremely bright image to a balanced image, the elements in the first and second arrays are interpolated to obtain a target correction array. Specifically, for each index, the first element corresponding to that index in the first initial correction array and the second element corresponding to that index in the second initial correction array are interpolated, and the interpolated result is used as the element corresponding to that index in the target correction array.

[0274] When the value of the brightness distribution information is within the second value range, it can be determined that the brightness distribution information indicates that the first image is an image transitioning from an extremely bright image to a bright-dark balanced image. The second value range may include multiple values.

[0275] The range of the elements in the second initial correction array is not greater than a preset difference, and the range is the difference between the maximum element and the minimum element in the second initial correction array.

[0276] The embodiment of the present application does not limit the length of the second initial correction array, and the staff can set it based on experience. The second initial correction array is introduced below with an example.

[0277] For example, the second initial correction array can be an array of length 64 : {y1, y2, y3,…, y63, y64}.

[0278] The interpolation processing method is introduced below.

[0279] See also Figure 8a , which is a schematic diagram of the first interpolation process provided in the embodiment of the present application, it can be seen that assuming the first initial correction array is , the second initial correction array is , then by interpolating the elements x1 and y1 corresponding to index 0 in the two arrays, we can obtain the element o1 corresponding to index 0 in the target correction array, and by interpolating the elements x2 and y2 corresponding to index 1 in the two arrays, we can obtain the element o2 corresponding to index 1 in the target correction array. And so on, by interpolating the elements x3 and y3, we can obtain the element o3, until we interpolate the elements x63 and y63, we can obtain the element o63, and by interpolating the elements x64 and y64, we can obtain the element o64.

[0280] Specifically, when interpolating the first element and the second element, the interpolation result can be calculated using an averaging method or other methods, which is not limited in the embodiments of the present application.

[0281] In one embodiment of the present application, the first element with index i in the first initial correction array and the second element with index i in the second initial correction array can be interpolated according to the following expression, and the obtained interpolation result is used as the element weight[i] corresponding to index i in the target correction array:

[0282] (1)

[0283] in, represents the first element, represents the second element, Represents brightness distribution information, It is a first parameter determined based on the value range of the brightness distribution information.

[0284] The above-mentioned C1 can be the result of rounding up the number of integer values ​​included in the value range of the brightness representation information divided by 2. For example, if the brightness distribution information is an integer value determined based on the ratio of bright areas and dark areas in the image and represented by 8 bits, then the value range of the brightness distribution information is [0, 255], and C1 can be the result of rounding up the number of integer values ​​in the above value range divided by 2, which is 128.

[0285] When C1=128, the above expression (1) is expressed as the following expression (2):

[0286] (2)

[0287] In addition, when the value range of the brightness distribution information is [0, 255], the above second value interval can be [1, 127]. That is, when 0<S<128, the above formula is used to interpolate the first element and the second element to obtain the target correction array.

[0288] In this way, based on the above expression, the two elements with the same index in the first initial correction array and the second initial correction array can be quickly interpolated, and the target correction array can be obtained according to the interpolation result. The brightness distribution information is taken into account in the interpolation process, so that the target correction array obtained by interpolation is more suitable for the determined brightness distribution information.

[0289] It can be seen that when the brightness distribution information characterizes the first image as an image transitioning from an extremely bright image to a bright-dark balanced image, the brightness distribution information of the first image is taken into consideration, and the first initial correction array corresponding to the extremely bright image and the second initial correction array corresponding to the bright-dark balanced image are interpolated. This can more accurately and reasonably determine the target correction array suitable for the current first image, so that the brightness correction of the first image can be more accurately performed based on the determined target correction array.

[0290] In the third case, if the brightness distribution information indicates that the first image is a bright-dark balanced image, the second array is directly determined as the target correction array.

[0291] When the value of the brightness distribution information is within a third value range, it can be determined that the brightness distribution information indicates that the first image is a bright-dark balanced image. The third value range may include multiple values, in which case the brightness distribution information of multiple values ​​all indicates that the first image is a bright-dark balanced image. Alternatively, the third value range may include only one value, in which case the brightness distribution information of only one value indicates that the first image is a bright-dark balanced image.

[0292] The range of elements in the second initial correction array is small, that is, the sizes of elements in the second initial correction array are relatively close. Therefore, the adjustment weights corresponding to the bright area and the adjustment weights corresponding to the dark area in the second initial correction array are close. The second initial correction array is directly determined as the target correction array. Based on the approximation of the correction parameters determined for the bright area and the dark area based on the target initial correction array, the brightness of the bright and dark balanced image can be fine-tuned more reasonably.

[0293] In the fourth case, if the brightness distribution information indicates that the first image transitions from a balanced image to an extremely dark image, the elements in the second and third arrays are interpolated to obtain a target correction array. Specifically, for each index, the second element corresponding to that index in the second initial correction array is interpolated with the third element corresponding to that index in the third initial correction array, and the interpolated result is used as the element corresponding to that index in the target correction array.

[0294] When the value of the brightness distribution information is within the fourth value range, it can be determined that the brightness distribution information indicates that the first image is an image transitioning from a bright and dark balanced image to an extremely dark image. The fourth value range may include multiple values.

[0295] The elements corresponding to the first type of indexes in the third initial correction array are greater than the elements corresponding to the second type of indexes.

[0296] The embodiment of the present application does not limit the length of the third initial correction array, and the staff can set it based on experience. The third initial correction array is introduced below with an example.

[0297] For example, the third initial correction array can be an array of length 64 : {z1, z2, z3, …, z63, z64}, where, assuming that the indexes of z1-z32 are the indexes of dark area mapping and the indexes of z33-z64 are the indexes of bright area mapping, then z1-z32 are all smaller than z33-z64.

[0298] The interpolation processing method for the second element and the third element is similar to the interpolation processing method for the first element and the second element mentioned above, which is briefly described below.

[0299] See also Figure 8b , which is a schematic diagram of the second interpolation process provided in the embodiment of the present application, it can be seen that assuming the second initial correction array is , the third initial correction array is , then by interpolating the elements y1 and z1 corresponding to index 0 in the two arrays, we can obtain the element o1 corresponding to index 0 in the target correction array, and by interpolating the elements y2 and z2 corresponding to index 1 in the two arrays, we can obtain the element o2 corresponding to index 1 in the target correction array. And so on, by interpolating the elements y3 and z2, we can obtain the element o3, until we interpolate the elements y63 and z63 to obtain the element o63, and by interpolating the elements y64 and z64 to obtain the element o64.

[0300] In one embodiment of the present application, the second element with index i in the second initial correction array and the third element with index i in the third initial correction array can be interpolated according to the following expression, and the obtained interpolation result is used as the element weight[i] corresponding to index i in the target correction array:

[0301] (3)

[0302] in, represents the third element, is the second parameter determined based on the value range, is a third parameter determined based on a value range.

[0303] The above-mentioned C2 can be the maximum integer value included in the value range. For example, if the value range of the brightness distribution information is [0, 255], then C2 can be 255; the above-mentioned C3 can be the result of rounding down the number of integer values ​​included in the value range divided by 2. For example, if the value range of the brightness distribution information is [0, 255], then C2 can be 127.

[0304] When C1=128, C2=255, and C3=127, the above expression (3) becomes the following expression (4):

[0305] (4)

[0306] In addition, when the value range of the brightness distribution information is [0, 255], the above fourth value interval can be [129, 254]. That is, when 128<S<255, the above formula is used to interpolate the first element and the second element to obtain the target correction array.

[0307] In this way, based on the above expression, the two elements with the same index in the second initial correction array and the third initial correction array can be quickly interpolated, and the target correction array can be obtained according to the interpolation result. The brightness distribution information is taken into account in the interpolation process, so that the target correction array obtained by interpolation is more suitable for the determined brightness distribution information.

[0308] It can be seen that when the brightness distribution information characterizes the first image as an image transitioning from a bright and dark balanced image to an extremely dark image, the brightness distribution information of the first image is taken into consideration, and the second initial correction array corresponding to the bright and dark balanced image and the second initial correction array corresponding to the extremely dark image are interpolated. This can more accurately and reasonably determine the target correction array suitable for the current first image, so that the brightness correction of the first image can be more accurately performed based on the determined target correction array.

[0309] In the fifth case, if the brightness distribution information indicates that the first image is an extremely dark image, the third array can be directly determined as the target correction array.

[0310] When the value of the brightness distribution information is within a fifth value range, it can be determined that the brightness distribution information indicates that the first image is extremely dark. The fifth value range may include multiple values, in which case the brightness distribution information of multiple values ​​all indicates that the first image is extremely dark. Alternatively, the fifth value range may include only one value, in which case the brightness distribution information of only one value indicates that the first image is extremely dark.

[0311] The adjustment weights for the indexes mapping bright areas in the third initial correction array are greater than the adjustment weights for the indexes mapping dark areas. That is, the adjustment weights in the first initial correction array are used to increase the brightness of bright areas and decrease the brightness of dark areas. Thus, when the brightness distribution information indicates that the first image is extremely dark, the third initial correction array is directly determined as the target correction array. Based on the target initial correction array, correction parameters for increasing the brightness of bright areas and decreasing the brightness of dark areas can be determined. This suppresses the brightness of dark areas in extremely dark images and increases the brightness of bright areas in extremely dark images. This is equivalent to performing brightness correction on extremely dark images, reducing the impact of large dark areas in the image on subsequent adjustments to exposure parameters.

[0312] As can be seen from the foregoing description, the brightness type of the first image represented by the brightness distribution information can be determined according to the interval to which the value of the brightness distribution information belongs.

[0313] The first to fifth value intervals can be five consecutive value intervals obtained by dividing the complete value interval of the luminance distribution information. The values ​​included in the five consecutive value intervals can cover all values ​​included in the complete value interval. In this way, for each value of the luminance distribution information, the value interval to which the luminance distribution information belongs can be determined, and thus the luminance type represented by the luminance distribution information can be determined.

[0314] In one embodiment of the present application, the brightness distribution information is an integer value determined according to the ratio of bright areas to dark areas in the image, and the value range is [0, 255].

[0315] In this case, the first value interval can be [0], the second value interval can be [1, 127], the third value interval can be

[128] , the fourth value interval can be [128, 254], and the fifth value interval can be

[255] . Figure 9 As shown, if the brightness distribution information takes a value of 0, the first array is directly determined as the target correction array; if the brightness distribution information takes a value between [1, 127], the elements in the first array and the second array are interpolated to obtain the target correction array; if the brightness distribution information takes a value between 128, the second array is directly determined as the target correction array; if the brightness distribution information takes a value between [129, 254], the elements in the second array and the third array are interpolated to obtain the target correction array; if the brightness distribution information takes a value of 255, the third array is directly determined as the target correction array.

[0316] The following describes the method of first determining whether the target index belongs to the set index range in the aforementioned step S605 and then determining the correction parameter in different ways according to the determination result.

[0317] See first Figure 10 , Figure 10 It intuitively shows how to determine the correction parameters according to the different intervals to which the target index belongs. Figure 10 The method shown is described in detail.

[0318] First, the first index interval and the second index interval are introduced.

[0319] The first index interval is an index interval including indexes smaller than a first value, and the second index interval is an index interval including indexes larger than a second value.

[0320] Specifically, the first index interval may be an interval including the smallest first preset number of indices in the target correction array. When the above-mentioned first preset number is 1, the first index interval only includes index 0, that is, the first index interval is [0]; the second index interval may be an interval including the largest second preset number of indices in the target correction array. When the above-mentioned second preset number is 1, the first index interval only includes the largest index. When the length of the target correction array is 64, the largest index of the target correction array is 63, that is, the second index interval is

[63] .

[0321] In the first case, if the target index is in the first index interval, or the target index is in the second index interval, the element corresponding to the target index in the target correction array can be directly determined as the correction parameter.

[0322] In the second case, if the target index is outside the first index interval and the second index interval, the fourth element and the fifth element are interpolated to obtain the correction parameter.

[0323] It can be seen that when the first index interval is [0] and the second index interval is

[63] , the target index is outside the first index interval and the second index interval, that is, when the target index is at [1, 62], the fourth element and the fifth element are interpolated.

[0324] The fourth element is the element corresponding to the target index in the target correction array, and the fifth element is the element after the fourth element in the target correction array.

[0325] In this case, that is, the element corresponding to the target index and the element corresponding to the next index of the target index are interpolated, and the interpolation result is used as the correction parameter corresponding to the obtained brightness representation information.

[0326] In one embodiment of the present application, the fourth element and the fifth element can be interpolated according to the following expression, and the interpolation result is used as the correction parameter corresponding to the obtained brightness representation information :

[0327] (5)

[0328] in, represents the target index, represents the fourth element, represents the fifth element, represents the brightness representation value obtained, The fourth parameter is determined based on the length of the target correction array and the value range of the brightness representation information.

[0329] C4 can be the ratio of the length of the target correction array to the number of integer values ​​within the range of the brightness representation information, i.e., the compression ratio. For example, if the length of the target correction array is 64 and the number of integer values ​​within the range of the brightness representation information is 1024, then C4 is 1024 / 64 = 16.

[0330] When C4=16, the above expression (5) becomes the following expression (6):

[0331] (6)

[0332] In this way, based on the above expression, the fourth element corresponding to the target index and the fifth element corresponding to the next index of the target index can be quickly interpolated, and a more accurate correction parameter can be obtained according to the interpolation result.

[0333] It can be seen that in this embodiment, after obtaining the target correction array, according to the different index intervals to which the target index mapped by the brightness representation information belongs, it is selected whether to directly determine the element corresponding to the target index in the target correction array as the correction parameter or to obtain the correction parameter through interpolation calculation, thereby improving the accuracy of the final determined correction parameter.

[0334] In one embodiment of the present application, the first index interval is [0] and the second index interval is

[63] . In this case, see Figure 11 If the target index is 0 or 63, the element corresponding to the target index in the target correction array can be directly determined as the correction parameter; if the target index is in [1,62], the fourth and fifth elements are interpolated to obtain the correction parameter.

[0335] According to the automatic exposure scheme introduced above, the following Figure 12 , the overall process of an automatic exposure solution provided in an embodiment of the present application is introduced.

[0336] Figure 12 The configuration file in the config file has a convergence target (Converge Target), which represents the brightness of the expected image, corresponding to the brightness of the reference image mentioned above. Figure 12It can be seen that first, the automatic exposure (AE), auto focus (AF), and automatic white balance (AWB) statistics, also known as the 3A statistics, are obtained from the image captured by the image sensor. Then, the brightness statistics of the image are determined based on the 3A statistics. Then, based on the values ​​of the brightness distribution information, correction parameters are determined, and the brightness statistics of the image are adjusted according to the determined correction parameters. In this way, the exposure parameters can be adjusted based on the brightness statistics and the convergence target.

[0337] It can be seen that in the solution provided in the embodiment of the present application, before adjusting the exposure parameters based on the brightness statistics and the convergence target, the brightness statistics are first corrected according to the brightness distribution information, so that the corrected brightness statistics are more suitable for the subsequent adjustment of the exposure parameters, and the impact of high contrast on the subsequent adjustment of the exposure parameters is reduced. Specifically, the underexposure or overexposure of the image captured according to the adjusted exposure parameters is reduced, so that the brightness of the image is more suitable for viewing by the human eye, and the exposure accuracy is improved.

[0338] The following is an intuitive description of the exposure effect of the image captured using the solution provided in the embodiment of the present application.

[0339] See also Figure 13a and Figure 13b ,in, Figure 13a is a schematic diagram of an image collected using relevant technology. Figure 13b This is a schematic diagram of an image captured using the solution provided in an embodiment of the present application.

[0340] See first Figure 13a It can be seen that since the area where roofs, high-rise buildings and trees are located (dark area) accounts for a large proportion, after using relevant technology for automatic exposure, the overall brightness of the collected image is brighter and the details of the high-rise buildings are difficult to distinguish, that is, the image is overexposed.

[0341] In see Figure 13b It can be seen that in the image captured by the solution provided in the embodiment of the present application, the brightness statistical value is corrected according to the brightness distribution information, which reduces the impact of large dark areas on the subsequent adjustment of exposure parameters. The overall brightness of the image captured after automatic exposure is moderate, and the details of the high-rise buildings can also be seen, which has a good effect of suppressing overexposure.

[0342] The user information involved in the embodiments of this application is all information authorized by the user. The acquisition, storage, use, processing, transmission, provision and disclosure of user information comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0343] In a specific implementation, the present application further provides a computer storage medium, wherein the computer storage medium may store a program, wherein, when the program is executed, the device containing the computer-readable storage medium is controlled to perform some or all of the steps in the above embodiment. The above storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0344] In a specific implementation, an embodiment of the present application further provides a computer program product, which includes executable instructions. When the executable instructions are executed on a terminal, the terminal executes some or all of the steps in the above method embodiment.

[0345] In a specific implementation, an embodiment of the present application further provides a terminal, including: one or more processors and a memory;

[0346] The memory is coupled to the one or more processors, and the memory is used to store computer program code, where the computer program code includes computer instructions. The one or more processors call the computer instructions to enable the terminal to execute the automatic exposure method provided in an embodiment of the present application.

[0347] like Figure 14 As shown, the present application also provides a chip system, which is applied to the terminal 140. The chip system includes one or more processors 1401. The processor 1401 is used to call computer instructions so that the terminal 140 inputs the data to be processed into the chip system. The chip system performs automatic exposure based on the automatic exposure method provided in the embodiment of the present application.

[0348] In one possible implementation, the chip system further includes input and output interfaces for inputting and outputting data.

[0349] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of this application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0350] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor, such as a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0351] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.

[0352] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which can be read and executed by one or more processors. For example, the instructions may be distributed over a network or via other computer-readable media. Thus, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to floppy disks, optical disks, optical discs, compact disc read-only memories (CD-ROMs), magneto-optical disks, read-only memories, random access memories, erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or tangible machine-readable storage for transmitting information via the Internet using electrical, optical, acoustic, or other propagated signals (e.g., carrier waves, infrared signals, digital signals, etc.). Accordingly, machine-readable media includes any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).

[0353] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the accompanying drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such a feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.

[0354] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.

[0355] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "including a" does not exclude the presence of other identical elements in the process, method, article or device that includes the element.

[0356] Although the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the application.

Claims

1. An automatic exposure method, characterized in that: include: Obtaining a first image acquired according to a first exposure parameter; Obtaining brightness representation information of an image area set in the first image, wherein the image area is: each image grid obtained by dividing the first image into regions; Based on the obtained brightness representation information, obtaining brightness distribution information of the first image; Determining, according to the brightness distribution information, a correction parameter of the brightness representation information of the image area; Correcting the brightness representation information of the image area according to the correction parameter corresponding to the image area; adjusting the first exposure parameter according to the corrected brightness representation information and the reference brightness representation information, and capturing the second image according to the adjusted first exposure parameter; If the first proportion of the first image area represented by the brightness distribution information is greater than the second proportion of the second image area, the correction parameter corresponding to the first image area is used to reduce the brightness representation information of the first image area and / or increase the brightness representation information of the second image area, wherein the first image area is: an image area where the brightness representation information is greater than a first brightness threshold, and the second image area is: an image area where the brightness representation information is less than a second brightness threshold; If the brightness distribution information indicates that the first proportion is less than the second proportion, the correction parameter corresponding to the first image area is used to increase the brightness representation information of the first image area and / or reduce the brightness representation information of the second image area; The step of determining, according to the brightness distribution information, a correction parameter of the brightness representation information of the image area comprises: According to the brightness distribution information, a target correction array is determined, wherein the target correction array is a set initial correction array, or the target correction array is obtained by interpolating elements in the initial correction array, there is a mapping relationship between the index of the target correction array and the brightness representation information, the elements in the target correction array represent the adjustment weights corresponding to the brightness representation information, if the brightness distribution information represents that the first proportion is greater than the second proportion, then the elements corresponding to the first category indexes of the target correction array are smaller than the elements corresponding to the second category indexes, if the brightness distribution information represents that the first proportion is less than the second proportion, then the elements corresponding to the first category indexes are larger than the elements corresponding to the second category indexes, the first category indexes are: the indexes of the brightness representation information mapping of the first image area, the second category indexes are: the indexes of the brightness representation information mapping of the second image area; based on the elements corresponding to the target indexes in the target correction array, the correction parameters corresponding to the brightness representation information of the image area are determined, wherein the target indexes are: the indexes of the brightness representation information mapping of the image area.

2. The method according to claim 1, characterized in that The step of determining a target correction array according to the brightness distribution information includes: If the brightness distribution information indicates that the first image is an extremely bright image, the first initial correction array is directly determined as the target correction array, wherein the extremely bright image is: an image whose first proportion is greater than a first determination threshold, and an element corresponding to a first type index of the first initial correction array is less than an element corresponding to a second type index; If the brightness distribution information indicates that the first image is an image transitioning from an extremely bright image to a light-dark balanced image, then for each index, interpolation processing is performed on the first element corresponding to the index in the first initial correction array and the second element corresponding to the index in the second initial correction array, and the obtained interpolation result is used as the element corresponding to the index in the target correction array, wherein the light-dark balanced image is an image in which the difference between the first proportion and the second proportion is less than a second determination threshold, and the extreme difference of the elements in the second initial correction array is not greater than a preset difference; If the brightness distribution information indicates that the first image is a bright-dark balanced image, directly determining the second initial correction array as a target correction array; If the brightness distribution information indicates that the first image is an image transitioning from a light-dark balanced image to an extremely dark image, then for each index, interpolation processing is performed on the second element corresponding to the index in the second initial correction array and the third element corresponding to the index in the third initial correction array, and the obtained interpolation result is used as the element corresponding to the index in the target correction array, wherein the extremely dark image is: an image in which the second proportion is greater than the third determination threshold, and the element corresponding to the first type of index in the third initial correction array is greater than the element corresponding to the second type of index; If the brightness distribution information indicates that the first image is an extremely dark image, the third initial correction array is directly determined as the target correction array.

3. The method according to claim 2, characterized in that The interpolation process is performed on the first element corresponding to the index in the first initial correction array and the second element corresponding to the index in the second initial correction array, and the obtained interpolation result is used as the element corresponding to the index in the target correction array, including: The first element with index i in the first initial correction array and the second element with index i in the second initial correction array are interpolated according to the following expression, and the interpolation result is used as the element weight[i] corresponding to index i in the target correction array: ; in, represents the first element, represents the second element, represents the brightness distribution information, A first parameter determined based on a value range of the brightness distribution information; or The interpolation process is performed on the second element corresponding to the index in the second initial correction array and the third element corresponding to the index in the third initial correction array, and the obtained interpolation result is used as the element corresponding to the index in the target correction array, including: The second element with index i in the second initial correction array and the third element with index i in the third initial correction array are interpolated according to the following expression, and the interpolation result is used as the element weight[i] corresponding to index i in the target correction array: ; in, represents the third element, is a second parameter determined based on the value range, is a third parameter determined based on the value range.

4. The method according to claim 1, characterized in that: The determining, based on the element corresponding to the target index in the target correction array, a correction parameter corresponding to the obtained brightness representation information includes: For the target index mapped to the obtained brightness representation information, the correction parameter corresponding to the obtained brightness representation information is determined in the following manner: If the target index is in the first index interval or the second index interval, directly determine the element corresponding to the target index in the target correction array as the correction parameter corresponding to the obtained brightness representation information, wherein the first index interval is: an index interval including indexes less than a first value, and the second index interval is: an index interval including indexes greater than a second value; If the target index is outside the first index interval and the second index interval, the fourth element and the fifth element are interpolated, and the interpolation result is used as the correction parameter corresponding to the obtained brightness representation information, wherein the fourth element is: the element corresponding to the target index in the target correction array, and the fifth element is: the element after the fourth element in the target correction array.

5. The method according to claim 4, characterized in that The interpolation process is performed on the fourth element and the fifth element, and the interpolation result is used as the correction parameter corresponding to the obtained brightness representation information, including: The fourth and fifth elements are interpolated according to the following expression, and the interpolation result is used as the correction parameter corresponding to the brightness representation information obtained : ; in, represents the target index, represents the fourth element, represents the fifth element, represents the brightness representation value obtained, The fourth parameter is determined based on the length of the target correction array and the value range of the brightness representation information.

6. The method according to claim 1, characterized in that The first number of elements included in the target correction array is less than the second number of values ​​included in the value range of the brightness representation information, and before determining the correction parameter corresponding to the brightness representation information of the image area based on the element corresponding to the target index in the target correction array, the method further includes: determining a compression ratio based on the first number and the second number; The obtained brightness representation information is compressed according to the compression ratio to obtain a target index mapped by the obtained brightness representation information.

7. The method according to claim 1, wherein: The number of the image regions is greater than 1, and the adjusting the first exposure parameter according to the corrected brightness representation information and the reference brightness representation information includes: Determining a position weight of each image region according to the position of each image region in the first image, wherein the position weight reflects the importance of the image region in the first image; performing weighted summation on the corrected brightness representation information according to the position weight of each image region to obtain overall brightness representation information of the first image; The first exposure parameter is adjusted based on the overall brightness representation information and the reference brightness representation information.

8. A terminal, characterized in that: include: one or more processors and memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, where the computer program codes include computer instructions. The one or more processors call the computer instructions to enable the terminal to execute the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: The method comprises a computer program, which, when executed on a terminal, causes the terminal to execute the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The computer program product comprises executable instructions, and when the executable instructions are executed on a terminal, the terminal is caused to execute the method according to any one of claims 1 to 7.

11. A chip system, characterized in that: The chip system is applied to a terminal, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the terminal inputs data into the chip system and executes the method described in any one of claims 1 to 7 for automatic exposure.

Citation Information

Patent Citations

  • Automatic exposure method and device, dynamic range identification method and device, medium and equipment

    CN114449176A