Exposure adjustment method and device, equipment and storage medium
By partitioning the image with brightness histogram, filtering out unstable areas, and determining the adjustment parameters of the target brightness area, the problem of poor brightness stability and accuracy in traditional automatic exposure solutions is solved, and a more stable and accurate exposure effect is achieved.
Patent Information
- Application Number
- CN202510281928.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-06-20
AI Technical Summary
Traditional automatic exposure schemes control target brightness through light metering in fixed areas, which has problems with poor brightness stability and accuracy, especially when most areas in the environment remain unchanged and small areas change.
By determining multiple brightness regions of the brightness histogram of the current frame image, filtering out the overly bright and too dark brightness regions to obtain the target brightness region, determining the brightness adjustment parameters of the current frame image according to the brightness adjustment parameters of the target brightness region, and determining the exposure amount of the next frame image based on the parameter and the exposure amount of the current frame image.
It improves the stability and accuracy of image exposure in automatic exposure scenes, and reduces the impact of brightness changes on the overall scene.
Smart Images

Figure CN120186478A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to image processing technology, including but not limited to an exposure adjustment method, apparatus, device, and storage medium. Background Art
[0002] Automatic exposure is an important function of a camera. Traditional automatic exposure schemes often perform photometry based on a fixed area, and then determine the exposure amount used during exposure according to the photometry result. Furthermore, during the process of shooting the next frame of image or the next video frame, exposure can be achieved based on this exposure amount, thereby completing the shooting.
[0003] However, the automatic exposure scheme that controls the target brightness through photometry of a fixed area has problems of poor brightness stability and accuracy. For example, in a situation where most areas in the environment remain unchanged and a small part of the area changes, based on the average photometry scheme, the brightness will change as the brightness of the small part of the area changes. Therefore, the brightness stability of the entire scene is poor. At the same time, since the exposure amount of most areas is affected by the small part of the changing area, the exposure accuracy will naturally decrease.
[0004] Therefore, how to improve the stability and accuracy of image exposure in the automatic exposure scenario is an urgent problem to be solved. Summary of the Invention
[0005] In view of this, the exposure adjustment method, apparatus, device, and storage medium provided by the embodiments of the present application can improve the stability and accuracy of image exposure in the automatic exposure scenario. The exposure adjustment method, apparatus, device, and storage medium provided by the embodiments of the present application are implemented as follows:
[0006] On the one hand, an embodiment of the present application provides an exposure adjustment method, including:
[0007] Determine multiple brightness regions of the brightness histogram of the current frame image, where the brightness region represents the number of pixels with different brightness values within the corresponding brightness range of the brightness region;
[0008] According to the brightness adjustment parameter of each brightness region in the multiple brightness regions, filter out the over-bright brightness regions and the over-dark brightness regions from the multiple brightness regions to obtain target brightness regions, where the target brightness regions include at least one brightness region, and the brightness adjustment parameter of each brightness region is used to characterize the brightness difference between the actual brightness value of each brightness region and the corresponding reference brightness value. The brightness adjustment parameter of one type of brightness region among the over-bright brightness regions and the over-dark brightness regions is greater than or equal to the brightness adjustment parameter of the target brightness region, and the brightness adjustment parameter of the other type of brightness region among the over-bright brightness regions and the over-dark brightness regions is less than or equal to the brightness adjustment parameter of the target brightness region;
[0009] Determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter of each brightness area in the target brightness area;
[0010] Determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
[0011] Another aspect of the embodiments of the present application provides an exposure adjustment method, including:
[0012] Determine multiple brightness areas of the brightness histogram of the current frame image, where the brightness area represents the number of pixels with different brightness values within the brightness range corresponding to the brightness area;
[0013] Calculate the weight of each brightness area in the multiple brightness areas;
[0014] Determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and weight of each brightness area, where the brightness adjustment parameter of each brightness area is used to characterize the brightness difference between the actual brightness value of each brightness area and the corresponding reference brightness value;
[0015] Determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
[0016] One aspect of the embodiments of the present application further provides an exposure adjustment device, including: a determination module and a filtering module;
[0017] The determination module is configured to determine multiple brightness areas of the brightness histogram of the current frame image, where the brightness area represents the number of pixels with different brightness values within the brightness range corresponding to the brightness area;
[0018] The filtering module is configured to filter out over-bright brightness areas and over-dark brightness areas from the multiple brightness areas according to the brightness adjustment parameter of each brightness area in the multiple brightness areas to obtain a target brightness area, where the target brightness area includes at least one brightness area, and the brightness adjustment parameter of each brightness area is used to characterize the brightness difference between the actual brightness value of each brightness area and the corresponding reference brightness value, the brightness adjustment parameter of one of the over-bright brightness area and the over-dark brightness area is greater than or equal to the brightness adjustment parameter of the target brightness area, and the brightness adjustment parameter of the other of the over-bright brightness area and the over-dark brightness area is less than or equal to the brightness adjustment parameter of the target brightness area;
[0019] The determination module is further configured to determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter of each brightness area in the target brightness area;
[0020] The determination module is further configured to determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
[0021] On the other hand of the embodiment of the present application, an exposure adjustment device is further provided, including: a determination module and a calculation module; the determination module is configured to determine a plurality of brightness regions of the brightness histogram of the current frame image, and the brightness region represents the number of pixels with different brightness values within the corresponding brightness range;
[0022] The calculation module is configured to calculate the weight of each brightness region in the plurality of brightness regions;
[0023] The determination module is further configured to determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and weight of each brightness region, and the brightness adjustment parameter of each brightness region is used to characterize the brightness difference between the actual brightness value of each brightness region and the corresponding reference brightness value;
[0024] The determination module is further configured to determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
[0025] The computer device provided by the embodiment of the present application includes a memory and a processor. The memory stores a computer program that can run on the processor, and the processor implements the method of the embodiment of the present application when executing the program.
[0026] The computer-readable storage medium provided by the embodiment of the present application stores a computer program thereon, and the computer program implements the method provided by the embodiment of the present application when executed by the processor.
[0027] In the exposure adjustment method, device, equipment, and storage medium provided by the embodiment of the present application, first, a plurality of brightness regions of the brightness histogram of the current frame image are determined. The brightness region represents the number of pixels with different brightness values within the corresponding brightness range. Then, according to the brightness adjustment parameter of each brightness region in the plurality of brightness regions, the over-bright brightness regions and over-dark brightness regions are filtered out from the plurality of brightness regions to obtain target brightness regions. The target brightness regions include at least one brightness region, and the brightness adjustment parameter of each brightness region is used to characterize the brightness difference between the actual brightness value of each brightness region and the corresponding reference brightness value. The brightness adjustment parameter of one of the over-bright brightness regions and over-dark brightness regions is greater than or equal to the brightness adjustment parameter of the target brightness region, and the brightness adjustment parameter of the other of the over-bright brightness regions and over-dark brightness regions is less than or equal to the brightness adjustment parameter of the target brightness region; according to the brightness adjustment parameter of each brightness region in the target brightness region, the brightness adjustment parameter of the current frame image is determined, and finally, according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image, the exposure amount of the next frame image is determined. By performing brightness partitioning on the brightness histogram of the current frame image, screening out the over-bright brightness regions and over-dark brightness regions, and then determining the exposure amount of the next frame image according to the remaining target brightness regions, the stability and accuracy of image exposure in the automatic exposure scenario can be improved. Brief Description of the Drawings
[0028] To more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0029] Figure 1 It is a schematic diagram of the application scenario provided in the embodiment of the present application;
[0030] Figure 2 It is a schematic flowchart of the exposure adjustment method provided in the embodiment of the present application;
[0031] Figure 3 It is a schematic diagram of the brightness histogram of the current frame image provided in the embodiment of the present application;
[0032] Figure 4 It is a schematic diagram of partitioning the brightness histogram of the current frame image into brightness regions provided in the embodiment of the present application;
[0033] Figure 5 It is a schematic diagram of the brightness region to be filtered out provided in the embodiment of the present application;
[0034] Figure 6 It is another schematic flowchart of the exposure adjustment method provided in the embodiment of the present application;
[0035] Figure 7 It is a schematic diagram of the mapping relationship between the distance weight and the brightness distance provided in the embodiment of the present application;
[0036] Figure 8 It is a schematic diagram of the mapping relationship between the brightness weight and the relative brightness value provided in the embodiment of the present application;
[0037] Figure 9 It is yet another schematic flowchart of the exposure adjustment method provided in the embodiment of the present application;
[0038] Figure 10 It is a schematic diagram of the structure of the exposure adjustment device provided in an embodiment of the present application;
[0039] Figure 11 It is a schematic diagram of the structure of the exposure adjustment device provided in another embodiment of the present application;
[0040] Figure 12 It is a schematic diagram of the structure of the computer device provided in the embodiment of the present application. Detailed Description of the Embodiments
[0041] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will further describe the specific technical solutions of this application in detail with reference to the accompanying drawings in the embodiments of this application. The following embodiments are used to illustrate this application but are not intended to limit the scope of this application.
[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0043] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
[0044] It should be noted that the terms "first / second / third" involved in the embodiments of this application are used to distinguish similar or different objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when permitted, so that the embodiments of this application described here can be implemented in an order other than that illustrated or described here.
[0045] Automatic exposure is an important function of a camera. Automatic exposure usually dynamically adjusts the exposure amount of the sensor according to the ambient brightness so that the brightness of the image captured by the sensor is accurate. Traditional automatic exposure schemes often rely on metering in a fixed area, such as spot metering, average metering, and center-weighted metering. Then, based on the metering result, the exposure amount used during exposure is determined. Furthermore, during the process of capturing the next frame of an image or the next video frame, exposure can be achieved based on this exposure amount, thus completing the capture.
[0046] Among them, spot metering refers to a metering scheme that only meters a certain area of the image, and the remaining areas do not participate. For example, usually, the center of the frame is used as the only metering area, and only the average brightness of the center area is counted. Average metering calculates the average value of all areas of the entire frame, that is, the brightness of each area of the frame has the same weight in metering. The center-weighted metering scheme sets a weight table with a large weight for the center area and a small weight for the surrounding areas. The image block is weighted and metered according to its corresponding area. After determining the metering scheme, the target brightness is adjusted to ensure subjective brightness effects in this scene. By means of center-weighted metering, while paying more attention to the center area, the brightness effects of the surrounding areas of the frame can be taken into account.
[0047] However, the automatic exposure scheme that controls the target brightness through photometry in a fixed area has problems of poor brightness stability and accuracy. For example, in a situation where most areas in the environment remain unchanged and a small part of the area changes, based on the average photometry scheme, the brightness will change as the brightness of the small part of the area changes. Therefore, the brightness stability of the entire scene is poor. At the same time, because the exposure amount of most areas is affected by the small part of the changing area, the exposure accuracy will naturally decrease.
[0048] Therefore, how to improve the stability and accuracy of image exposure in the automatic exposure scenario is an urgent problem to be solved.
[0049] In order to solve the above problems existing in the related technologies, an exposure adjustment method is provided in the embodiments of the present application. Next, the actual application scenario of this exposure adjustment method will be explained.
[0050] Figure 1 For the schematic diagram of the application scenario provided in the embodiments of the present application, please refer to Figure 1 In this scenario, it may include: a photographing device 110 and a target object 120.
[0051] Among them, the photographing device 110 may be a device used for taking pictures or videos, and may include but is not limited to a mobile phone with a photographing function, a wearable device with a photographing function (such as a smart watch, a smart bracelet, smart glasses, etc.), a tablet computer with a photographing function, a laptop computer with a photographing function, a vehicle-mounted terminal with a photographing function, a personal computer (PC) with a photographing function, a camera, etc. The functions implemented by this method can be realized by a processor in the device calling program code. Of course, the program code can be stored in a computer storage medium. It can be seen that the device at least includes a processor and a storage medium.
[0052] It should be noted that the target object 120 may be an object to be photographed in this scenario. For example: it may be a person, a plant, an animal or other objects, etc. There is no specific limitation here, and corresponding settings can be made according to actual photographing needs.
[0053] In one embodiment, the photographing lens of the photographing device 110 may face the target object 120, so as to realize photographing of the target object 120.
[0054] It should be noted that in actual applications, the target object 120 in this scenario may be one or more. In addition to the target object 120 in this scenario, there may also be other non-target objects, and there is no specific limitation here.
[0055] Next, the implementation process of the exposure adjustment method provided in the embodiments of the present application will be explained based on this application scenario.
[0056] Figure 2 The flowchart of the exposure adjustment method provided in the embodiments of this application is shown as follows. Please refer to Figure 2 , and the method includes:
[0057] S210: Determine multiple brightness regions of the brightness histogram of the current frame image, where the brightness region represents the number of pixels with different brightness values within the corresponding brightness range of the brightness region.
[0058] It should be noted that the execution subject of this method can be Figure 1 the shooting device shown in
[0059] or other electronic devices communicatively connected to the shooting device. For example, the image can be acquired by the shooting device, and the other electronic device can implement the execution of this method. There is no specific limitation here.
[0060] It should be understood that the brightness histogram is a graph used to represent the distribution of each brightness value in an image. It can reflect the distribution of the number of pixels at each brightness value in the image, and can intuitively reflect the brightness information distribution, contrast, and overall brightness of the image. Among them, the horizontal axis (X-axis) of the brightness histogram represents the brightness level. For a grayscale image, the brightness value usually ranges from 0 to 255, where 0 represents black, 255 represents white, and the intermediate values represent different gray levels. The vertical axis (Y-axis) represents the number of pixels at the corresponding brightness level, or the proportion of pixels at that brightness level. Through the brightness histogram, the overall brightness of the image can be viewed, which helps to analyze information such as the contrast and brightness range of the image. For example, if the brightness values of the brightness histogram are concentrated in the lower or higher part, it indicates that the image may be darker or brighter.
[0061] As an example, assume that the brightness histogram of the current frame image is as Figure 3 shown, where 0, 200, 400, 600, 800, 1000, and 1200 shown on the abscissa are brightness values, and 0, 2000, 4000, 6000, 8000, 10000, 12000, 14000, 16000, and 18000 shown on the ordinate are the number of pixels.
[0062] In one embodiment, after obtaining the corresponding luminance histogram based on the current frame image, the luminance histogram is partitioned to obtain a plurality of luminance regions. The plurality of luminance regions may be evenly divided or not, and the present application does not limit this. Each luminance region represents the number of pixels with different luminance values within the luminance range corresponding to the luminance region.
[0063] As an example, based on the above Figure 3 , assume that the schematic diagram of partitioning the luminance histogram of the current frame image into a plurality of luminance regions is as Figure 4 shown. The luminance histogram is divided into five luminance regions, and each luminance region includes a luminance range and the number of pixels corresponding to the luminance range.
[0064] S220: Filter out the over-bright luminance regions and over-dark luminance regions from the plurality of luminance regions according to the luminance adjustment parameters of each luminance region in the plurality of luminance regions to obtain the target luminance regions.
[0065] Among them, the target luminance regions include at least one luminance region. The luminance adjustment parameter of each luminance region is used to characterize the luminance difference between the actual luminance value of each luminance region and the corresponding reference luminance value. The luminance adjustment parameter of one of the over-bright luminance regions and over-dark luminance regions is greater than or equal to the luminance adjustment parameter of the target luminance region, and the luminance adjustment parameter of the other of the over-bright luminance regions and over-dark luminance regions is less than or equal to the luminance adjustment parameter of the target luminance region.
[0066] In some embodiments, the actual luminance value of each luminance region is the average of the luminance values of all pixel points in each luminance region. The reference luminance value corresponding to each luminance region may be a preset luminance value in the photographing device or determined based on the ambient luminance information. For example, the photographing device has a preset luminance model, and the photographing device collects the ambient luminance information in real time during use and inputs it into the luminance model to obtain the corresponding reference luminance value of each luminance region.
[0067] Optionally, the luminance adjustment parameter of each luminance region is used to characterize the luminance difference between the actual luminance value of each luminance region and the corresponding reference luminance value. For example, the luminance adjustment parameter of each luminance region may be the ratio of the actual luminance value of each luminance region to the corresponding reference luminance value, or the ratio of the reference luminance value of each luminance region to the corresponding actual luminance value. The present application does not limit this.
[0068] As an example, assume that the brightness adjustment parameter for each brightness region is the ratio of the reference brightness value to the corresponding actual brightness value of each brightness region. The brightness adjustment parameters corresponding to multiple brightness regions can be sorted, and the brightness regions corresponding to the brightness adjustment parameters greater than the first threshold or less than the second threshold among the sorted multiple brightness adjustment parameters are filtered out to obtain the target brightness regions, where the first threshold is greater than the second threshold. That is to say, the brightness regions that make the overall image too bright or too dark among the multiple brightness regions can be removed to ensure the rationality of the subsequent brightness exposure adjustment amount.
[0069] Exemplarily, based on the above Figure 4 shown embodiment, assume that the brightness histogram is divided into five brightness regions. By calculating the brightness adjustment parameters corresponding to each brightness region, it is determined that the too-dark brightness region and the too-bright brightness region are the second brightness region and the fourth brightness region from left to right. Then, please refer to Figure 5 , which is a schematic diagram of the filtered brightness regions provided in the embodiment of the present application. As Figure 5 shown, filter out the brightness regions corresponding to the shaded parts in the figure, that is, the second brightness region and the fourth brightness region.
[0070] S230: Determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameters of each brightness region in the target brightness region.
[0071] In some embodiments, after obtaining the target brightness region, the brightness adjustment parameter of the current frame image can be determined according to the brightness adjustment parameters corresponding to each brightness region in the target brightness region in combination with the number of target brightness regions.
[0072] Exemplarily, when the target brightness region is one, the brightness adjustment parameter of the current frame image is the brightness adjustment parameter of this one target brightness region; when the target brightness region is two, the brightness adjustment parameter of the current frame image is the average value of the brightness adjustment parameters of these two target brightness regions; when the target brightness region is three or more, the brightness adjustment parameter of the current frame image can be the average value of the brightness adjustment parameters of multiple target brightness regions, or weights can be set for each brightness region in the multiple target brightness regions, and the brightness adjustment parameter of the current frame image is obtained according to the brightness adjustment parameters and the corresponding weights of each brightness region in the multiple target brightness regions; of course, there can be other ways, and the present application does not limit this.
[0073] S240: Determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
[0074] It should be noted that the exposure amount of the current frame image can be a parameter of the exposure amount used when exposing the current frame, and the exposure amount of the next frame image can be determined by adjusting it based on the exposure amount of the current frame image.
[0075] It should be noted that during the process of shooting the next frame image, exposure can be performed according to the exposure amount of the next frame image to obtain the corresponding image.
[0076] In the exposure adjustment method provided by the embodiments of the present application, first, a plurality of brightness regions of the brightness histogram of the current frame image are determined. The brightness region represents the number of pixels with different brightness values within the corresponding brightness range. Then, according to the brightness adjustment parameters of each brightness region among the plurality of brightness regions, the over-bright brightness regions and the over-dark brightness regions are filtered out from the plurality of brightness regions to obtain target brightness regions. The target brightness regions include at least one brightness region. The brightness adjustment parameter of each brightness region is used to characterize the brightness difference between the actual brightness value of each brightness region and the corresponding reference brightness value. The brightness adjustment parameter of one of the over-bright brightness regions and the over-dark brightness regions is greater than or equal to the brightness adjustment parameter of the target brightness region, and the brightness adjustment parameter of the other of the over-bright brightness regions and the over-dark brightness regions is less than or equal to the brightness adjustment parameter of the target brightness region. According to the brightness adjustment parameters of each brightness region in the target brightness regions, the brightness adjustment parameter of the current frame image is determined. Finally, according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image, the exposure amount of the next frame image is determined. By performing brightness partitioning on the brightness histogram of the current frame image, screening out the over-bright and over-dark brightness regions, and then determining the exposure amount of the next frame image based on the remaining target brightness regions, the stability and accuracy of image exposure in the automatic exposure scenario can be improved.
[0077] Based on the above embodiments, one feasible implementation process of the exposure adjustment method provided in the embodiments of the present application will be explained below.
[0078] Please refer to Figure 6 , which is another schematic flowchart of the exposure adjustment method provided in the embodiments of the present application. As Figure 6 shown, the method includes:
[0079] S610: Determine a plurality of brightness regions of the brightness histogram of the current frame image, where the brightness region represents the number of pixels with different brightness values within the brightness range corresponding to the brightness region.
[0080] Optionally, the current frame image may refer to an image that has been exposed. For example, during the process of taking a photo or recording a video through a shooting device, the image displayed in the shooting interface can be the current frame image, and the exposure amount of the next frame image that has not been displayed can be determined based on the currently displayed current frame image.
[0081] It should be understood that a luminance histogram is a graph used to represent the distribution of various luminance values in an image. It can reflect the distribution of the number of pixels at each luminance value in the image, and can intuitively reflect the luminance information distribution, contrast, and overall luminance of the image.
[0082] In one embodiment, after obtaining the corresponding luminance histogram according to the current frame image, the luminance histogram is partitioned to obtain a plurality of luminance regions. The plurality of luminance regions may be evenly divided or not, and the present application does not limit this. Each luminance region represents the number of pixels with different luminance values within the luminance range corresponding to the luminance region.
[0083] As an example, assume that the luminance histogram of the current frame image is divided into N luminance regions, and the luminance value range counted for each luminance region is where, The value range of is [0, 1], representing the statistical ratio starting from the i-th luminance region. Then the corresponding luminance regions can be set to [0.0, 0.2], [0.2, 0.4], [0.4, 0.6], [0.6, 0.8], [0.8, 1.0] respectively.
[0084] S620: Filter out the over-bright luminance regions and over-dark luminance regions from the plurality of luminance regions according to the luminance adjustment parameters of each luminance region in the plurality of luminance regions to obtain the target luminance regions.
[0085] Among them, the target luminance regions include at least one luminance region. The luminance adjustment parameter of each luminance region is used to characterize the luminance difference between the actual luminance value of each luminance region and the corresponding reference luminance value. The luminance adjustment parameter of one type of luminance region among the over-bright luminance regions and over-dark luminance regions is greater than or equal to the luminance adjustment parameter of the target luminance region, and the luminance adjustment parameter of the other type of luminance region among the over-bright luminance regions and over-dark luminance regions is less than or equal to the luminance adjustment parameter of the target luminance region.
[0086] Optionally, the luminance adjustment parameter of each luminance region is used to characterize the luminance difference between the actual luminance value of each luminance region and the corresponding reference luminance value. For example, the luminance adjustment parameter of each luminance region can be the ratio of the actual luminance value of each luminance region to the corresponding reference luminance value, or the ratio of the reference luminance value of each luminance region to the corresponding actual luminance value. The present application does not limit this.
[0087] As an example, assuming that the brightness adjustment parameter of each brightness zone is the ratio of the reference brightness value of each brightness zone to the corresponding actual brightness value, the multiple brightness adjustment parameters corresponding to the multiple brightness zones can be sorted, and the brightness zones corresponding to the brightness adjustment parameters greater than the first threshold or less than the second threshold among the sorted multiple brightness adjustment parameters are filtered out to obtain the target brightness zone, wherein the first threshold is greater than the second threshold. In other words, the brightness zones that make the overall image too bright or too dark can be removed from the multiple brightness zones to ensure the rationality of the subsequent brightness exposure adjustment amount.
[0088] In some embodiments, the overbright brightness region is the brightness region with the largest brightness adjustment parameter among the multiple brightness regions, and the overdark brightness region is the brightness region with the smallest brightness adjustment parameter among the multiple brightness regions. The overbright brightness region and the overdark brightness region are filtered out from the multiple brightness regions, that is, the brightness region with the largest brightness adjustment parameter and the brightness region with the smallest brightness adjustment parameter are filtered out from the multiple brightness regions to obtain the target brightness region.
[0089] In some embodiments, the actual brightness value of each brightness zone is the average brightness value of all pixels in each brightness zone. Assume that the brightness histogram of the current frame image is divided into N brightness zones, and the brightness value range of each brightness zone is in, The value range of is [0, 1], which indicates the statistical proportion starting from the i-th brightness zone. The brightness histogram can be obtained from dark to bright. The brightness value corresponding to the pixel point, then the brightness value of the above i-th brightness area can be obtained by the following formula:
[0090]
[0091] Among them, L i is the brightness value of the i-th brightness zone among N brightness zones, L p is the brightness value of the pth pixel from dark to bright, Indicates that the brightness histogram is sorted from dark to bright. pixels, L total Represents the total number of pixels in the current frame image. Similarly,
[0092] As an example, assuming N = 5, the corresponding brightness range It can be set to [0.0, 0.2], [0.2, 0.4], [0.4, 0.6], [0.6, 0.8], [0.8, 1.0] respectively. Further, the corresponding brightness values of the dark area, medium-dark area, middle area, medium-bright area and high-bright area of the current frame image can be obtained respectively through the above formula. Among them, the above division of the brightness areas is only an example. During the actual division process, it can be evenly divided or not evenly divided, and the present application does not make any limitations in this regard.
[0093] In some embodiments, the reference brightness value corresponding to each brightness area can be a brightness value preset in the shooting device, or can be determined based on the ambient brightness information. For example, there is a brightness model preset in the shooting device, and the shooting device collects the ambient brightness information in real time during use and inputs it into the brightness model to obtain the corresponding reference brightness value for each brightness area.
[0094] Optionally, the ambient brightness information can refer to the relevant information of the environment where the shooting device is located. For example: geographical location information, light intensity information, etc. There is no specific limitation here, and one or more of the information can be selected according to actual needs as the above ambient brightness information.
[0095] Optionally, multiple different reference brightness values can be preset for each brightness area, and each type of ambient brightness information can correspond to a preset reference brightness value. That is to say, the mapping relationship between the reference brightness value and the ambient brightness information can be pre-stored, and the reference brightness value corresponding to the ambient brightness information can be determined after the ambient brightness information is obtained.
[0096] It should be noted that the above-described method for determining the reference brightness value is only one example. During the actual implementation process, the reference brightness value can also be set manually, or the default reference brightness value of the shooting device can be used. There is no specific limitation here.
[0097] In a possible implementation manner, taking the brightness adjustment parameter of each brightness area as the ratio of the reference brightness value of each brightness area to the corresponding actual brightness value, and taking the over-bright brightness area as the brightness area with the largest brightness adjustment parameter among the multiple brightness areas and the over-dark brightness area as the brightness area with the smallest brightness adjustment parameter as an example, after performing brightness partitioning on the brightness histogram of the current frame image to obtain different brightness areas, first determine the actual brightness value L i of different brightness areas, then determine the reference brightness value T i of different brightness areas. Further, based on the reference brightness value T i of each brightness area and the actual brightness value L i of the i-th brightness area, the brightness adjustment ratio corresponding to each brightness area can be obtained, that is, R i i i , and then sort R i perform sorting, filter out the maximum brightness adjustment ratio and the minimum brightness adjustment ratio among them, and the brightness regions corresponding to the remaining brightness adjustment ratios are the selected target brightness regions, and the corresponding brightness adjustment ratios are k = [1, N - 2].
[0098] Exemplarily, assume N is 5, and the reference brightness values T corresponding to the 5 brightness regions i from dark to bright can be set as 8, 20, 40, 70, 150 (the brightness range is 255).
[0099] In this embodiment, by removing the brightness regions that make the overall image too bright or too dark, the rationality of the subsequent brightness exposure adjustment amount can be ensured.
[0100] S630: Calculate the weight of each brightness region in the target brightness region.
[0101] In some embodiments, the weight of each brightness region includes a distance weight, and the distance weight of each brightness region can be determined according to the brightness distance corresponding to each brightness region. The brightness distance is used to characterize the brightness difference between the brightness adjustment parameter of the brightness region and the target brightness adjustment parameter; and / or, the weight of each brightness region includes a brightness weight, and the brightness weight of each brightness region can be determined according to the relative brightness value corresponding to each brightness region. The relative brightness value is used to characterize the difference between the brightness value of the brightness region and the target brightness value.
[0102] In a possible implementation manner, when the brightness adjustment parameter of the brightness region is greater than or equal to the target brightness adjustment parameter, the brightness distance is the ratio of the brightness adjustment parameter of the brightness region to the target brightness adjustment parameter; when the brightness adjustment parameter of the brightness region is less than the target brightness adjustment parameter, the brightness distance is the ratio of the target brightness adjustment parameter to the brightness adjustment parameter of the brightness region.
[0103] It should be noted that the target brightness region includes at least three brightness regions, and the target brightness adjustment parameter is obtained based on the brightness adjustment parameter with the middle value among the brightness adjustment parameters of at least three brightness regions.
[0104] Exemplarily, when the target brightness region includes four brightness regions, the target brightness adjustment parameter is the average value of the brightness adjustment parameters of the middle two of the four brightness regions corresponding to the four brightness regions, or it can also be any one of the brightness adjustment parameters of the middle two of the four brightness regions corresponding to the four brightness regions; when the target brightness region includes five brightness regions, the target brightness adjustment parameter is the brightness adjustment parameter with the middle value among the brightness adjustment parameters of the five brightness regions corresponding to the five brightness regions.
[0105] Optionally, when the target brightness area includes one brightness area, the target brightness adjustment parameter is the brightness adjustment parameter of this one brightness area; when the target brightness area includes two brightness areas, the target brightness adjustment parameter is the average value of the brightness adjustment parameters of these two brightness areas, or any one of the brightness adjustment parameters of the two brightness areas.
[0106] In some embodiments, assuming that the target brightness area includes three brightness areas, first, the brightness adjustment parameters of the target brightness area are sorted, and theoretically, the one in the middle is the reasonable brightness adjustment parameter that takes into account the brightness distribution of the whole picture. Therefore, the one in the middle is set as R filted_mid , and for the rest , their brightness distances dist filted_mid from R k are used to assign different weights . Theoretically, the smaller the dist k , the larger the weight . The distance dist k is obtained by the following formula.
[0107]
[0108] As an example, the mapping relationship between the distance weight in the embodiments of this application and the brightness distance dist k is as shown in Figure 7 . Among them, assuming includes and dist k includes and When , When , When , When ,
[0109] In another possible implementation manner, when the brightness adjustment parameter of the brightness area is greater than or equal to the target brightness adjustment parameter, the brightness distance can also be the ratio of the target brightness adjustment parameter to the brightness adjustment parameter of the brightness area; when the brightness adjustment parameter of the brightness area is less than the target brightness adjustment parameter, the brightness distance can also be the ratio of the brightness adjustment parameter of the brightness area to the target brightness adjustment parameter. Further, the larger the brightness distance of the brightness area, the larger the corresponding distance weight.
[0110] In a possible implementation, the relative brightness value is the ratio of the brightness value of the brightness area to the target brightness value.
[0111] Optionally, the target brightness value is the brightness value corresponding to the brightness area with the lowest brightness value in the target brightness area.
[0112] In some embodiments, since the bright area has a greater impact on the image and large-area overexposure of the image is also unacceptable, a brightness weight is introduced. Assume the relative brightness value L k_low is the brightness area with the lowest brightness value in the filtered target brightness area L k Then, for the brightness area with a higher relative brightness value a greater brightness weight is assigned.
[0113] As an example, the mapping relationship between the brightness weight in the embodiments of the present application and the relative brightness value is as shown in Figure 8 where, assume includes and includes and Then when when when when when
[0114] Optionally, the target brightness value can also be the brightness value corresponding to the brightness area with the largest brightness value in the target brightness area, and the present application does not limit this.
[0115] S640: Determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and weight of each brightness area in the target brightness area.
[0116] In some embodiments, the brightness adjustment parameter of the current frame image can be obtained by performing a weighted sum of the brightness adjustment parameter of each brightness area in the target brightness area and the weight of each brightness area. That is, the brightness adjustment parameter of the current frame image is obtained by performing a weighted sum of the brightness adjustment parameter of each brightness area in the target brightness area, the distance weight, and the brightness weight of each brightness area.
[0117] Exemplarily, the brightness adjustment parameter of the current frame image can be obtained from the following formula:
[0118]
[0119] where, R final is the brightness adjustment parameter of the current frame image, is the brightness adjustment parameter, is the distance weight, is the brightness weight.
[0120] S650: Determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
[0121] In some embodiments, assume that the brightness adjustment parameter of each brightness region is the ratio of the reference brightness value to the corresponding actual brightness value of each brightness region, and the exposure amount of the current frame image is E cur , then the formula for determining the exposure amount of the next frame image is as follows:
[0122] E next = E cur * R final .
[0123] Wherein, E next is the exposure amount of the next frame image, E cur is the exposure amount of the current frame image, R final is the brightness adjustment parameter of the current frame image.
[0124] In the exposure adjustment method provided by the embodiments of the present application, first determine multiple brightness regions of the brightness histogram of the current frame image. The brightness region represents the number of pixels with different brightness values within the brightness range corresponding to the brightness region. Then, according to the brightness adjustment parameter of each brightness region in the multiple brightness regions, filter out the over-bright brightness regions and over-dark brightness regions from the multiple brightness regions to obtain the target brightness regions. Further, calculate the weight of each brightness region in the target brightness regions. According to the brightness adjustment parameter and weight of each brightness region in the target brightness regions, determine the brightness adjustment parameter of the current frame image. Finally, according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image, determine the exposure amount of the next frame image. By filtering out the over-bright brightness regions and over-dark brightness regions in the multiple brightness regions, the exposure of the picture is made more stable. For example, if there are bright regions with large brightness and dark regions with low brightness in the scene, after calculating the exposure adjustment ratio, the exposure adjustment ratio calculated for the bright regions with large brightness will make the picture darker, while the dark regions with small brightness will make the picture brighter. After filtering out these bright regions with large brightness and dark regions with low brightness, the brightness regions that have an adverse impact on the overall picture will be screened out, making the exposure of the picture more stable. At the same time, by setting weights for the target brightness regions and performing weighted summation, the final brightness adjustment parameter pays more attention to the brightness regions that are closer to the middle brightness adjustment parameter and have larger brightness, reducing the influence of the changes in the remaining brightness regions on the final brightness exposure amount, thereby improving the accuracy of the overall picture brightness.
[0125] Based on the above embodiments, please refer to Figure 9, which is another schematic flowchart of the exposure adjustment method provided in the embodiments of the present application. As Figure 9 shown, the method further includes:
[0126] S910: Determine multiple brightness regions of the brightness histogram of the current frame image, where the brightness region represents the number of pixels with different brightness values within the brightness range corresponding to the brightness region.
[0127] Optionally, the current frame image may refer to an image that has been exposed. For example, during the process of taking a photo or recording video through a shooting device, the image displayed in the shooting interface may be the current frame image, and the exposure amount of the next frame image that has not been displayed can be determined based on the currently displayed current frame image.
[0128] It should be understood that the brightness histogram is a graph used to represent the distribution of each brightness value in an image. It can reflect the distribution of the number of pixels at each brightness value in the image, and can intuitively reflect the brightness information distribution, contrast, and overall brightness of the image.
[0129] In one embodiment, after obtaining the corresponding brightness histogram according to the current frame image, the brightness histogram is partitioned to obtain multiple brightness regions. The multiple brightness regions may be evenly divided or not evenly divided, and the present application does not limit this. Each brightness region represents the number of pixels with different brightness values within the brightness range corresponding to the brightness region.
[0130] S920: Calculate the weight of each brightness region among the multiple brightness regions.
[0131] In some embodiments, the weight of each brightness region includes a distance weight. The distance weight of each brightness region can be determined according to the brightness distance corresponding to each brightness region. The brightness distance is used to characterize the brightness difference between the brightness adjustment parameter of the brightness region and the target brightness adjustment parameter; and / or, the weight of each brightness region includes a brightness weight. The brightness weight of each brightness region can be determined according to the relative brightness value corresponding to each brightness region. The relative brightness value is used to characterize the difference between the brightness value of the brightness region and the target brightness value.
[0132] In some embodiments, the brightness adjustment parameter of the brightness region is used to characterize the brightness difference between the actual brightness value of each brightness region and the corresponding reference brightness value. For example, the brightness adjustment parameter of each brightness region can be the ratio of the actual brightness value of each brightness region to the corresponding reference brightness value, or the ratio of the reference brightness value of each brightness region to the corresponding actual brightness value. The present application does not limit this.
[0133] It should be noted that the actual brightness value of each brightness area is the average of the brightness values of all pixel points in each brightness area. The reference brightness value corresponding to each brightness area can be a preset brightness value in the shooting device or determined based on the ambient brightness information.
[0134] In a possible implementation, when the brightness adjustment parameter of the brightness area is greater than or equal to the target brightness adjustment parameter, the brightness distance is the ratio of the brightness adjustment parameter of the brightness area to the target brightness adjustment parameter; when the brightness adjustment parameter of the brightness area is less than the target brightness adjustment parameter, the brightness distance is the ratio of the target brightness adjustment parameter to the brightness adjustment parameter of the brightness area. The smaller the brightness distance of the brightness area, the greater the corresponding distance weight.
[0135] It should be noted that the multiple brightness areas include at least three brightness areas, and the target brightness adjustment parameter is obtained based on the brightness adjustment parameter with the middle value among the brightness adjustment parameters of at least three brightness areas.
[0136] In a possible implementation, when the brightness adjustment parameter of the brightness area is greater than or equal to the target brightness adjustment parameter, the brightness distance can also be the ratio of the target brightness adjustment parameter to the brightness adjustment parameter of the brightness area; when the brightness adjustment parameter of the brightness area is less than the target brightness adjustment parameter, the brightness distance can also be the ratio of the brightness adjustment parameter of the brightness area to the target brightness adjustment parameter. Further, the greater the brightness distance of the brightness area, the greater the corresponding distance weight.
[0137] In a possible implementation, the relative brightness value is the ratio of the brightness value of the brightness area to the target brightness value. Optionally, the target brightness value is the brightness value corresponding to the brightness area with the smallest brightness value among the multiple brightness areas, and the greater the relative brightness value, the greater the corresponding brightness weight.
[0138] S930: Determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and weight of each brightness area, where the brightness adjustment parameter of each brightness area is used to characterize the brightness difference between the actual brightness value and the corresponding reference brightness value of each brightness area.
[0139] In some embodiments, the brightness adjustment parameter of the current frame image can be obtained by performing a weighted sum on the brightness adjustment parameter of each brightness area and the weight of each brightness area among the multiple brightness areas. That is, the brightness adjustment parameter of the current frame image is obtained by performing a weighted sum on the brightness adjustment parameter of each brightness area, the distance weight, and the brightness weight of each brightness area among the multiple brightness areas.
[0140] S940: Determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
[0141] In some embodiments, assuming that the brightness adjustment parameter for each brightness region is the ratio of the reference brightness value to the corresponding actual brightness value of each brightness region, the exposure of the next frame of the image is the product of the exposure of the current frame of the image and the brightness adjustment parameter of the current frame of the image.
[0142] In this embodiment, first, multiple brightness regions of the brightness histogram of the current frame of the image are determined, then the weights of each brightness region in the multiple brightness regions are calculated. According to the brightness adjustment parameter and the weight of each brightness region, the brightness adjustment parameter of the current frame of the image is determined. Finally, according to the brightness adjustment parameter of the current frame of the image and the exposure of the current frame of the image, the exposure of the next frame of the image is determined. After setting weights for the brightness regions and performing weighted summation, the final brightness adjustment parameter pays more attention to the brightness regions that are closer to the middle brightness adjustment parameter and have higher brightness, reducing the influence of changes in the remaining brightness regions on the final brightness exposure, thereby improving the accuracy of the overall picture brightness.
[0143] In summary, in the embodiments of the present application, the brightness histogram of the current frame of the image is partitioned into brightness regions. Since the brightness region corresponding to the largest brightness adjustment parameter will overexpose the entire picture, and similarly, the brightness region corresponding to the smallest brightness adjustment parameter will underexpose the picture, in the embodiments of the present application, after sorting the brightness adjustment parameters of each brightness region, the brightness regions corresponding to the largest and smallest brightness adjustment parameters are removed, and the remaining brightness regions are defined as target brightness regions. Theoretically, after sorting the brightness adjustment parameters, the brightness region in the middle can balance the overall brightness of the picture. Therefore, the present application will calculate the distance weights from the remaining brightness regions to the middle brightness region. The closer to the middle brightness region, the greater the distance weight. At the same time, large-area overexposure is unacceptable for automatic exposure. Therefore, the brightness weights are calculated based on the relative brightness values. The higher the relative brightness value, the greater the brightness weight. Finally, combining the distance weights and the brightness weights, weighted summation is performed on the brightness adjustment parameters of the key brightness regions to obtain the final brightness adjustment parameter. Based on the exposure of the current frame of the image, the exposure of the next frame of the image can be obtained. The embodiments of the present application pay more attention to the accuracy and stability of the target brightness regions. When the brightness of most target brightness regions remains unchanged, even if the brightness of a small part of non-target brightness regions changes, the final exposure can still remain unchanged, thereby ensuring the stability of the brightness of the key content of the picture. At the same time, combining the distance weights and the brightness weights between the target brightness regions makes the final exposure more reasonable.
[0144] It should be understood that although the steps in the above flowcharts are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowcharts may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0145] Based on the foregoing embodiments, an embodiment of the present application provides an exposure adjustment device. The device includes each module included and each unit included in each module, and can be implemented by a processor; of course, it can also be implemented by specific logic circuits. During implementation, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.
[0146] Figure 10 For the structural schematic diagram of the exposure adjustment device provided in an embodiment of the present application, please refer to Figure 10 , the exposure adjustment device includes: a determination module 1010 and a filtering module 1020.
[0147] The determination module 1010 is configured to determine a plurality of brightness regions of the brightness histogram of the current frame image, where the brightness region represents the number of pixels with different brightness values within the corresponding brightness range of the brightness region; the filtering module 1020 is configured to filter out over-bright brightness regions and over-dark brightness regions from the plurality of brightness regions according to the brightness adjustment parameter of each brightness region in the plurality of brightness regions to obtain a target brightness region. The target brightness region includes at least one brightness region. The brightness adjustment parameter of each brightness region is used to characterize the brightness difference between the actual brightness value of each brightness region and the corresponding reference brightness value. The brightness adjustment parameter of one of the over-bright brightness region and the over-dark brightness region is greater than or equal to the brightness adjustment parameter of the target brightness region, and the brightness adjustment parameter of the other of the over-bright brightness region and the over-dark brightness region is less than or equal to the brightness adjustment parameter of the target brightness region; the determination module 1010 is further configured to determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter of each brightness region in the target brightness region; the determination module 1010 is further configured to determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
[0148] In one embodiment, the over-brightness region is the brightness region with the largest brightness adjustment parameter among the multiple brightness regions, and the over-darkness region is the brightness region with the smallest brightness adjustment parameter among the multiple brightness regions.
[0149] In one embodiment, the apparatus further includes: a calculation module. The calculation module is configured to calculate the weight of each brightness region in the target brightness region; and the determination module 1010 is specifically configured to: determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and weight of each brightness region in the target brightness region.
[0150] In one embodiment, the weight of each brightness region includes a distance weight; the calculation module is specifically configured to: determine the distance weight of each brightness region according to the brightness distance corresponding to each brightness region, where the brightness distance is used to characterize the brightness difference between the brightness adjustment parameter of the brightness region and the target brightness adjustment parameter; and / or, the weight of each brightness region includes a brightness weight; the calculation module is specifically configured to: determine the brightness weight of each brightness region according to the relative brightness value corresponding to each brightness region, where the relative brightness value is used to characterize the difference between the brightness value of the brightness region and the target brightness value.
[0151] In one embodiment, when the brightness adjustment parameter of the brightness region is greater than or equal to the target brightness adjustment parameter, the brightness distance is the ratio of the brightness adjustment parameter of the brightness region to the target brightness adjustment parameter; when the brightness adjustment parameter of the brightness region is less than the target brightness adjustment parameter, the brightness distance is the ratio of the target brightness adjustment parameter to the brightness adjustment parameter of the brightness region.
[0152] In one embodiment, the target brightness region includes at least three brightness regions, and the target brightness adjustment parameter is obtained based on the brightness adjustment parameter with a middle value among the brightness adjustment parameters of the at least three brightness regions.
[0153] In one embodiment, the relative brightness value is the ratio of the brightness value of the brightness region to the target brightness value.
[0154] In one embodiment, the target brightness value is the brightness value corresponding to the brightness region with the smallest brightness value in the target brightness region.
[0155] In one embodiment, the determination module 1010 is specifically configured to: perform weighted summation on the brightness adjustment parameter of each brightness region in the target brightness region and the weight of each brightness region to obtain the brightness adjustment parameter of the current frame image.
[0156] In one embodiment, the actual brightness value of each brightness region is the average of the brightness values of all pixel points in each brightness region.
[0157] In one embodiment, the reference brightness value corresponding to each brightness region is determined based on ambient brightness information.
[0158] Figure 11 The following is a schematic structural diagram of an exposure adjustment device provided in another embodiment of the present application. Please refer to Figure 11 , The exposure adjustment device includes: a determination module 1110 and a calculation module 1120.
[0159] The determination module 1110 is configured to determine multiple brightness regions of the brightness histogram of the current frame image, where the brightness regions represent the number of pixels with different brightness values within the brightness range corresponding to the brightness regions; the calculation module 1120 is configured to calculate the weight of each brightness region among the multiple brightness regions; the determination module 1110 is further configured to determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and weight of each brightness region, where the brightness adjustment parameter of each brightness region is used to characterize the brightness difference between the actual brightness value of each brightness region and the corresponding reference brightness value; the determination module 1110 is further configured to determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
[0160] In one embodiment, the weight of each brightness region includes a distance weight; specifically, the calculation module 1120 is configured to: determine the distance weight of each brightness region according to the brightness distance corresponding to each brightness region, where the brightness distance is used to characterize the brightness difference between the brightness adjustment parameter of the brightness region and the target brightness adjustment parameter; and / or, the weight of each brightness region includes a brightness weight; specifically, the calculation module 1120 is configured to: determine the brightness weight of each brightness region according to the relative brightness value corresponding to each brightness region, where the relative brightness value is used to characterize the difference between the brightness value of the brightness region and the target brightness value.
[0161] In one embodiment, when the brightness adjustment parameter of the brightness region is greater than or equal to the target brightness adjustment parameter, the brightness distance is the ratio of the brightness adjustment parameter of the brightness region to the target brightness adjustment parameter; when the brightness adjustment parameter of the brightness region is less than the target brightness adjustment parameter, the brightness distance is the ratio of the target brightness adjustment parameter to the brightness adjustment parameter of the brightness region.
[0162] In one embodiment, the multiple brightness regions include at least three brightness regions, and the target brightness adjustment parameter is obtained based on the brightness adjustment parameter with the middle value among the brightness adjustment parameters of the at least three brightness regions.
[0163] In one embodiment, the relative brightness value is the ratio of the brightness value of the brightness region to the target brightness value.
[0164] In one embodiment, the target brightness value is the brightness value corresponding to the brightness area with the smallest brightness value among the multiple brightness areas.
[0165] In one embodiment, the determining module 1110 is specifically configured to: perform a weighted sum of the brightness adjustment parameters of each brightness area among the multiple brightness areas and the weight of each brightness area to obtain the brightness adjustment parameter of the current frame image.
[0166] In one embodiment, the actual brightness value of each brightness area is the average value of the brightness values of all pixel points in each brightness area.
[0167] In one embodiment, the reference brightness value corresponding to each brightness area is determined based on the ambient brightness information.
[0168] The description of the above device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments. For the technical details not disclosed in the device embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.
[0169] It should be noted that in the embodiments of the present application Figure 10 and Figure 11 The division of the modules of the exposure adjustment device shown is illustrative. It is only a logical function division, and there may be other division methods in actual implementation. In addition, in each embodiment of the present application, each functional unit may be integrated in a processing unit, or may exist separately physically, or two or more units may be integrated in one unit. The above integrated unit may be implemented in the form of hardware, or may be implemented in the form of a software functional unit. It may also be implemented in the form of a combination of software and hardware.
[0170] It should be noted that in the embodiments of the present application, if the above method is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application essentially or the part that contributes to the related technology may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing an electronic device to execute all or part of the methods described in the embodiments of the present application. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc that can store program codes. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0171] Figure 12The following is a schematic structural diagram of the computer device provided in the embodiments of the present application. Please refer to Figure 12 , the embodiments of the present application provide a computer device, which may be the above-mentioned shooting device, or may also be other electronic devices communicatively connected to the shooting device, without specific limitation here. Its internal structural diagram may be as Figure 12 shown. The computer device includes a processor 1220, a memory, and a network interface 1240 connected through a system bus 1210. Among them, the processor 1220 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium 1231 and an internal memory 1232. The non-volatile storage medium 1231 stores an operating system, a computer program, and a database. The internal memory 1232 provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium 1231. The database of the computer device is used to store data. The network interface 1240 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor 1220, the above method is implemented.
[0172] The embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method provided in the above embodiments are implemented.
[0173] The embodiments of the present application provide a computer program product containing instructions. When it runs on a computer, the computer is caused to execute the steps in the method provided in the above method embodiments.
[0174] Those skilled in the art can understand that Figure 12 the structure shown in
[0175] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements. Figure 12 shown computer device. Each program module constituting the device may be stored in the memory of the computer device. The computer program constituted by each program module causes the processor to execute the steps in the methods of the various embodiments of the present application described in this specification.
[0176] It should be noted here that the descriptions of the above storage medium and device embodiments are similar to those of the above method embodiments and have beneficial effects similar to those of the method embodiments. For the technical details not disclosed in the storage medium, storage medium and device embodiments of the present application, please refer to the descriptions of the method embodiments of the present application for understanding.
[0177] It should be understood that the "one embodiment" or "an embodiment" or "some embodiments" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the appearances of "in one embodiment" or "in an embodiment" or "in some embodiments" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the sequence numbers of the above processes do not mean the order of execution is prior or posterior, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The sequence numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments. The descriptions of the above embodiments tend to emphasize the differences between the embodiments, and their similarities or similarities can be referred to each other. For the sake of brevity, they will not be repeated herein.
[0178] The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, object A and / or object B can mean: object A exists alone, object A and object B exist simultaneously, and object B exists alone.
[0179] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, the element defined by the statement "including one..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0180] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the couplings between the components shown or discussed, either directly or indirectly through some interfaces, devices or modules, can be electrical, mechanical or in other forms.
[0181] The modules described above as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules. They can be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0182] In addition, in each embodiment of the present application, all the functional modules can be integrated in a processing unit, or each module can be a separate unit alone, or two or more modules can be integrated in a unit. The above integrated modules can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.
[0183] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, read-only memory (ROM), magnetic disks, or optical discs.
[0184] Alternatively, if the above integrated units of the present application are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the related technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable an electronic device to execute all or part of the methods described in various embodiments of the present application. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, ROM, magnetic disks, or optical discs.
[0185] The methods disclosed in several method embodiments provided by the present application can be arbitrarily combined without conflict to obtain new method embodiments.
[0186] The features disclosed in several product embodiments provided by this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0187] The features disclosed in several method or device embodiments provided by this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0188] As mentioned above, it is only the implementation mode of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. An exposure adjustment method, characterized in that: include: Determine a plurality of brightness regions of a brightness histogram of a current frame image, wherein the brightness regions represent the number of pixels with different brightness values within a brightness range corresponding to the brightness regions; According to the brightness adjustment parameter of each brightness zone in the multiple brightness zones, an over-bright brightness zone and an over-dark brightness zone are filtered out from the multiple brightness zones to obtain a target brightness zone, wherein the target brightness zone includes at least one brightness zone, and the brightness adjustment parameter of each brightness zone is used to characterize the brightness difference between an actual brightness value of each brightness zone and a corresponding reference brightness value, and the brightness adjustment parameter of one of the over-bright brightness zone and the over-dark brightness zone is greater than or equal to the brightness adjustment parameter of the target brightness zone, and the brightness adjustment parameter of the other of the over-bright brightness zone and the over-dark brightness zone is less than or equal to the brightness adjustment parameter of the target brightness zone; Determining a brightness adjustment parameter of the current frame image according to a brightness adjustment parameter of each brightness area in the target brightness area; The exposure amount of the next frame image is determined according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
2. The method according to claim 1, characterized in that The over-bright brightness area is a brightness area with the largest brightness adjustment parameter among the multiple brightness areas, and the over-dark brightness area is a brightness area with the smallest brightness adjustment parameter among the multiple brightness areas.
3. The method according to claim 1, characterized in that The method further comprises: Calculating the weight of each brightness region in the target brightness region; and, The step of determining the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter of each brightness area in the target brightness area includes: The brightness adjustment parameter of the current frame image is determined according to the brightness adjustment parameter and the weight of each brightness area in the target brightness area.
4. The method according to claim 3, characterized in that The weight of each brightness area includes a distance weight; and the calculating the weight of each brightness area in the target brightness area includes: Determining a distance weight of each brightness zone according to a brightness distance corresponding to each brightness zone, wherein the brightness distance is used to characterize a brightness difference between a brightness adjustment parameter of the brightness zone and a target brightness adjustment parameter; and / or, The weight of each brightness region includes a brightness weight; and the calculating the weight of each brightness region in the target brightness region includes: The brightness weight of each brightness area is determined according to the relative brightness value corresponding to each brightness area, and the relative brightness value is used to represent the difference between the brightness value of the brightness area and the target brightness value.
5. The method according to claim 4, characterized in that When the brightness adjustment parameter of the brightness zone is greater than or equal to the target brightness adjustment parameter, the brightness distance is a ratio of the brightness adjustment parameter of the brightness zone to the target brightness adjustment parameter; When the brightness adjustment parameter of the brightness zone is smaller than the target brightness adjustment parameter, the brightness distance is a ratio of the target brightness adjustment parameter to the brightness adjustment parameter of the brightness zone.
6. The method according to claim 4, characterized in that The target brightness area includes at least three brightness areas, and the target brightness adjustment parameter is obtained based on a brightness adjustment parameter with a middle value among the brightness adjustment parameters of the at least three brightness areas.
7. The method according to claim 4, characterized in that The relative brightness value is a ratio of the brightness value of the brightness area to the target brightness value.
8. The method according to claim 4, characterized in that The target brightness value is a brightness value corresponding to a brightness area with the smallest brightness value in the target brightness area.
9. The method according to claim 3, characterized in that: The step of determining the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and the weight of each brightness area in the target brightness area includes: A weighted sum is performed on the brightness adjustment parameter of each brightness area in the target brightness area and the weight of each brightness area to obtain the brightness adjustment parameter of the current frame image.
10. The method according to claim 1, characterized in that The actual brightness value of each brightness area is the average brightness value of all pixels in each brightness area.
11. The method according to claim 1, characterized in that: The reference brightness value corresponding to each brightness zone is determined based on the ambient brightness information.
12. An exposure adjustment method, characterized in that: include: Determine a plurality of brightness regions of a brightness histogram of a current frame image, wherein the brightness regions represent the number of pixels with different brightness values within a brightness range corresponding to the brightness regions; Calculating a weight of each brightness region in the plurality of brightness regions; Determining the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and the weight of each brightness zone, wherein the brightness adjustment parameter of each brightness zone is used to characterize the brightness difference between an actual brightness value of each brightness zone and a corresponding reference brightness value; The exposure amount of the next frame image is determined according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
13. The method according to claim 12, characterized in that The weight of each brightness region includes a distance weight; and the calculating the weight of each brightness region in the plurality of brightness regions includes: Determining a distance weight of each brightness zone according to a brightness distance corresponding to each brightness zone, wherein the brightness distance is used to characterize a brightness difference between a brightness adjustment parameter of the brightness zone and a target brightness adjustment parameter; and / or, The weight of each brightness region includes a brightness weight; and the calculating the weight of each brightness region in the plurality of brightness regions includes: The brightness weight of each brightness area is determined according to the relative brightness value corresponding to each brightness area, and the relative brightness value is used to represent the difference between the brightness value of the brightness area and the target brightness value.
14. The method according to claim 13, characterized in that When the brightness adjustment parameter of the brightness zone is greater than or equal to the target brightness adjustment parameter, the brightness distance is a ratio of the brightness adjustment parameter of the brightness zone to the target brightness adjustment parameter; When the brightness adjustment parameter of the brightness zone is smaller than the target brightness adjustment parameter, the brightness distance is a ratio of the target brightness adjustment parameter to the brightness adjustment parameter of the brightness zone.
15. The method according to claim 13, characterized in that The plurality of brightness zones include at least three brightness zones, and the target brightness adjustment parameter is obtained based on a brightness adjustment parameter with a middle value among the brightness adjustment parameters of the at least three brightness zones.
16. The method according to claim 13, characterized in that The relative brightness value is a ratio of the brightness value of the brightness area to the target brightness value.
17. The method according to claim 13, characterized in that The target brightness value is a brightness value corresponding to a brightness region with the smallest brightness value among the multiple brightness regions.
18. The method according to claim 12, characterized in that The step of determining the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and the weight of each brightness zone includes: A weighted sum is performed on the brightness adjustment parameter of each brightness area in the multiple brightness areas and the weight of each brightness area to obtain the brightness adjustment parameter of the current frame image.
19. The method according to claim 12, characterized in that The actual brightness value of each brightness area is the average brightness value of all pixels in each brightness area.
20. The method according to claim 12, characterized in that The reference brightness value corresponding to each brightness zone is determined based on the ambient brightness information.
21. An exposure adjustment device, characterized in that: include: A determination module, used to determine a plurality of brightness regions of a brightness histogram of a current frame image, wherein the brightness regions represent the number of pixels with different brightness values within a brightness range corresponding to the brightness regions; a filtering module, configured to filter out an over-bright brightness region and an over-dark brightness region from the multiple brightness regions according to a brightness adjustment parameter of each brightness region in the multiple brightness regions, so as to obtain a target brightness region, wherein the target brightness region includes at least one brightness region, the brightness adjustment parameter of each brightness region is used to characterize a brightness difference between an actual brightness value of each brightness region and a corresponding reference brightness value, the brightness adjustment parameter of one of the over-bright brightness region and the over-dark brightness region is greater than or equal to the brightness adjustment parameter of the target brightness region, and the brightness adjustment parameter of the other of the over-bright brightness region and the over-dark brightness region is less than or equal to the brightness adjustment parameter of the target brightness region; The determination module is further used to determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter of each brightness area in the target brightness area; The determination module is further used to determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
22. An exposure adjustment device, characterized in that: include: A determination module, used to determine a plurality of brightness regions of a brightness histogram of a current frame image, wherein the brightness regions represent the number of pixels with different brightness values within a brightness range corresponding to the brightness regions; A calculation module, used for calculating the weight of each brightness area in the plurality of brightness areas; The determination module is further used to determine the brightness adjustment parameter of the current frame image according to the brightness adjustment parameter and the weight of each brightness zone, wherein the brightness adjustment parameter of each brightness zone is used to characterize the brightness difference between the actual brightness value of each brightness zone and the corresponding reference brightness value; The determination module is further used to determine the exposure amount of the next frame image according to the brightness adjustment parameter of the current frame image and the exposure amount of the current frame image.
23. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 11 or 12 to 20 are implemented.
24. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 or 12 to 20 is implemented.