Image exposure method, image exposure apparatus, and computer storage medium
Patent Information
- Application Number
- CN202610584827.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-29
- Publication Date
- 2026-08-18
AI Technical Summary
全局信息统计法容易受背景环境的干扰,在目标与背景亮度差异较大时,难以保证目标主体本身的曝光质量;而感兴趣区域提取法虽将处理范围聚焦于目标所在区域,但在面对目标区域内同时存在极亮和极暗区域的复杂光照场景,即阴阳场景时,往往无法制定有效的调整策略,导致调整后的图像中目标的部分区域仍然过曝或欠曝,严重影响目标的细节呈现与可辨识度
[0022]Compared with existing technologies, the beneficial effects of this application are as follows: By determining the effective target area, it ensures that subsequent processing focuses on the part that can truly reflect the preset target brightness level, eliminating interference from irrelevant areas. Furthermore, by judging the uneven lighting conditions, it identifies whether there is a significant distribution of light and dark areas within the effective target area. When uneven lighting conditions exist, the brightness adjustment benefit is further calculated, that is, the amount required to correct the overall brightness to the effective brightness range is quantified, and the exposure of the preset target is adjusted accordingly. This process can effectively handle complex lighting conditions where the target area simultaneously contains large areas of dark and bright areas, avoiding overexposure or underexposure of the preset target in the image, and improving image quality and adaptive exposure adjustment capabilities under complex lighting conditions.
Smart Images

Figure CN122601987A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and in particular to an image exposure method, an image exposure apparatus, and a computer storage medium. Background Technology
[0002] In image acquisition and processing, automatic exposure control technology plays a crucial role in obtaining high-quality image data. This technology adjusts the exposure parameters of the imaging device to ensure that the target object presents appropriate brightness in the image, thus significantly affecting the subsequent image recognition, analysis, and display effects. In this process, the rationality of the exposure adjustment strategy highly depends on the accurate judgment of the brightness distribution of the target area. Therefore, precise target area analysis and exposure decision-making mechanisms are fundamental prerequisites for ensuring the final image quality.
[0003] Currently, exposure adjustment methods for specific targets mainly rely on global information statistics and region of interest (ROI) extraction. Global information statistics is easily affected by the background environment, and it is difficult to guarantee the exposure quality of the target itself when there is a large difference in brightness between the target and the background. While ROI focuses the processing range on the area where the target is located, it often cannot formulate an effective adjustment strategy when faced with complex lighting scenes where there are both extremely bright and extremely dark areas within the target area, i.e., a yin-yang scene. This results in some areas of the target still being overexposed or underexposed in the adjusted image, which seriously affects the detail and recognizability of the target.
[0004] Therefore, there is an urgent need for a technology that can intelligently identify and specifically process extreme brightness distributions within a target area in order to accurately assess the benefits of brightness adjustment and ultimately achieve adaptive optimization of the brightness of the target area. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides an image exposure method, an image exposure apparatus, and a computer storage medium.
[0006] To address the aforementioned technical problems, this application provides an image exposure method, the image exposure method comprising: A valid target region is determined in a first target image, wherein the first target image contains a preset target, and the valid target region contains at least a portion of the region corresponding to the preset target; it is determined whether the valid target region contains a yin-yang scene, wherein the yin-yang scene indicates that the valid target region contains dark areas and bright areas with a pixel count greater than a preset number, the brightness of the dark areas is distributed in a continuous first brightness range, the brightness of the bright areas is distributed in a continuous second brightness range, and the first brightness range is lower than the second brightness range; if the yin-yang scene exists, the brightness adjustment gain of the valid target region is determined, wherein the brightness adjustment gain indicates the overall brightness correction magnitude of moving the brightness of the valid target region closer to the direction of the valid brightness range; based on the brightness adjustment gain, the exposure of the preset target in the first target image is adjusted to obtain a second target image.
[0007] The yin-yang scene represents the histogram of the effective target area, which has a first peak and a second peak. The brightness corresponding to the first peak is within the first brightness range, and the first brightness corresponding to the first peak represents the brightness of the dark area where the pixel distribution is most concentrated. The brightness corresponding to the second peak is within the second brightness range, and the second brightness corresponding to the second peak represents the brightness of the bright area where the pixel distribution is most concentrated.
[0008] Wherein, the lower limit and upper limit of the effective brightness range are respectively the under-dark threshold and the under-bright threshold; determining the brightness adjustment benefit of the effective target area includes: obtaining the brightening benefit and the darkening benefit of the effective target area, wherein the brightening benefit represents the first sub-brightness amplitude of increasing each invalid under-dark pixel in the effective target area towards the under-dark threshold, and the darkening benefit represents the second sub-brightness amplitude of darkening each invalid over-bright pixel in the effective target area towards the over-bright threshold, the invalid under-dark pixels are pixels with brightness lower than the first brightness and the under-dark threshold, the first brightness represents the brightness of the most concentrated pixel distribution in the dark area, the invalid over-bright pixels are pixels with brightness higher than the second brightness and the over-bright threshold, and the second brightness represents the brightness of the most concentrated pixel distribution in the bright area; the difference between the brightening benefit and the darkening benefit is normalized to obtain the brightness adjustment benefit of the effective target area.
[0009] The method of obtaining the brightening gain of the effective target area includes at least one of the following steps: when the first brightness is greater than the over-dark threshold, the brightening gain is determined as an invalid gain value; when the first brightness is less than the over-dark threshold, the product of the over-dark pixel ratio and the reference over-dark adjustment range is taken as the brightening gain, wherein the over-dark pixel ratio is the percentage of pixels in the effective target area whose brightness is lower than the first brightness, and the reference over-dark adjustment range is the difference between the over-dark threshold and the first brightness; and / or, the method of obtaining the darkening gain of the effective target area includes at least one of the following steps: when the second brightness is less than the over-bright threshold, the darkening gain is determined as an invalid gain. Value; when the second brightness is greater than the overbrightness threshold, the product of the overbrightness pixel ratio and the reference overbrightness adjustment range is used as the darkening gain, wherein the overbrightness pixel ratio is the percentage of pixels in the effective target area whose brightness is higher than the second brightness, and the reference overbrightness adjustment range is the difference between the overbrightness threshold and the second brightness; and / or, the normalization of the gain difference between the brightening gain and the darkening gain to obtain the brightness adjustment gain of the effective target area includes: obtaining the gain difference between the brightening gain and the darkening gain, and using the ratio of the gain difference to the total number of pixels as the brightness adjustment gain, wherein the total number of pixels is the number of pixels in the effective target area.
[0010] The method further includes, after determining the effective target area of the first target image, obtaining a representative brightness of the effective target area when there is no yin-yang scene in the effective target area; and adjusting the exposure of the first target image based on the representative brightness to obtain a second target image.
[0011] Wherein, the yin-yang scene characterizes the presence of a first peak and a second peak in the histogram of the effective target region; the step of obtaining the representative brightness of the effective target region when there is no yin-yang scene in the effective target region includes: when there is only a single peak in the histogram of the effective target region, taking the brightness corresponding to the single peak as the representative brightness of the effective target region; and / or, when there is no peak in the histogram of the effective target region, taking the average brightness of the effective target region as the representative brightness.
[0012] The step of adjusting the exposure of the first target image based on the brightness adjustment gain to obtain a second target image, or adjusting the exposure of the first target image based on the representative brightness to obtain a second target image, includes: using the brightness adjustment gain or the representative brightness as a brightness parameter to be analyzed; not adjusting the exposure of a preset target of the first target image when the brightness parameter to be analyzed is within the corresponding parameter range; and / or adjusting the exposure of a preset target of the first target image when the brightness parameter to be analyzed is outside the corresponding parameter range; wherein the lower limit and upper limit of the reference range corresponding to the brightness adjustment gain are respectively a first gain threshold and a second gain threshold, and the reference range corresponding to the representative brightness is determined based on the effective brightness range.
[0013] Wherein, the lower limit and upper limit of the reference range corresponding to the brightness are both different from the median of the effective brightness range by a preset brightness value; and / or, when the brightness parameter to be analyzed is outside the corresponding parameter range, the exposure adjustment of the preset target of the first target image includes at least one of the following steps: when the brightness parameter to be analyzed is less than the lower limit of the corresponding parameter range, the preset target of the first target image is brightened; when the brightness parameter to be analyzed is greater than the upper limit of the corresponding parameter range, the preset target of the first target image is darkened.
[0014] The step of determining the effective target region of the first target image includes: dividing the first target image into several image units; finding effective image units from the several image units, wherein the proportion of the region belonging to the preset target in the effective image units is greater than a preset proportion; and determining the region corresponding to each effective image unit as the effective target region.
[0015] Before determining the effective target area of the first target image, the method further includes: acquiring an original target image containing the preset target; determining the target lighting scene to which the original target image belongs; and adjusting the exposure of the original target image based on preset adjustment parameters corresponding to the target lighting scene to obtain the first target image.
[0016] The step of determining the target lighting scene to which the original target image belongs includes: obtaining the brightness characterization parameters of the original target image, wherein the brightness characterization parameters include at least one of the following: the contrast of the original target region corresponding to the preset target in the original target image, and the brightness of the target region characterizing the brightness of the original target region; and taking the preset lighting scene that matches the brightness characterization parameters as the target lighting scene.
[0017] Each of the preset lighting scenes corresponds to a preset brightness characterization parameter range, a preset adjustment parameter, and an effective brightness range. The image exposure method further includes: acquiring a sample image dataset under each preset lighting scene, and performing the following steps on the sample image dataset under each lighting scene: determining the initial adjustment parameter of the preset lighting scene based on the initial parameter of the preset lighting scene; adjusting the exposure of the sample image dataset based on the initial adjustment parameter to determine the preset brightness characterization parameter range corresponding to the preset lighting scene; and determining the preset adjustment parameter and the effective brightness range corresponding to the preset lighting scene based on the preset brightness characterization parameter range and the initial adjustment parameter.
[0018] The step of obtaining the brightness of the target region includes: performing region segmentation on the original target image to obtain multiple part regions that respectively represent each part of the preset target; using the multiple part regions to determine several brightness representative regions, wherein each brightness representative region is composed of part regions corresponding to at least one part that can represent the brightness level of the preset target; and combining the brightness of the several brightness representative regions to obtain the brightness of the target region.
[0019] The preset target is a face, and the plurality of brightness representative regions include a first brightness representative region and a second brightness representative region. The first brightness representative region is the area corresponding to the nose, and the second brightness representative region is the area above the nostrils of the entire face. The process of combining the regional brightness of the plurality of brightness representative regions to obtain the target region brightness includes: performing a weighted calculation on the regional brightness of the first brightness representative region and the second brightness representative region to obtain the target region brightness, wherein the weight of the first brightness representative region is higher than the weight of the second brightness representative region.
[0020] To address the aforementioned technical problems, this application also provides an image exposure apparatus, which includes a memory and a processor coupled to the memory; wherein the memory is used to store program data, and the processor is used to execute the program data to implement the image exposure method described above.
[0021] To address the aforementioned technical problems, this application also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the steps in the image exposure method described above.
[0022] Compared with existing technologies, the beneficial effects of this application are as follows: By determining the effective target area, it ensures that subsequent processing focuses on the part that can truly reflect the preset target brightness level, eliminating interference from irrelevant areas. Furthermore, by judging the uneven lighting conditions, it identifies whether there is a significant distribution of light and dark areas within the effective target area. When uneven lighting conditions exist, the brightness adjustment benefit is further calculated, that is, the amount required to correct the overall brightness to the effective brightness range is quantified, and the exposure of the preset target is adjusted accordingly. This process can effectively handle complex lighting conditions where the target area simultaneously contains large areas of dark and bright areas, avoiding overexposure or underexposure of the preset target in the image, and improving image quality and adaptive exposure adjustment capabilities under complex lighting conditions. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a schematic flowchart of an embodiment of the image exposure method provided in this application; Figure 2 This is a schematic flowchart of an embodiment of preprocessing an original target image to obtain a first target image, provided in this application. Figure 3 This is a flowchart illustrating an embodiment of determining the preset brightness characterization parameter range, preset adjustment parameters, and effective brightness range for each preset lighting scene, as provided in this application.
[0024] Figure 4 This is a schematic diagram of the structure of an embodiment of the image exposure apparatus provided in this application; Figure 5 This is a schematic diagram of the structure of an embodiment of the computer storage medium provided in this application. Detailed Implementation
[0025] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application will be described in detail below with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, it should be noted that, for ease of description, only the parts relevant to this application are shown in the accompanying drawings, not all structures. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0026] The terms “first,” “second,” etc. (if applicable) in this application are used to distinguish different objects, not to describe a particular order. Furthermore, the terms “comprising” and “featured,” and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus.
[0027] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0028] The image exposure method of this application is applied to an image exposure apparatus, wherein the image exposure apparatus can be a server, a terminal device, or a system in which the server and the terminal device cooperate with each other. Accordingly, the various parts of the image exposure apparatus, such as various units, sub-units, modules, and sub-modules, can all be set in the server, all in the terminal device, or separately in the server and the terminal device.
[0029] Furthermore, the aforementioned server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules, such as software or software modules used to provide distributed server functionality, or as a single software program or software module; no specific limitations are made here.
[0030] Please refer to the details. Figure 1 , Figure 1 This is a schematic flowchart of an embodiment of the image exposure method provided in this application.
[0031] like Figure 1 As shown, the specific steps are as follows: Step S11: Determine the effective target region of the first target image, wherein the first target image contains a preset target, and the effective target region contains at least a portion of the region corresponding to the preset target.
[0032] In this embodiment, the first target image is an image containing a preset target. The preset target is determined by the specific application scenario and is not specifically limited here.
[0033] For example, in security monitoring scenarios, preset targets can be pedestrians, faces, or vehicles; in industrial inspection scenarios, preset targets can be parts, products, or mechanical components; and in intelligent transportation scenarios, preset targets can be traffic signs, lane lines, or obstacles.
[0034] In an optional embodiment, the first target image may be an original target image captured in real time by an image acquisition device such as a camera, industrial camera or scanner, or it may be an original target image read from a storage device.
[0035] In another optional embodiment, the first target image is an image obtained by performing preliminary exposure adjustments on the original target image.
[0036] Please refer to the details. Figure 2 , Figure 2 This is a schematic flowchart of an embodiment of preprocessing an original target image to obtain a first target image, provided in this application.
[0037] like Figure 2 As shown, the specific steps are as follows: Step S21: Obtain the original target image containing the preset target.
[0038] In this embodiment, the original image can be obtained by real-time acquisition using an image acquisition device or by reading historical image data from a storage device.
[0039] Next, a preset target is determined based on the specific application scenario, and the original image is filtered according to the preset target to obtain an original target image containing the preset target.
[0040] For example, if the specific application scenario is a security monitoring scenario, the preset target can be set as pedestrians, and the original image can be analyzed by the target detection algorithm to select the image containing at least one pedestrian as the original target image.
[0041] Step S22: Determine the target lighting scene to which the original target image belongs.
[0042] In this embodiment, in order to determine the target lighting scene to which the original target image belongs, it is necessary to obtain the brightness characterization parameters of the original target image.
[0043] Among them, the brightness characterization parameters include at least one of the following: the contrast of the original target region corresponding to the preset target in the original target image, and the brightness of the target region characterizing the brightness of the original target region.
[0044] The original target region is the smallest region in the original target image that contains the preset target features. This region can be obtained by processing the original target image using a target detection algorithm.
[0045] For example, when the preset target is a face, the original target area is the smallest region in the original image that contains facial features, including hair, hat, nose, eyebrows, eyes, ears, glasses, etc.; when the preset target is a vehicle, the original target area is the smallest region in the original image that contains vehicle features, including the vehicle body, windows, wheels, headlights, license plate, and vehicle brand logo, etc.
[0046] After obtaining the original target region, the contrast of the original target region corresponding to the preset target in the original target image can be calculated according to formula (1).
[0047] (1) in, The height of the original target area. The width of the original target region. The width of the sliding window centered at any pixel within the original target region. The original target region in pixel coordinates grayscale value at that location In pixel coordinates Centered on, with dimensions of The average grayscale value of all pixels within the sliding window.
[0048] When calculating the brightness of the original target area, since there may be areas that are not the preset target area or are affected by environmental factors, the existence of these areas will directly affect the accuracy of the brightness statistics. Therefore, it is necessary to further segment out a representation area that can truly reflect the target lighting conditions from the original target area, namely the brightness representative area, and calculate the brightness of the original target area based on the brightness representative area.
[0049] Specifically, in order to obtain the brightness representative area, it is first necessary to perform region segmentation on the original target image to obtain multiple part regions that can represent each part of the preset target.
[0050] For example, when the preset target is a pedestrian, the body part area may include the head, torso, limbs, etc.; when the preset target is a vehicle, the body part area may include the roof, doors, hood, windows, etc.; when the preset target is an animal, the body part area may include the head, back, abdomen, limbs, etc.
[0051] Then, using the multiple regions, several brightness representative regions are determined.
[0052] Each brightness representative area is composed of a region corresponding to at least one part that can characterize the brightness level of the preset target. The part that can characterize the brightness level of the preset target refers to those areas where the lighting conditions are relatively stable during the imaging process, which are not easily affected by shadows or specular reflections, and which can reflect the brightness characteristics of the preset target.
[0053] For example, if the target is a pedestrian, the torso can be selected as the brightness representative area to eliminate the possible shadow of the hat brim on the head and the ambient light interference of the limbs; if the target is a vehicle, a large flat area such as the car door or hood can be selected to eliminate the reflective area of the car window and the shadow area of the wheel.
[0054] Finally, by combining the regional brightness of the above-mentioned brightness representative areas, the target region brightness, which characterizes the brightness of the original target region, is obtained.
[0055] The methods for combining the regional brightness of the aforementioned brightness representative areas include, but are not limited to: weighted averaging, taking the median, taking the mode, or weighted fusion based on the area of the region.
[0056] The following section will use a face as an example to explain in detail the calculation process of the target area brightness used to characterize the brightness of the original target area.
[0057] When the preset target is a face, its original target area includes facial features such as hair, hat, nose, eyebrows, eyes, ears, and glasses. These different areas exhibit significant differences in brightness characteristics during imaging. For example, hair typically absorbs more light, resulting in lower brightness; glasses lenses may produce high-reflection light, leading to higher brightness; eyebrows and eyes have complex textures, resulting in uneven brightness distribution; and hats and their shadows may cause localized underexposure. If the entire face area is directly used for brightness statistics, it will be difficult to obtain a brightness value that accurately reflects the lighting conditions of the face.
[0058] Therefore, in this embodiment, the area corresponding to the nose is selected as the first brightness representative area from the above-mentioned different areas, and the area above the nostrils of the entire face is selected as the second brightness representative area. The current brightness of the area is calculated based on the first brightness representative area and the second brightness representative area.
[0059] The specific calculation method for the brightness of the target area can be found in formula (2).
[0060] (2) in, The first brightness represents the region. This represents the second brightness area. The weight of the region represented by the first brightness level. The weight of the region represented by the second brightness.
[0061] Through the above processing, the obtained target area brightness can truly reflect the actual brightness level of the preset target under the current lighting conditions, providing an accurate and reliable data foundation for subsequent target lighting scene discrimination.
[0062] In this embodiment, after obtaining the brightness characterization parameters of the original target image, the target lighting scene in which the original target image is located can be determined based on the matching relationship between the brightness characterization parameters and the preset lighting scene.
[0063] Specifically, one or more preset lighting scenes are pre-constructed, and a corresponding preset brightness characterization parameter range is set for each preset lighting scene.
[0064] The preset lighting scenes include, but are not limited to: extremely dark scenes, low-light scenes, normal scenes, strong light scenes, and backlight scenes.
[0065] Then, the brightness characterization parameter is compared with the preset brightness characterization parameter range of each preset lighting scene. When the brightness characterization parameter falls into the preset brightness characterization parameter range of a preset lighting scene, the preset lighting scene is determined as the target lighting scene of the original target image.
[0066] Furthermore, the specific implementation method for determining the preset brightness characterization parameter range under each preset lighting scene, and determining the preset adjustment parameters and effective brightness range corresponding to that preset lighting scene based on the preset brightness characterization parameter range, can be found in [reference needed]. Figure 3 , Figure 3 This is a flowchart illustrating an embodiment of determining the preset brightness characterization parameter range, preset adjustment parameters, and effective brightness range for each preset lighting scene, as provided in this application. The preset adjustment parameters are used for subsequent coarse exposure adjustments to the original target image, while the effective brightness range is used for subsequent fine exposure adjustments to the original target image.
[0067] like Figure 3 As shown, the specific steps are as follows: Step S31: Obtain a sample image dataset under a preset lighting scenario.
[0068] In this embodiment, for each preset lighting scene, several sample images that can fully characterize the lighting characteristics of the scene are collected in advance to construct a corresponding sample image dataset.
[0069] The methods for obtaining the sample image dataset include, but are not limited to: simulating the lighting scene under a controlled environment for shooting and acquisition, selecting images that match the characteristics of the scene from a historical image database, or generating simulated images with the lighting characteristics of the scene through image enhancement / synthesis techniques.
[0070] To ensure the representativeness and statistical validity of the sample image dataset, the number of sample images under each preset lighting scene should meet the preset sample image number threshold, and the sample images should cover the shooting angle changes, pose changes, background environment changes, or occlusion degree changes of the preset target under that scene.
[0071] For example, if the target is pedestrians, a dataset of sample images of multiple pedestrians should be collected under each preset lighting scenario, at different distances, shooting angles, and with different accessories.
[0072] Step S32: Determine the initial adjustment parameters of the preset lighting scene based on the initial parameters of the preset lighting scene.
[0073] In this embodiment, the initial parameters of the preset lighting scene include, but are not limited to, image feature parameters and imaging device parameters.
[0074] Among them, image feature parameters are quantitative indicators that reflect the lighting conditions of the image, calculated based on the sample image, including but not limited to: average image brightness, image contrast, brightness histogram distribution characteristics, and ratio of bright and dark areas; imaging device parameters refer to the camera shooting parameters recorded when acquiring the sample image, including but not limited to: exposure time, exposure gain, aperture size, and white balance settings.
[0075] The initial parameters for each preset lighting scene are set based on the initial parameters corresponding to a normal indoor lighting scene.
[0076] Specifically, the brightness and contrast values of the image captured by the camera under normal indoor lighting conditions, along with the corresponding exposure time and exposure gain of the camera, will be used as the common initial parameter reference values for each preset lighting scene.
[0077] Then, based on the above initial parameters, the initial adjustment parameters corresponding to each preset lighting scene are determined, which are used to adjust the exposure of the sample image in that scene.
[0078] The determination of the initial adjustment parameters includes, but is not limited to: Based on normal indoor lighting scenes, different settings are made according to the differences in lighting characteristics between each preset lighting scene and the normal scene. For example, a larger exposure compensation intensity is set for extremely dark scenes, an appropriate exposure suppression intensity is set for strong light scenes, and local exposure compensation parameters are set for the target area for backlit scenes.
[0079] Alternatively, by combining the performance characteristics of the image acquisition device and historical experience data, initial adjustment parameters can be directly set for each preset lighting scene. For example, based on the automatic exposure statistics of the camera under different lighting conditions, the exposure time offset and gain offset corresponding to each scene can be determined.
[0080] Alternatively, for each preset lighting scene, a small number of representative sample images can be collected, and the initial adjustment parameters can be quickly calculated by analyzing the differences in brightness characteristics between them and normal scene sample images.
[0081] Step S33: Adjust the exposure of the sample image dataset based on the initial adjustment parameters to determine the preset brightness characterization parameter range corresponding to the preset lighting scene.
[0082] In this embodiment, for each preset lighting scene, based on the initial adjustment parameters corresponding to the scene determined in step S32, the exposure of all sample images in its sample image dataset is adjusted to obtain the sample image set after exposure adjustment.
[0083] The exposure adjustment methods include, but are not limited to, adjusting the simulated exposure time parameters of the image, adjusting the simulated exposure gain parameters, or directly performing brightness mapping transformation on the image pixel values.
[0084] After completing the exposure adjustment, obtain the brightness characterization parameters of each sample image after adjustment. The method for obtaining the brightness characterization parameters can be referred to in step S22, and will not be repeated here.
[0085] Then, statistical analysis is performed on the brightness characterization parameters of all adjusted sample images to determine the preset brightness characterization parameter range corresponding to the scene.
[0086] The determination of the preset brightness characterization parameter range includes, but is not limited to: Based on the range delineation of statistical distribution, that is, calculating the mean μ and standard deviation σ of a certain brightness characterization parameter of all adjusted sample images in the scene, the interval [μ-ασ, μ+ασ] is determined as the preset brightness characterization parameter interval corresponding to the scene, where α is the preset interval width coefficient.
[0087] Alternatively, a percentile-based method can be used, which involves statistically analyzing the distribution of a certain brightness characteristic parameter in all adjusted sample images under the given scenario, and determining the value within a preset percentile range as the parameter interval, such as the range between the 5th percentile and the 95th percentile.
[0088] Alternatively, a clustering analysis method can be used, which involves performing cluster analysis on multiple brightness characterization parameters of all adjusted sample images in the scene, and determining the parameter range covered by the main cluster as the preset brightness characterization parameter interval.
[0089] Step S34: Based on the preset brightness characterization parameter range corresponding to the preset lighting scene and the initial adjustment parameters, determine the preset adjustment parameters and the effective brightness range corresponding to the preset lighting scene.
[0090] In this embodiment, for each preset lighting scene, after obtaining its corresponding preset brightness characterization parameter range, the final preset adjustment parameters and effective brightness range of the scene are determined by an optimization algorithm in combination with the initial adjustment parameters determined in step S32.
[0091] Among them, the preset adjustment parameters refer to the core parameter combination used to adjust the exposure of the image when it is identified that the current image belongs to a certain preset lighting scene during the image acquisition and processing process.
[0092] In this embodiment, the preset adjustment parameters are determined by iteratively optimizing the adjustment parameters starting from the initial adjustment parameters and under the constraints of the preset brightness characterization parameter range.
[0093] Specifically, for each sample image dataset of a preset lighting scene, the exposure of the sample image is adjusted using the current adjustment parameters. The brightness characterization parameters of the adjusted sample image are calculated, and the degree of matching between the adjusted sample image and the preset brightness characterization parameter range is evaluated. At the same time, image quality evaluation indicators such as image entropy, contrast, and gradient magnitude are calculated to quantify the degree of detail retention.
[0094] If the brightness representation parameter of the adjusted image does not stably fall into the preset range or the image quality index does not reach the preset threshold, the parameter is adjusted according to the preset step size and the iteration continues until the brightness representation parameter of the adjusted image stably falls into the preset range and the image quality index reaches the optimal or meets the preset requirements. At this point, the current adjustment parameter is determined as the preset adjustment parameter for this scene.
[0095] The effective brightness range refers to the reasonable threshold range in which the image brightness should be under the preset lighting scene to ensure that the details of the main subject of the image are clear and there are no obviously dark or overexposed areas. It is defined by the overbrightness threshold and the underbrightness threshold. When the image brightness is greater than or equal to the underbrightness threshold and less than or equal to the overbrightness threshold, the image brightness is within the reasonable threshold range.
[0096] In this embodiment, the determination of the effective brightness range includes, but is not limited to: Threshold calibration based on subjective evaluation involves selecting representative images from the sample image dataset for each preset lighting scene, inviting image quality evaluators to subjectively score the images at different brightness levels, and statistically determining the effective brightness range as the range in which most people consider the subject details to be clear and there is no obvious underexposure or overexposure.
[0097] Alternatively, adaptive determination based on objective indicators can be used. For each sample image dataset of a preset lighting scene, image quality evaluation indicators such as peak signal-to-noise ratio, structural similarity index, and gradient magnitude are calculated at different brightness levels. The brightness range in which all indicators remain at a high level is determined as the effective brightness range.
[0098] Alternatively, automatic definition can be based on histogram analysis, which involves statistically analyzing the brightness histogram distribution of all adjusted sample images in the scene and using the brightness range corresponding to the main distribution of the histogram as the effective brightness range.
[0099] Through the above method, each preset lighting scene obtains a set of exclusive, sample-verified parameter configurations, including preset adjustment parameters and effective brightness range, which are used to guide adaptive exposure adjustment during image acquisition and processing.
[0100] The preset adjustment parameters are used to make preliminary coarse exposure adjustments to the original target image so that the image brightness quickly approaches the ideal range; the effective brightness range is used to make subsequent fine exposure adjustments to the original target image to ensure that the image brightness ultimately falls within this range, thereby achieving optimal image quality.
[0101] Step S23: Based on the preset adjustment parameters corresponding to the target lighting scene, adjust the exposure of the original target image to obtain the first target image.
[0102] In this embodiment, after determining the target lighting scene to which the original target image belongs through step S22, the exposure of the original target image can be adjusted according to the preset adjustment parameters corresponding to the target lighting scene to obtain the first target image after preliminary optimization.
[0103] The embodiments described above first select the original target image based on a preset target, and accurately determine the target lighting scene to which it belongs based on brightness characterization parameters. Then, targeted exposure adjustments are performed using preset adjustment parameters corresponding to that scene to obtain the first target image. This process, through a multi-scene pre-calibration method, achieves rapid exposure optimization of the image, effectively accelerating the convergence speed of the original target image and avoiding the problem that a single exposure adjustment method cannot adapt to complex lighting changes, thereby significantly improving the efficiency and quality of subsequent image processing.
[0104] In this embodiment of the application, after obtaining the first target image, it is necessary to determine the effective target area of the first target image.
[0105] The effective target area refers to the area that can truly reflect the preset target brightness level, including at least a portion of the area corresponding to the preset target.
[0106] Specifically, in order to accurately extract the region that can represent the brightness characteristics of the preset target from the first target image, it is first necessary to divide the image, that is, to divide the first target image into several image units.
[0107] As an optional implementation method, the grid division method commonly used in automatic exposure can be adopted to uniformly divide the first target image into several grid units, with each grid unit serving as an independent statistical unit.
[0108] After the image unit division is completed, it is necessary to find the valid image units that meet the preset requirements from a number of image units. That is, calculate the area ratio of the region belonging to the preset target in each image unit. If the ratio is greater than the preset ratio, the image unit is determined to be a valid image unit.
[0109] The calculation method for the area ratio of the region belonging to the preset target in each image unit is shown in formula (3).
[0110] (3) in, The width of each grid cell, The height of each grid cell, A set of grid cells containing a preset target. For grid cell set The Middle Line 1 Column grid cells, for The coordinates of any pixel within the range, For the effective pixel coordinate representation function, if pixel coordinates If the pixel value is greater than the overbrightness threshold or less than the underbrightness threshold, then If it is 0, otherwise, The value is 1.
[0111] The determination of the overbrightness threshold and the overdarkness threshold can be found in step S34, and will not be repeated here.
[0112] Finally, the regions corresponding to the valid image units that meet the preset requirements are merged to obtain the valid target region.
[0113] The effective target area determined by the above method in this application eliminates the parts of the preset target edge area that may be mixed with the background, as well as the areas in the preset target area that are too bright or too dark due to complex textures or partial occlusion, thereby ensuring the accuracy and stability of brightness statistics.
[0114] Step S12: Determine whether the effective target area has a yin-yang scene, wherein the yin-yang scene indicates that the effective target area contains dark areas and bright areas with a pixel count greater than a preset number, the brightness of the dark areas is distributed in a continuous first brightness range, the brightness of the bright areas is distributed in a continuous second brightness range, and the first brightness range is lower than the second brightness range.
[0115] In this embodiment of the application, after determining the effective target area, it is necessary to further determine whether there is a yin-yang scene in the area.
[0116] In this context, the Yin-Yang scene represents an effective target area that simultaneously contains both dark and bright areas with a greater than preset number of pixels. This is equivalent to the existence of large dark and bright areas within the effective target area, meaning that the pixels in the effective target area are mainly concentrated in two brightness ranges: the pixel area corresponding to the low brightness range is the dark area, and the pixel area corresponding to the high brightness range is the bright area. Therefore, the brightness of the dark areas is distributed within a continuous first brightness range, and the brightness of the bright areas is distributed within a continuous second brightness range, with the first brightness range being lower than the second brightness range.
[0117] Specifically, in order to accurately identify yin-yang scenes, it is first necessary to construct a brightness histogram of the effective target area in order to perform statistical analysis on the brightness distribution of the effective target area.
[0118] Optionally, the histogram can be smoothed to eliminate noise interference.
[0119] Then, the presence of two distinct peaks in the histogram is detected using the first-order difference method.
[0120] If the histogram shows a bimodal feature, then the peak values of the two peaks are further calculated.
[0121] If the brightness corresponding to the peak value of one of the peaks is within the brightness distribution range of the dark area, and the brightness corresponding to the peak value of the other peak is within the brightness distribution range of the bright area, then the effective target area is determined to have a yin-yang scene.
[0122] The brightness corresponding to the peak in the dark area represents the brightness level where the pixel distribution in the dark area is most concentrated; the brightness corresponding to the peak in the bright area represents the brightness level where the pixel distribution in the bright area is most concentrated.
[0123] Step S13: In the presence of the yin-yang scene, determine the brightness adjustment benefit of the effective target area, wherein the brightness adjustment benefit represents the overall brightness correction magnitude that moves the brightness of the effective target area closer to the effective brightness range.
[0124] In this embodiment of the application, after determining that there is a scene with light and shadow in the effective target area, it is necessary to further determine the brightness adjustment benefit of the area.
[0125] Among them, the brightness adjustment benefit represents the overall brightness correction magnitude that moves the brightness of the effective target area closer to the effective brightness range. The effective brightness range is defined by the over-dark threshold and the over-bright threshold, with the upper limit being the over-bright threshold and the lower limit being the over-dark threshold.
[0126] The determination of the overbrightness threshold and the overdarkness threshold can be found in step S34, and will not be repeated here.
[0127] Furthermore, the determination of brightness adjustment benefits is based on the brightness distribution characteristics of dark and bright areas and their respective deviations from the effective brightness range. Therefore, brightness adjustment benefits also include brightening benefits and darkening benefits.
[0128] Specifically, the brightening gain characterizes the first sub-brightness brightness magnitude of each invalid over-dark pixel in the effective target area towards the over-darkness threshold.
[0129] Among them, invalid over-dark pixels are pixels whose brightness is lower than the first brightness and the over-dark threshold, while the first brightness refers to the brightness where the pixel distribution in the dark area is most concentrated.
[0130] Please refer to Formula (4), which is the calculation method for the brightening revenue.
[0131] (4) in, It is the ratio of the number of pixels with brightness lower than the first brightness within the effective target area to the total number of pixels within the effective target area. The first brightness, The threshold for excessive darkness.
[0132] Therefore, when calculating the brightening benefit, if the first brightness is less than the dark threshold, it means that the core brightness level of the dark area is already below the lower limit of the effective brightness range. That is, the main body of the dark area is already in a dark state, and most of the pixels in this area are invalid dark pixels, which need to be brightened as a whole.
[0133] If the first brightness level is greater than or equal to the excessively dark threshold, it indicates that the core brightness level of the dark area has exceeded or reached the lower limit of the effective brightness range. This means the main part of the dark area is already within the normal brightness range. In this case, only a small number of pixels darker than the first brightness level may need to be brightened, resulting in relatively low brightening gains, which may even be negligible in some situations. Therefore, during the brightening gain calculation, when the first brightness level is greater than or equal to the excessively dark threshold, the brightening gain is determined as an invalid gain value, for example, set to zero, to avoid unnecessary interference with the calculation of brightness adjustment gains and ensure that the brightness adjustment gains truly reflect the actual correction needs of the effective target area.
[0134] Among them, the darkening gain characterizes the second sub-brightness brightness amplitude of each invalid overbright pixel in the effective target area, darkening it in the direction of the overbrightness threshold.
[0135] Among them, invalid overbright pixels are pixels whose brightness is higher than the second brightness and the overbrightness threshold, while the second brightness refers to the brightness of the pixel distribution in the bright area.
[0136] Please refer to Formula (5), which is the calculation method for darkening benefits.
[0137] (5) Among them, It is the ratio of the number of pixels with a brightness higher than the second brightness level within the effective target area to the total number of pixels within the effective target area. The second brightness, This is the overbrightness threshold.
[0138] Therefore, when calculating the darkening benefit, if the second brightness is greater than the overbrightness threshold, it means that the core brightness level of the bright area is already higher than the lower limit of the effective brightness range. In other words, the main body of the bright area is already overbright, and most of the pixels in this area are invalid overbright pixels, which need to be darkened as a whole.
[0139] If the second brightness level is less than or equal to the overbrightness threshold, it means that the core brightness level of the bright area has fallen below or reached the upper limit of the effective brightness range. This means the main part of the bright area is already within the normal brightness range. In this case, only a small number of brighter pixels above the second brightness level may need to be darkened, resulting in relatively low darkening gains, which may even be negligible in some cases. Therefore, during the darkening gain calculation, when the second brightness level is less than or equal to the overbrightness threshold, the darkening gain is determined as an invalid gain value, for example, set to zero, to avoid unnecessary interference with the calculation of brightness adjustment gains and ensure that the brightness adjustment gains truly reflect the actual correction needs of the effective target area.
[0140] In this embodiment of the application, after calculating the brightening and darkening benefits of the effective target area, the difference between the brightening and darkening benefits can be normalized to obtain the brightness adjustment benefit of the effective target area.
[0141] Please refer to Formula (6), which is the calculation method for obtaining the brightness adjustment benefit based on the brightening benefit and the darkening benefit.
[0142] (6) in, This represents the total number of pixels within the effective target area.
[0143] This application normalizes the absolute difference between brightening and darkening gains by dividing by the total number of pixels into an average adjustment range per unit pixel. This allows the brightness adjustment gains to eliminate the impact of differences in the size of different target areas, comprehensively reflecting the overall demand for exposure correction in scenes with varying brightness levels, and facilitating a unified comparison with preset gain thresholds.
[0144] Step S14: Adjust the exposure of the preset target in the first target image based on the brightness adjustment gain to obtain the second target image.
[0145] In this embodiment of the application, after obtaining the brightness adjustment benefit, the corresponding exposure adjustment strategy is selected to perform targeted processing on the preset target in the first target image based on the comparison result between the brightness adjustment benefit and the preset benefit threshold, so as to obtain the second target image.
[0146] Specifically, the preset revenue thresholds include a first revenue threshold and a second revenue threshold, wherein the first revenue threshold is less than the second revenue threshold.
[0147] Furthermore, the brightness adjustment benefit is compared with the first benefit threshold and the second benefit threshold, and the exposure adjustment method is determined based on the comparison result.
[0148] When the brightness adjustment gain is less than the first gain threshold, it indicates that the overall brightness level of the effective target area is too low and needs to be brightened. At this time, the preset target in the first target image is brightened to obtain a second target image with improved dark detail.
[0149] When the brightness adjustment gain is greater than or equal to the first gain threshold and less than or equal to the second gain threshold, it indicates that the overall brightness distribution of the effective target area is within a reasonable range, and the gains from brightening and darkening are relatively balanced. No additional adjustments are needed; the current exposure state can be maintained. In other words, the second target image is the same as the first target image; no additional exposure adjustments are made to the preset target, and the exposure parameters of the first target image are directly used as the final exposure result.
[0150] When the brightness adjustment gain is greater than the second gain threshold, it indicates that the overall brightness level of the effective target area is too high and needs to be darkened. At this time, the preset target in the first target image is darkened to avoid overexposure and ensure that a second target image with clear details is obtained.
[0151] Optionally, after determining the brightness adjustment benefit, the exposure of the first target image can be directly adjusted based on the brightness adjustment benefit to obtain the second target image.
[0152] This application, through the aforementioned method, adaptively selects an exposure strategy of brightening, not adjusting, or darkening based on the threshold range of the brightness adjustment benefit, thereby performing fine-grained exposure adjustment on a preset target in the first target image and ultimately obtaining the second target image. This process effectively addresses the problem of uneven brightness distribution in scenes with varying light and dark areas, achieving efficient adjustment of exposure parameters while maintaining image quality.
[0153] In another optional embodiment, after determining the effective target area of the first target image, the method further includes: if there is no yin-yang scene in the effective target area, obtaining the representative brightness of the effective target area; and adjusting the exposure of the first target image based on the representative brightness to obtain the second target image.
[0154] In this embodiment, if it is determined that there is no yin-yang scene in the effective target area, that is, there are no dark areas and bright areas with a pixel count greater than the preset number in the effective target area at the same time, it indicates that the brightness distribution in the area is relatively uniform and there is no extreme contrast between light and dark.
[0155] At this point, the representative brightness of the effective target area can be directly obtained. This representative brightness can be a statistical measure that reflects the overall brightness level of the area, such as the brightness mean, median, or peak of the effective target area.
[0156] Then, based on the degree of deviation between the representative brightness and the effective representative brightness reference range, the exposure of the preset target in the first target image is adjusted to obtain the second target image.
[0157] Optionally, the exposure of the first target image can be directly adjusted based on the degree of deviation between the representative brightness and the effective representative brightness reference range to obtain the second target image.
[0158] Specifically, when obtaining representative brightness, different determination methods are used based on the histogram distribution characteristics of the effective target area.
[0159] If the histogram of the effective target area has only one obvious single peak, it indicates that the brightness distribution in the area is relatively concentrated and there is a dominant brightness level. In this case, the brightness corresponding to the single peak is taken as the representative brightness of the effective target area to accurately reflect the actual lighting conditions of the main body of the area and avoid the interference of edge brightness or noise on the statistical results.
[0160] If the histogram of the effective target area does not have obvious peaks, that is, the brightness distribution is relatively flat or uniform, it indicates that there is no dominant brightness level in the area. In this case, the average brightness of the effective target area is used as the representative brightness to comprehensively reflect the overall brightness level of the area without obvious peaks, so as to ensure that the representative brightness is statistically representative.
[0161] The determination of the peak value of the histogram of the effective target region can be referred to in step S12, and will not be repeated here.
[0162] After obtaining the representative brightness, it is further determined whether the representative brightness is within the effective representative brightness reference range. Based on the determination result, an appropriate exposure adjustment strategy is selected to perform targeted processing on the preset target in the first target image to obtain the second target image.
[0163] The effective representative brightness reference range is determined based on the effective brightness range, which is defined by the over-dark threshold and the over-bright threshold. The determination method of the over-bright threshold and the over-dark threshold can be referred to step S34, and will not be repeated here.
[0164] Specifically, the upper limit of the effective luminance reference range is determined according to formula (7).
[0165] (7) in, For excessively dark thresholds, For excessive brightness threshold, This is the preset brightness value.
[0166] The lower limit of the effective luminance reference range is determined according to formula (8).
[0167] (8) in, For excessively dark thresholds, For excessive brightness threshold, This is the preset brightness value.
[0168] When the representative brightness is within the effective representative brightness reference range, it indicates that the overall brightness level of the current effective target area is within the preset reasonable range, which can meet the requirements of image detail presentation and visual perception. At this time, there is no need to adjust the exposure of the first target image, and the first target image can be directly output as the second target image to maintain the stability and continuity of the current exposure parameters.
[0169] When the representative brightness is outside the effective representative brightness reference range, it indicates that the overall brightness level of the current effective target area deviates from the preset reasonable range, and may be too dark or too bright, failing to meet the requirements of image detail presentation and visual perception.
[0170] Therefore, when the representative brightness is outside the effective representative brightness reference range, if the representative brightness is less than the lower limit of the effective representative brightness reference range, it means that the effective target area is generally dark and the details may be buried. At this time, it is necessary to brighten the preset target of the first target image to improve the recognizability of the dark details, so that the brightness of the adjusted effective target area is increased to the effective representative brightness reference range, thereby obtaining the second target image.
[0171] If the representative brightness is greater than the upper limit of the effective representative brightness reference range, it means that the effective target area is generally too bright, which may lead to overexposure and loss of details. In this case, it is necessary to darken the preset target of the first target image to restore the texture information of the bright area, so that the brightness of the adjusted effective target area is reduced to the effective representative brightness reference range, thereby obtaining the second target image.
[0172] This application, through the above embodiments, achieves precise optimization of image exposure under various lighting scenarios by constructing a multi-level adaptive adjustment mechanism. After acquiring the original image containing the preset target, preliminary exposure adjustment is first performed based on a multi-scene pre-calibration method to quickly bring the image brightness close to the ideal range. Subsequently, through grid division and effective image unit screening, effective target areas that can truly reflect the brightness characteristics of the preset target are extracted from the first target image, effectively eliminating interference from background clutter, locally overbright, or locally underbright areas, providing a reliable data foundation for subsequent brightness statistics. On this basis, the brightness distribution characteristics of the effective target areas are further analyzed to identify whether there are any uneven lighting scenes. For areas with uneven lighting scenes, the brightness adjustment benefit is obtained by calculating and normalizing the brightening and darkening benefits, and then adaptively selecting the brightening, maintaining, or darkening adjustment strategy based on the comparison result of this benefit value and the preset benefit threshold. For areas without uneven lighting scenes, the representative brightness is obtained based on the histogram features and compared with a reference range constructed based on the effective brightness range to determine whether adjustment is needed and the direction of adjustment. The entire process is interconnected, and it can automatically select the most suitable exposure correction scheme according to the actual lighting conditions and brightness distribution characteristics of the image. While effectively dealing with complex lighting problems, it also takes into account the preservation of image details and processing efficiency, and significantly improves the adaptability and robustness of image exposure adjustment.
[0173] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0174] To implement the above image exposure method, this application also proposes an image exposure apparatus, for details please refer to [link / reference needed]. Figure 4 , Figure 4 This is a schematic diagram of an embodiment of the image exposure apparatus provided in this application.
[0175] The image exposure apparatus 400 of this embodiment includes a processor 41, a memory 42, an input / output device 43, and a bus 44.
[0176] The processor 41, memory 42, and input / output device 43 are respectively connected to the bus 44. The memory 42 stores program data, and the processor 41 is used to execute the program data to implement the image exposure method described in the above embodiment.
[0177] In this embodiment, processor 41 can also be referred to as a CPU (Central Processing Unit). Processor 41 may be an integrated circuit chip with signal processing capabilities. Processor 41 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor, or processor 41 can be any conventional processor.
[0178] This application also provides a computer storage medium; please refer to the following: Figure 5 , Figure 5 This is a schematic diagram of a computer storage medium according to an embodiment of the present application. The computer storage medium 600 stores a computer program 61, which, when executed by a processor, is used to implement the image exposure method of the above embodiment.
[0179] When the embodiments of this application are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0180] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An image exposure method, characterized in that, The image exposure method includes: Determine the effective target region of a first target image, wherein the first target image contains a preset target, and the effective target region contains at least a portion of the region corresponding to the preset target; Determine whether the effective target area has a yin-yang scene, wherein the yin-yang scene indicates that the effective target area contains dark areas and bright areas with a pixel count greater than a preset number, the brightness of the dark areas is distributed in a continuous first brightness range, the brightness of the bright areas is distributed in a continuous second brightness range, and the first brightness range is lower than the second brightness range; In the presence of the aforementioned yin-yang scene, the brightness adjustment benefit of the effective target area is determined, wherein the brightness adjustment benefit represents the overall brightness correction magnitude that moves the brightness of the effective target area closer to the effective brightness range. Based on the brightness adjustment gains, the exposure of the preset target in the first target image is adjusted to obtain the second target image.
2. The image exposure method according to claim 1, characterized in that, The yin-yang scene represents the histogram of the effective target area, which has a first peak and a second peak. The brightness corresponding to the first peak is within the first brightness range, and the first brightness corresponding to the first peak represents the brightness of the most concentrated pixel distribution in the dark area. The brightness corresponding to the second peak is within the second brightness range, and the second brightness corresponding to the second peak represents the brightness of the most concentrated pixel distribution in the bright area.
3. The image exposure method according to claim 1, characterized in that, The lower and upper limits of the effective brightness range are the over-dark threshold and the over-bright threshold, respectively. Determining the brightness adjustment benefit of the effective target area includes: Obtain the brightening and darkening gains of the effective target area, wherein the brightening gain represents the first sub-brightness magnitude of increasing each invalid over-dark pixel in the effective target area towards the over-darkness threshold, and the darkening gain represents the second sub-brightness magnitude of darkening each invalid over-bright pixel in the effective target area towards the over-brightness threshold. The invalid over-dark pixels are pixels with brightness lower than the first brightness and the over-darkness threshold. The first brightness represents the brightness of the most concentrated pixel distribution in the dark area, and the invalid over-bright pixels are pixels with brightness higher than the second brightness and the over-brightness threshold. The second brightness represents the brightness of the most concentrated pixel distribution in the bright area. The difference between the brightening gain and the darkening gain is normalized to obtain the brightness adjustment gain of the effective target area.
4. The image exposure method according to claim 3, characterized in that, Obtaining the brightening benefit of the effective target area includes at least one of the following steps: If the first brightness is greater than or equal to the dark threshold, the brightening gain is determined to be an invalid gain value; When the first brightness is less than the dark threshold, the product of the dark pixel ratio and the reference dark adjustment range is used as the brightening gain, wherein the dark pixel ratio is the percentage of pixels in the effective target area whose brightness is lower than the first brightness, and the reference dark adjustment range is the difference between the dark threshold and the first brightness. And / or, obtaining the darkening gain of the effective target area includes at least one of the following steps: If the second brightness is less than or equal to the overbrightness threshold, the dimming gain is determined to be an invalid gain value; When the second brightness is greater than the overbrightness threshold, the product of the overbrightness pixel ratio and the reference overbrightness adjustment range is used as the darkening benefit, wherein the overbrightness pixel ratio is the percentage of pixels in the effective target area whose brightness is higher than the second brightness, and the reference overbrightness adjustment range is the difference between the overbrightness threshold and the second brightness. And / or, normalizing the difference between the brightening gain and the darkening gain to obtain the brightness adjustment gain of the effective target area includes: The difference between the brightening gain and the darkening gain is obtained, and the ratio of the gain difference to the total number of pixels is taken as the brightness adjustment gain, wherein the total number of pixels is the number of pixels in the effective target area.
5. The image exposure method according to claim 1, characterized in that, After determining the effective target region of the first target image, the method further includes: In the absence of a yin-yang scene in the effective target area, obtain the representative brightness of the effective target area; The exposure of the first target image is adjusted based on the representative brightness to obtain the second target image.
6. The image exposure method according to claim 5, characterized in that, The yin-yang scene characterizes the histogram of the effective target region, which has a first peak and a second peak. In the case that there is no yin-yang scene in the effective target area, obtaining the representative brightness of the effective target area includes: If the histogram of the effective target region contains only a single peak, the brightness corresponding to the single peak shall be taken as the representative brightness of the effective target region. And / or, If there are no peaks in the histogram of the effective target area, the average brightness of the effective target area is used as the representative brightness.
7. The image exposure method according to claim 1 or 5, characterized in that, The step of adjusting the exposure of the first target image based on the brightness adjustment gain to obtain the second target image, or adjusting the exposure of the first target image based on the representative brightness to obtain the second target image, includes: The brightness adjustment benefit or the representative brightness is used as the brightness parameter to be analyzed. If the brightness parameter to be analyzed is within the corresponding parameter range, the exposure of the preset target in the first target image is not adjusted; and / or, If the brightness parameter to be analyzed is outside the corresponding parameter range, the exposure of the preset target of the first target image is adjusted. Wherein, the lower limit and upper limit of the reference range corresponding to the brightness adjustment benefit are the first benefit threshold and the second benefit threshold, respectively, and the reference range corresponding to the brightness is determined based on the effective brightness range.
8. The image exposure method according to claim 7, characterized in that, The lower limit and upper limit of the reference range corresponding to the brightness are both different from the median of the effective brightness range by a preset brightness value. And / or, if the brightness parameter to be analyzed is outside the corresponding parameter range, the exposure of a preset target in the first target image is adjusted, including at least one of the following steps: If the brightness parameter to be analyzed is less than the lower limit of the corresponding parameter range, the preset target of the first target image is brightened. If the brightness parameter to be analyzed is greater than the upper limit of the corresponding parameter range, the preset target of the first target image is darkened.
9. The image exposure method according to claim 1, characterized in that, Determining the effective target region of the first target image includes: The first target image is divided into several image units; Valid image units are identified from the plurality of image units, wherein the proportion of regions belonging to the preset target in the valid image units is greater than a preset proportion; The region corresponding to each of the effective image units is determined as the effective target region.
10. The image exposure method according to claim 1, characterized in that, Before determining the effective target region of the first target image, the method further includes: Obtain the original target image containing the preset target; Determine the target lighting scene to which the original target image belongs; Based on the preset adjustment parameters corresponding to the target lighting scene, the exposure of the original target image is adjusted to obtain the first target image.
11. The image exposure method according to claim 10, characterized in that, Determining the target lighting scene to which the original target image belongs includes: Obtain the brightness characterization parameters of the original target image, wherein the brightness characterization parameters include at least one of the following: the contrast of the original target region corresponding to the preset target in the original target image, and the brightness of the target region characterizing the brightness of the original target region; The preset lighting scene that matches the brightness characterization parameters is taken as the target lighting scene.
12. The image exposure method according to claim 11, characterized in that, Each of the preset lighting scenes corresponds to a preset brightness characterization parameter range, a preset adjustment parameter, and the effective brightness range; the image exposure method further includes: Obtain a sample image dataset for each preset lighting scene, and perform the following steps on the sample image dataset for each lighting scene: Based on the initial parameters of the preset lighting scene, determine the initial adjustment parameters of the preset lighting scene; Based on the initial adjustment parameters, the exposure of the sample image dataset is adjusted to determine the preset brightness characterization parameter range corresponding to the preset lighting scene; Based on the preset brightness characterization parameter range corresponding to the preset lighting scene and the initial adjustment parameters, the preset adjustment parameters and the effective brightness range corresponding to the preset lighting scene are determined.
13. The image exposure method according to claim 11, characterized in that, The step of obtaining the brightness of the target area includes: The original target image is segmented to obtain multiple part regions that respectively represent each part of the preset target; Using the multiple regions, several brightness representative regions are determined, wherein each brightness representative region is composed of a region corresponding to at least one region that can characterize the brightness level of the preset target; The target area brightness is obtained by combining the regional brightness of the several brightness representative areas.
14. The image exposure method according to claim 13, characterized in that, The preset target is a face, and the plurality of brightness representative areas include a first brightness representative area and a second brightness representative area. The first brightness representative area is the area corresponding to the nose, and the second brightness representative area is the area above the nostrils of the entire face. The process of combining the regional brightness of the several brightness representative regions to obtain the target region brightness includes: The target region brightness is obtained by weighting the regional brightness of the first brightness representative region and the second brightness representative region, wherein the weight of the first brightness representative region is higher than the weight of the second brightness representative region.
15. An image exposure apparatus, characterized in that, The image exposure device includes a memory and a processor, wherein the memory is coupled to the processor; The memory is used to store program data, and the processor is used to execute the program data to implement the image exposure method according to any one of claims 1 to 14.
16. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of the image exposure method as described in any one of claims 1 to 14.