Automatic exposure control method, device, electronic equipment, vehicle and storage medium
By performing exposure compensation processing and evaluation on the input image, and determining the exposure evaluation parameters based on multiple image feature parameters, the problem of inaccurate exposure parameters in existing automatic exposure algorithms is solved, and better image generation results are achieved.
Patent Information
- Application Number
- CN202411012186.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-07-26
AI Technical Summary
In existing automatic exposure algorithms, the preset normal exposure parameters may be inaccurate, resulting in poor image quality. Multiple exposure level samples based on these parameters may also be inaccurate.
By performing exposure compensation processing on the input image, an intermediate image is obtained. Based on multiple image feature parameters of the intermediate image, exposure evaluation parameters are determined. The exposure effect is evaluated comprehensively, from multiple perspectives, and objectively, and finally, an output image with better exposure effect is generated.
It improves the effectiveness and accuracy of image generation, ensuring that the exposure effect of the output image is more objective and precise.
Smart Images

Figure CN118540592B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an automatic exposure control method, device, electronic equipment, vehicle and storage medium. Background Art
[0002] Datasets for automatic exposure algorithms typically contain images from different scenes and conditions to automatically adjust the camera's exposure settings based on lighting and other factors, thereby improving imaging results.
[0003] Currently, an automatic exposure algorithm usually presets a set of normal exposure parameters, and then makes adjustments based on the normal exposure parameters to obtain samples of multiple exposure levels.
[0004] However, in the above method, the preset normal exposure parameters may be inaccurate, and the samples of multiple exposure levels obtained based on the normal exposure parameters may also be inaccurate, resulting in poor effectiveness of the image generated based on the automatic exposure algorithm. Summary of the invention
[0005] The object of the present invention is to provide an automatic exposure control method, device, electronic device, vehicle and storage medium, aiming to solve the problem that preset normal exposure parameters may be inaccurate, and samples of multiple exposure levels obtained based on the normal exposure parameters may also be inaccurate, resulting in poor effectiveness of images generated based on the automatic exposure algorithm.
[0006] In order to achieve the above object, the present invention adopts the following technical scheme:
[0007] In a first aspect, the present application provides an automatic exposure control method, comprising: obtaining an intermediate image based on an input image, wherein the intermediate image is obtained by performing exposure compensation processing on the input image; determining an exposure evaluation parameter of the intermediate image based on at least two image feature parameters of the intermediate image, wherein the exposure evaluation parameter of the intermediate image is used to characterize the exposure effect of the intermediate image; and obtaining an output image based on the exposure evaluation parameter and the input image.
[0008] The automatic exposure control method provided in the embodiment of the present application performs exposure compensation processing on the input image to obtain an intermediate image, and then determines the exposure evaluation parameters of the intermediate image based on at least two image feature parameters of the intermediate image. The exposure effect of the intermediate image can be evaluated comprehensively, from multiple angles, and objectively, and then an output image with better exposure effect can be obtained based on the exposure evaluation parameters and the input image.
[0009] In some embodiments, the image characteristic parameters include at least two of the following: black level, brightness average, color accuracy, effective exposure, overexposure value, and contrast.
[0010] In some embodiments, there are multiple intermediate images, and the output image is obtained based on the exposure evaluation parameter and the input image, specifically including: based on the exposure evaluation parameter, determining the exposure compensation value corresponding to the best intermediate image as the best exposure compensation value, and the best intermediate image is the intermediate image with the highest exposure evaluation parameter; and obtaining the output image based on the best exposure compensation value and the input image.
[0011] In some embodiments, obtaining the output image based on the optimal exposure compensation value and the input image specifically includes: adjusting the optimal exposure compensation value to obtain a target exposure compensation value; and performing exposure compensation processing on the input image based on the target exposure compensation value to obtain the output image.
[0012] In some embodiments, the above-mentioned adjustment of the optimal exposure compensation value to obtain the target exposure compensation value specifically includes: increasing or decreasing the optimal exposure compensation value based on the exposure type to obtain the target exposure compensation value, and the exposure type includes long exposure, short exposure and normal exposure.
[0013] In some embodiments, the above-mentioned increasing or decreasing the optimal exposure compensation value based on the exposure type to obtain the target exposure compensation value specifically includes: increasing or decreasing the optimal exposure compensation value based on the exposure type and the exposure compensation step corresponding to the exposure type to obtain the target exposure compensation value.
[0014] In some embodiments, the above-mentioned increasing or decreasing the optimal exposure compensation value based on the exposure type to obtain the multiple target exposure compensation values specifically also includes: increasing or decreasing the optimal exposure compensation value based on the exposure type and the exposure compensation step corresponding to the exposure type to obtain the target exposure compensation value.
[0015] In some embodiments, the automatic exposure control method further includes: determining an exposure type of the output image based on the target exposure compensation value; and generating a label of the output image based on the exposure type of the output image.
[0016] In some embodiments, the above-mentioned generating the label of the output image based on the exposure type of the output image specifically includes: determining the exposure difference based on the target exposure compensation value and the optimal exposure compensation value; generating the label of the output image based on the ratio between the exposure difference and the exposure type step, and the exposure type step is the step corresponding to the exposure type of the output image.
[0017] In some embodiments, determining the exposure evaluation parameters of the intermediate image based on at least two image feature parameters of the intermediate image specifically includes: determining the exposure evaluation parameters of the intermediate image based on at least two image feature parameters of the intermediate image and a weight coefficient of each image feature parameter.
[0018] In some embodiments, the input image is a high dynamic range image.
[0019] In some embodiments, the automatic exposure control method also includes: acquiring multiple initial images taken in the same scene, the multiple initial images including long exposure images, normal exposure images and short exposure images; obtaining the input image based on the attention feature of each of the initial images and the fusion feature of the multiple initial images, the attention feature is obtained using the attention mechanism, and the fusion feature is obtained by aligning the multiple initial images.
[0020] In a second aspect, the present application provides an automatic exposure control device, comprising a processing unit and a determination unit: the processing unit is used to obtain an intermediate image based on an input image, and the intermediate image is obtained by performing exposure compensation processing on the input image; the determination unit is used to determine an exposure evaluation parameter of the intermediate image based on at least two image feature parameters of the intermediate image, and the exposure evaluation parameter of the intermediate image is used to characterize the exposure effect of the intermediate image; the processing unit is also used to obtain an output image based on the exposure evaluation parameter and the input image.
[0021] In some embodiments, the image characteristic parameters include at least two of the following: black level, brightness average, color accuracy, effective exposure, overexposure value, and contrast.
[0022] In some embodiments, there are multiple intermediate images, and the determination unit is specifically used to determine the exposure compensation value corresponding to the best intermediate image as the best exposure compensation value based on the exposure evaluation parameter, and the best intermediate image is the intermediate image with the highest exposure evaluation parameter; the processing unit is specifically used to obtain the output image based on the best exposure compensation value and the input image.
[0023] In some embodiments, the processing unit is further specifically used to adjust the optimal exposure compensation value to obtain a target exposure compensation value; the processing unit is further specifically used to perform exposure compensation processing on the input image based on the target exposure compensation value to obtain the output image.
[0024] In some embodiments, the processing unit is further specifically used to increase or decrease the optimal exposure compensation value based on the exposure type to obtain the target exposure compensation value, and the exposure type includes long exposure, short exposure and normal exposure.
[0025] In some embodiments, the processing unit is further specifically configured to increase or decrease the optimal exposure compensation value based on the exposure type and the exposure compensation step corresponding to the exposure type to obtain the target exposure compensation value.
[0026] In some embodiments, the determination unit is further used to determine the exposure type of the output image based on the target exposure compensation value; the processing unit is further used to generate a label of the output image based on the exposure type of the output image, and the exposure type step size is the step size corresponding to the exposure type of the output image.
[0027] In some embodiments, the determination unit is further specifically used to determine the exposure difference value based on the target exposure compensation value of the output image and the optimal exposure compensation value; the processing unit is further specifically used to generate a label for the output image based on a ratio between the exposure difference value and the exposure type step length, and the exposure type step length is a step length corresponding to the exposure type of the output image.
[0028] In some embodiments, the determination unit is further specifically configured to determine the exposure evaluation parameter of the intermediate image based on at least two image feature parameters of the intermediate image and a weight coefficient of each image feature parameter.
[0029] In some embodiments, the input image is a high dynamic range image.
[0030] In some embodiments, the automatic exposure control device also includes an acquisition unit, which is used to acquire multiple initial images taken in the same scene, and the multiple initial images include long exposure images, normal exposure images and short exposure images; the processing unit is also used to obtain the input image based on the attention feature of each initial image and the fusion feature of the multiple initial images, the attention feature is obtained by using the attention mechanism, and the fusion feature is obtained by aligning the multiple initial images.
[0031] In a third aspect, the present application provides an electronic device comprising: a processor and a memory configured to store processor executable instructions; wherein the processor is configured to execute the instructions to implement any one of the optional automatic exposure control methods in the first aspect above.
[0032] In a fourth aspect, the present application provides a vehicle, comprising the automatic exposure control device of the second aspect or the electronic device of the third aspect.
[0033] In a fifth aspect, the present application provides a computer-readable storage medium having instructions stored thereon. When the instructions in the computer-readable storage medium are executed by an electronic device, the electronic device is enabled to execute any one of the optional automatic exposure control methods in the first aspect described above.
[0034] In a sixth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on a processor of an electronic device, the electronic device is enabled to execute any optional automatic exposure control method as described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0036] Figure 1 A flowchart of an automatic exposure control method provided in an embodiment of the present application;
[0037] Figure 2 A flowchart of another automatic exposure control method provided in an embodiment of the present application;
[0038] Figure 3 A flowchart of another automatic exposure control method provided in an embodiment of the present application;
[0039] Figure 4 A schematic diagram of generating a target exposure compensation value provided by an embodiment of the present application;
[0040] Figure 5 A flowchart of another automatic exposure control method provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of generating a high dynamic range image provided by an embodiment of the present application;
[0042] Figure 7 A schematic diagram of the structure of an automatic exposure control device provided in an embodiment of the present application;
[0043] Figure 8 A block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "plurality" means two or more.
[0046] In the embodiments of the present invention, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, article or device including the element.
[0047] In the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0048] The following explains some concepts involved in an automatic exposure control method, device, electronic device and storage medium provided in the embodiments of the present application.
[0049] Tone mapping algorithm: A technique for converting a high-dynamic range (HDR) image into a low dynamic range (LDR) image, approximating the look and feel of a high-dynamic range image in a medium with limited dynamic range.
[0050] Exposure compensation: The amount of exposure that is increased or decreased during automatic exposure to compensate for the error of the camera's automatic exposure system or to achieve a specific artistic effect. Exposure compensation adjustments are usually in units of exposure value (EV), with each EV value corresponding to a one-fold change in exposure.
[0051] Bracketing: It means that in one shot, 3 or 5 photos with different exposure values are formed by using the middle exposure value, reduced exposure value and increased exposure value. Among the photos with different exposure values, there can be photos that are more suitable for the required exposure value. In addition, HDR images can be synthesized from these photos.
[0052] In the related art, the training data sets of the automatic exposure algorithm usually contain images under different scenes and conditions. These training data sets are intended to train the automatic exposure algorithm so that it can automatically adjust the camera's exposure settings according to lighting and other factors, thereby improving the imaging effect.
[0053] In the related art, sample acquisition and labeling methods include methods based on manual labeling, methods based on brightness level labeling, and bracketing exposure capture methods based on preset automatic exposure control (automatic exposure, AE), etc.
[0054] Method based on manual labeling: different degrees of bracketing exposure data are obtained by increasing or decreasing the exposure value, and then the exposure level and appropriate exposure need to be determined through manual labeling.
[0055] However, this method requires the annotator to have an understanding of images and optical parameters, and is greatly affected by the differences in personal subjective feelings. Personal subjective feelings are usually not objective and accurate enough, and they often cannot fully reflect the actual exposure of the photo and lack consistency. In addition, the data collection method of this method is complex, the cycle is long, the cost is high, and manual annotation wastes manpower and time, and the workload is large and the efficiency is low.
[0056] Brightness level labeling method: by calculating the brightness of the image, quantitatively or qualitatively labeling the brightness level through histogram analysis, and finding the exposure level with the smallest difference between the current average brightness and the established threshold (such as 128) is the appropriate exposure.
[0057] However, the data labels generated in this way only consider brightness and do not consider other factors that reflect the imaging effect. A single evaluation index is usually difficult to adapt to complex scenes, resulting in poor robustness. In some complex scenes, such as high contrast and uneven light, this method is difficult to accurately evaluate the overall exposure.
[0058] Bracketing exposure capture method based on preset AE: The appropriate exposure image captured by this method is obtained through AE, and a certain number of frames of long-exposure images and short-exposure image sequences are shot with a given exposure compensation.
[0059] However, the appropriately exposed image captured by the preset AE cannot guarantee the acquisition of the best exposure parameters and the validity of the data.
[0060] As described in the background technology, the brightness of an image may be difficult to accurately evaluate the overall exposure of the image. Automatic exposure control based on the exposure of the image with the best brightness may result in a poor exposure effect of the generated image. Based on this, the present application proposes an automatic exposure control method, device, electronic device and storage medium. After performing exposure compensation processing on the input image and obtaining an intermediate image, the exposure evaluation parameters of the intermediate image are determined based on at least two image feature parameters of the intermediate image. The exposure effect of the intermediate image can be evaluated comprehensively, from multiple angles and objectively. Then, based on the exposure evaluation parameters and the input image, an output image with a better exposure effect can be obtained.
[0061] like Figure 1 As shown, the automatic exposure control method includes S101-S103.
[0062] S101. Obtain an intermediate image based on an input image.
[0063] The intermediate image is obtained by performing exposure compensation processing on the input image.
[0064] Specifically, exposure compensation processing may be performed on the input image based on a preset exposure compensation value to obtain the intermediate image.
[0065] S102. Determine an exposure evaluation parameter of an intermediate image based on at least two image feature parameters of a plurality of intermediate images.
[0066] The exposure evaluation parameter of the intermediate image is used to characterize the exposure effect of the intermediate image.
[0067] It should be understood that the above-mentioned image characteristic parameters are indicators for evaluating the exposure effect of the image. The indicators mainly evaluate the exposure level from three aspects, namely, brightness distribution, contrast, and color accuracy. Based on the image characteristic parameters, the exposure effect of the image can be evaluated comprehensively, objectively and accurately.
[0068] In an implementation manner of the embodiment of the present application, the image feature parameters include at least two of the following: black level, brightness average, color accuracy, effective exposure, long exposure value, and contrast.
[0069] It should be understood that black level, average brightness, effective exposure, and long exposure value are indicators for evaluating brightness distribution.
[0070] In one implementation, the intermediate image may be pre-processed by downsampling, color space conversion, etc., and then the value of each image feature parameter of the pre-processed image may be determined.
[0071] Optionally, the intermediate image can be downsampled based on a preset pixel size to obtain a downsampled image, and then the downsampled image can be grayscaled to obtain a grayscale image, and a grayscale histogram of the grayscale image can be calculated. Based on the grayscale histogram, each image feature parameter can be determined.
[0072] It should be understood that the grayscale histogram includes the grayscale value of each pixel in the grayscale image.
[0073] In the embodiment of the present application, the black level is the proportion of pixels whose grayscale value is less than the first grayscale threshold. The brightness mean is the grayscale mean in the grayscale image. The long exposure value is the proportion of grayscale values exceeding the second grayscale threshold. The effective exposure can be a discrete effective exposure or a continuous effective exposure.
[0074] Optionally, the black value satisfies Formula 1:
[0075] E b = ∑ i = 0 i = T H 1 h i s t [ i ] / N Formula 1.
[0076] in, Indicates the black value, represents the first grayscale threshold, h i s t [ i ] Represents the grayscale histogram of the image The gray value of a pixel, Represents the total number of grayscale values in the grayscale histogram.
[0077] Optionally, the brightness mean satisfies Formula 2:
[0078] E g = ∑ i = 0 i = M A X h i s t [ i ] * i / N Formula 2.
[0079] in, represents the mean brightness, Represents the maximum pixel value of a grayscale image.
[0080] Optionally, the color accuracy satisfies Formula 3:
[0081] E s = ∑ h = 0 , w = 0 H − 1 , W − 1 S t d ( r [ h , w ] , g [ h , w ] , b [ h , w ] ) Formula three.
[0082] in, Indicates color accuracy, represents the standard deviation operator, , , are the red, green, and blue channels of the downsampled image, respectively. [ h , w ] Represents the coordinates of the pixel point. Indicates the height of the image. Indicates the width of the image.
[0083] Optionally, the discrete effective exposure satisfies Formula 4:
[0084] E w 1 = ∑ i = T H min i = T H max h i s t [ i ] / N Formula 4.
[0085] in, Represents the discrete effective exposure, Indicates the minimum value of the preset grayscale range. Indicates the maximum value of the preset grayscale range.
[0086] Optionally, the continuous effective exposure satisfies Formula 5:
[0087] E w 2 = ∑ i = 0 i = M A X hist [ i ] * ( g a u s s ( i ) ) N Formula five.
[0088] in, , represents the given parameters, Represents a discrete effective exposure.
[0089] Optionally, the long exposure value satisfies Formula 6:
[0090] E o = ∑ i = T H 2 i = M A X h i s t [ i ] / N Formula six.
[0091] in, Indicates the long exposure value, Represents the second grayscale threshold.
[0092] It should be understood that the second grayscale threshold is greater than the first grayscale threshold.
[0093] Optionally, the contrast satisfies Formula 7:
[0094] E c = ∑ h = 0 , w = 0 H − 1 , W − 1 a b s ( L a p l a c i a n ( g r a y [ h , w ] ) ) Formula seven.
[0095] in, Indicates contrast, represents the Laplace operator.
[0096] In an optional implementation, the intermediate image is downsampled based on a preset pixel size, and the downsampled image is grayscaled to obtain a grayscale image that satisfies Formula 8:
[0097] Formula eight.
[0098] in, represents a grayscale image, represents the intermediate image, represents the pixels of the downsampled image, .
[0099] It should be understood that based on the above-mentioned multiple image feature parameters, various aspects of image exposure can be objectively quantified, making the evaluation more objective, accurate and robust.
[0100] In one implementation of the embodiment of the present application, the exposure evaluation parameters of the intermediate image are determined based on at least two image feature parameters of the intermediate image. Specifically, the exposure evaluation parameters of the intermediate image are determined based on at least two image feature parameters of the intermediate image and a weight coefficient of each image feature parameter.
[0101] Specifically, the parameter evaluation value corresponding to each image feature parameter can be determined based on the product of the value of each image feature parameter and the weight coefficient of each image feature parameter, and then the sum of the parameter evaluation values corresponding to each image feature parameter can be determined as the exposure evaluation parameter.
[0102] It should be understood that by obtaining the exposure evaluation parameter of the image through the weight coefficient of each image feature parameter, the exposure effect of the image can be comprehensively evaluated from multiple aspects. It is also possible to obtain a more accurate evaluation standard by flexibly adjusting the weight coefficient of each image feature parameter.
[0103] S103: Obtain an output image based on the exposure evaluation parameter and the input image.
[0104] In an optional implementation manner, when the exposure evaluation parameter is greater than or equal to an evaluation parameter threshold, an output image may be obtained based on the exposure evaluation parameter and an input image.
[0105] In an optional implementation, the exposure compensation value of the intermediate image may be used as a standard to perform automatic exposure control on the input image to obtain the output image.
[0106] In combination with the description of S101-S103 above, after the input image is subjected to exposure compensation processing to obtain an intermediate image, the exposure evaluation parameters of the intermediate image are determined based on at least two image feature parameters of the intermediate image. The exposure effect of the intermediate image can be evaluated comprehensively, from multiple angles and objectively, and then based on the exposure evaluation parameters and the input image, an output image with a better exposure effect can be obtained.
[0107] In one implementation of the embodiment of the present application, the number of the intermediate images is multiple, combined with Figure 1 ,like Figure 2 As shown, the above-mentioned process of obtaining the output image based on the exposure evaluation parameter and the input image specifically includes S201-S202.
[0108] S201. Based on exposure evaluation parameters, determine an exposure compensation value corresponding to the best intermediate image as an optimal exposure compensation value.
[0109] The best intermediate image is the intermediate image with the highest exposure evaluation parameter.
[0110] It can be understood that when the exposure evaluation parameter of an intermediate image is the highest, it means that the exposure effect of the intermediate image is the best, and therefore, the intermediate image can be determined as the best intermediate image.
[0111] It should be understood that one intermediate image corresponds to a preset exposure compensation value, and after the best intermediate image is determined, the exposure compensation value corresponding to the best intermediate image can be determined as the best exposure compensation value.
[0112] In an optional implementation, a plurality of exposure compensation values may be preset, and then exposure compensation processing is performed on the input image based on the plurality of preset exposure compensation values to obtain the plurality of intermediate images.
[0113] In an optional implementation, an exposure compensation interval may be determined first, and then within the exposure compensation interval, starting from a minimum value of the exposure compensation interval, traversal is performed based on a preset step length to obtain a plurality of preset exposure compensation values.
[0114] It should be understood that the multiple preset exposure compensation values include the minimum value, the maximum value, and the value obtained based on the preset step length of the exposure compensation interval.
[0115] Exemplarily, assuming that the exposure compensation interval is [-2, 2] and the preset step size is 1, the multiple preset exposure compensation values may be -2, -1, 0, 1, and 2.
[0116] It should be noted that the above exposure compensation interval is only an example. In practice, a larger exposure compensation interval can be traversed based on a smaller preset step size to obtain the multiple preset exposure compensation values.
[0117] In an implementation of the embodiment of the present application, the input image may be an HDR image, and after the multiple preset exposure compensation values are determined, the HDR image may be subjected to exposure compensation processing based on each preset exposure compensation value, and then the HDR image may be mapped into a standard dynamic range (SDR) to obtain the multiple intermediate images. The multiple intermediate images may be understood as a dense bracketing exposure image sequence.
[0118] Optionally, the multiple intermediate images satisfy Formula 9:
[0119] Formula nine.
[0120] in, represents the intermediate image corresponding to the i-th first exposure compensation parameter, represents the tone mapping algorithm, represents the input image, Indicates preset exposure compensation parameters.
[0121] It should be understood that the HDR image has a wider displayable dynamic range and a wider brightness range. Exposure compensation is performed on the HDR image, and the exposure of the intermediate image obtained is more realistic and accurate. Furthermore, using tone mapping technology to map the HDR image to the SDR image can retain more details within the limited displayable dynamic range.
[0122] S202: Obtain an output image based on the optimal exposure compensation value and the input image.
[0123] It can be understood that the exposure compensation value of the input image can be adjusted based on the optimal exposure compensation value to obtain the output image.
[0124] It can be understood that by evaluating the intermediate images with different exposure compensation values and determining the exposure compensation value of the intermediate image with the best exposure evaluation parameter as the optimal exposure compensation value, the accuracy of determining the optimal exposure compensation value can be improved, and then based on the optimal exposure compensation value and the input image, an output image with better exposure effect can be obtained.
[0125] Combination Figure 2 ,like Figure 3 As shown, in one implementation of the embodiment of the present application, the output image is obtained based on the optimal exposure compensation value and the input image, which may specifically include S301-S302.
[0126] S301: Adjust the optimal exposure compensation value to determine a target exposure compensation value.
[0127] Specifically, the optimal exposure compensation value may be increased or decreased to obtain a target exposure compensation value.
[0128] In an optional implementation, the optimal exposure compensation value may be increased or decreased based on the exposure type to obtain the target exposure compensation value.
[0129] The exposure types include long exposure, short exposure and normal exposure.
[0130] Specifically, when the exposure type is long exposure, the optimal exposure compensation value can be increased; when the exposure type is short exposure, the optimal exposure compensation value can be decreased; when the exposure type is normal exposure, the optimal exposure compensation value can be increased and decreased to obtain the target exposure compensation value.
[0131] It can be understood that after increasing or decreasing the optimal exposure compensation value based on the exposure type to obtain the target exposure compensation value, the input image is subjected to exposure compensation processing based on the target exposure compensation value to accurately obtain an output image of the exposure type.
[0132] In another optional implementation, the optimal exposure compensation value may be increased or decreased based on the exposure type and the exposure compensation step corresponding to the exposure type to obtain the target exposure compensation value.
[0133] Optionally, multiple increase or decrease processes are performed based on the exposure compensation step length to obtain multiple target exposure compensation values, and multiple output images can be obtained based on the multiple target exposure compensation values.
[0134] Optionally, when the exposure type is long exposure, the optimal exposure compensation value can be increased in sequence based on the exposure compensation step length corresponding to the long exposure; when the exposure type is short exposure, the optimal exposure compensation value can be decreased in sequence based on the exposure compensation step length corresponding to the short exposure; when the exposure type is normal exposure, the optimal exposure compensation value can be increased and decreased in sequence based on the exposure compensation step length corresponding to the normal exposure, so as to obtain the multiple target exposure compensation values.
[0135] In an optional implementation, the number of output images corresponding to each exposure type may be preset, and then based on the exposure compensation step corresponding to each exposure type, a target exposure compensation value for the number of output images corresponding to each exposure type may be generated.
[0136] For example, Figure 4As shown, the bracketing exposure configuration includes a normal exposure configuration, a long exposure configuration, and a short exposure configuration. The normal exposure configuration includes a normal exposure frame number and a normal exposure compensation step length. Based on the optimal exposure compensation value and the normal exposure configuration, a normal exposure compensation value list can be calculated; the long exposure configuration includes a long exposure frame number and a long exposure compensation step length. Based on the optimal exposure compensation value and the long exposure configuration, a long exposure compensation value list can be calculated; the short exposure configuration includes a short exposure frame number and a short exposure compensation step length. Based on the optimal exposure compensation value and the short exposure configuration, a short exposure compensation value list can be calculated; finally, a bracketing exposure compensation value list is output based on the normal exposure compensation value list, the long exposure compensation value list, and the short exposure compensation value list. The bracketing exposure compensation value list is the multiple target exposure compensation values.
[0137] Optionally, the long exposure compensation value list can be expressed as: .
[0138] in, Represents a list of long exposure compensation values, Indicates the optimal exposure compensation value. Indicates the long exposure compensation step length, Indicates the number of output images corresponding to long exposure.
[0139] Optionally, the short exposure compensation value list can be expressed as: .
[0140] in, Represents a list of short exposure compensation values, Indicates the short exposure compensation step length, Indicates the number of output images corresponding to long exposure.
[0141] Optionally, the normal exposure compensation value list can be expressed as: .
[0142] in, Represents a list of normal exposure compensation values, Indicates the normal exposure compensation step length, Indicates the number of output images corresponding to normal exposure.
[0143] In an embodiment of the present application, the optimal exposure compensation value is increased or decreased based on the exposure type and the exposure compensation step corresponding to the exposure type. After the multiple target exposure compensation values are obtained, for output images of the same exposure type, the differences (for example, exposure levels) between the output images can be measured based on the same exposure compensation step, thereby improving the effectiveness of sample generation.
[0144] S302 : performing exposure compensation processing on the input image based on the target exposure compensation value to obtain an output image.
[0145] In an optional implementation, when the input image is an HDR image, after the input image is subjected to exposure compensation processing according to the target exposure compensation value, it can also be converted into an SDR image based on a tone mapping algorithm, and then the SDR image is determined as the output image.
[0146] In an optional implementation, multiple exposure levels and exposure level setting standards can be preset, and then based on the preset multiple exposure level setting standards, the optimal exposure compensation value is adjusted to obtain the multiple target exposure compensation values, and then the output images of multiple exposure levels are obtained.
[0147] In the embodiment of the present application, since the optimal exposure compensation value has been determined, the output images with different exposure levels can be accurately obtained by adjusting the optimal exposure compensation value.
[0148] It can be understood that after performing exposure compensation processing on the input image based on the target exposure compensation value to obtain the output image, a label of the output image can also be generated.
[0149] Optionally, after obtaining the output image and the label of the output image, the output image and the label of the output image may be output simultaneously.
[0150] In another optional implementation, the exposure type of the output image may also be determined based on the target exposure compensation value; and then the label of the output image is generated based on the exposure type of the output image.
[0151] Optionally, an exposure compensation value interval corresponding to each exposure type may be preset, and then the exposure type corresponding to the exposure compensation value interval matching the target exposure compensation value is determined as the exposure type of the output image.
[0152] Optionally, the exposure type of the output image may be determined as a label of the output image.
[0153] Optionally, the identifier corresponding to each exposure type may be determined as a label of the output image.
[0154] Exemplarily, it is assumed that the identifier corresponding to the long exposure type is 1, the identifier corresponding to the short exposure type is -1, and the identifier corresponding to the normal exposure type is 0. When the exposure type of the output image is the long exposure type, it can be determined that the label of the output image is 1.
[0155] In another optional implementation, an exposure difference value may be determined based on the target exposure compensation value of the output image and the optimal exposure compensation value; and a label of the output image may be generated based on a ratio between the exposure difference value and the exposure type step size.
[0156] The exposure type step length is the step length corresponding to the exposure type of the output image.
[0157] It should be understood that the optimal exposure compensation value can be understood as the standard exposure. The exposure type step is used to characterize the exposure difference between different exposure levels of the same exposure type. The ratio between the exposure difference and the exposure type step can characterize the exposure level of the output image relative to the standard exposure. The ratio can be determined as the label of the output image.
[0158] Optionally, the label of the output image satisfies the following formula 10:
[0159] Formula ten.
[0160] in, represents the label of the output image, Indicates the target exposure compensation value, Indicates the optimal exposure compensation value. Indicates the exposure type step size.
[0161] In an optional implementation, the exposure type step includes a step corresponding to a long exposure type, a step corresponding to a short exposure type, and a step corresponding to a normal exposure type. After determining the exposure type of each output image, the exposure type step can be determined based on the exposure type.
[0162] Optionally, the exposure difference is a value obtained by subtracting an optimal exposure compensation value from a target exposure compensation value, and the exposure type may be determined based on the positive or negative sign of the exposure difference.
[0163] In another optional implementation, when the target exposure compensation value is obtained based on the exposure level, the exposure level corresponding to each target exposure compensation value may be used to generate a label of the output image.
[0164] In an embodiment of the present application, after obtaining the output image, a label of the output image is simultaneously generated, and the output image can be accurately identified based on the exposure compensation value of the output image, and then the automatic exposure algorithm can be accurately trained based on the label of the output image.
[0165] In one implementation of the embodiment of the present application, the image directly captured by the camera may not be an HDR image. In the case where the above-mentioned input image is an HDR image, the image directly captured by the camera needs to be processed to obtain the input image.
[0166] Combination Figure 1 ,like Figure 5As shown, before performing multiple exposure compensation processes on the input image to obtain multiple intermediate images, the automatic exposure control method may further include S501-S502.
[0167] S501: Acquire multiple initial images captured in the same scene.
[0168] The multiple initial images include a long exposure image, a normal exposure image and a short exposure image.
[0169] It should be understood that the multiple initial images are low dynamic range images of the same scene captured by a camera with different exposure compensation values.
[0170] It can be understood that the exposure of the long exposure image is long exposure, the exposure of the normal image is moderate exposure, and the exposure of the short exposure image is short exposure.
[0171] It should be understood that, while acquiring the initial image, the exposure compensation value corresponding to each initial image can also be acquired.
[0172] S502: Obtain an input image based on the attention features of each initial image and the fusion features of multiple initial images.
[0173] Among them, the attention feature is obtained by adopting the attention mechanism, and the fusion feature is obtained by aligning multiple initial images.
[0174] It should be understood that the attention feature of an initial image is the feature in the initial image that contributes the most to the initial image.
[0175] Exemplarily, the attention feature is a feature of a region with higher clarity in the initial image.
[0176] Optionally, the attention feature may include detail feature, color feature, etc.
[0177] At the same time, multiple initial images are mapped into gamma-corrected images, and the gamma-corrected images are sent to the feature alignment module for cascade alignment operations to obtain aligned features, which can reduce the error caused by camera motion when taking photos.
[0178] Optionally, the process of mapping the multiple initial images into gamma-corrected images satisfies Formula 11.
[0179] Formula XI.
[0180] in, represents a gamma-corrected image, Indicates the preset gamma correction parameters (such as gamma=2.2), Indicates The initial image, Indicates the corresponding The exposure compensation value corresponding to the initial image.
[0181] Optionally, the attention features of each initial image and the fused features of multiple initial images may be sent to a feature fusion module, and the final input image may be obtained through the fused features.
[0182] For example, Figure 6 Schematic diagram of generating high dynamic range images. Figure 6 As shown, the initial image includes n images and the exposure compensation value of each of the n images. Gamma correction is performed on the initial image to obtain a gamma-corrected image, which is then input into a feature alignment module, and the initial image is input into a spatial attention module; based on the fusion features output by the feature alignment module and the attention features output by the spatial attention module, the high dynamic range image is obtained.
[0183] In an optional implementation, the inverse tone mapping model can extract features through a convolution layer and generate an attention matrix through a spatial attention module to obtain attention features of multiple initial images. An inverse tone mapping model can be constructed based on an inverse tone mapping algorithm, and then the multiple initial images are input into the inverse tone mapping model to obtain the input image.
[0184] It can be understood that based on the method provided in S501-S502 above, a small number of images with poor exposure effects can be converted into HDR images with a wider brightness range and better details, and then exposure compensation processing can be performed on the basis of the HDR, which can reduce the quantity and quality requirements for initial image acquisition and improve the efficiency of data acquisition.
[0185] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to achieve the above functions, the internal short circuit risk identification device of the battery includes a hardware structure and / or software module corresponding to the execution of each function. It should be easy for those skilled in the art to realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0186] The embodiment of the present application can divide the functional modules of the automatic exposure control device according to the above method. For example, the automatic exposure control device can include functional modules corresponding to the functional divisions, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0187] Figure 7 A possible structural diagram of the automatic exposure control device involved in the above embodiment is shown. Figure 7 The automatic exposure control device 70 includes: a processing unit 701 and a determining unit 702.
[0188] The processing unit 701 is used to obtain an intermediate image based on the input image, where the intermediate image is obtained by performing exposure compensation processing on the input image.
[0189] The determination unit 702 is used to determine an exposure evaluation parameter of the intermediate image based on at least two image feature parameters of the intermediate image, where the exposure evaluation parameter of the intermediate image is used to characterize an exposure effect of the intermediate image.
[0190] The processing unit 701 is further configured to obtain an output image based on the exposure evaluation parameter and the input image.
[0191] Optionally, the image characteristic parameters include at least two of the following: black level, brightness average, color accuracy, effective exposure, overexposure value, and contrast.
[0192] Optionally, there are multiple intermediate images.
[0193] The determining unit 702 is specifically configured to determine, based on the exposure evaluation parameter, an exposure compensation value corresponding to the best intermediate image as the best exposure compensation value, where the best intermediate image is the intermediate image with the highest exposure evaluation parameter.
[0194] Optionally, the processing unit 701 is specifically configured to obtain the output image based on the optimal exposure compensation value and the input image.
[0195] The processing unit 701 is further specifically configured to adjust the optimal exposure compensation value to obtain a target exposure compensation value.
[0196] The processing unit 701 is further specifically configured to perform exposure compensation processing on the input image based on the target exposure compensation value to obtain the output image.
[0197] Optionally, the processing unit 701 is further specifically configured to increase or decrease the optimal exposure compensation value based on an exposure type to obtain the target exposure compensation value, where the exposure type includes long exposure, short exposure and normal exposure.
[0198] Optionally, the processing unit 701 is further specifically configured to increase or decrease the optimal exposure compensation value based on the exposure type and the exposure compensation step corresponding to the exposure type to obtain the target exposure compensation value.
[0199] Optionally, the determining unit 702 is further configured to determine an exposure type of the output image based on the target exposure compensation value.
[0200] The processing unit 701 is further configured to generate a label of the output image based on the exposure type of the output image.
[0201] Optionally, the determining unit 702 is further specifically configured to determine an exposure difference value based on the target exposure compensation value of the output image and the optimal exposure compensation value.
[0202] The processing unit 701 is further specifically configured to generate a label of the output image based on a ratio between the exposure difference and the exposure type step length, where the exposure type step length is a step length corresponding to the exposure type of the output image.
[0203] Optionally, the determination unit 702 is further specifically configured to determine the exposure evaluation parameter of the intermediate image based on at least two image feature parameters of the intermediate image and a weight coefficient of each image feature parameter.
[0204] Optionally, the input image is a high dynamic range image.
[0205] Optionally, the automatic exposure control device further includes an acquisition unit 703.
[0206] The acquisition unit 703 is used to acquire a plurality of initial images captured in the same scene, wherein the plurality of initial images include a long exposure image, a normal exposure image, and a short exposure image.
[0207] The processing unit 701 is also used to obtain the input image based on the attention feature of each of the initial images and the fusion feature of the multiple initial images, wherein the attention feature is obtained by using the attention mechanism, and the fusion feature is obtained by aligning the multiple initial images.
[0208] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0209] Figure 8 FIG. 1 is a block diagram of the electronic device involved in the above-mentioned embodiment. Figure 8 As shown, the electronic device 80 includes but is not limited to: a processor 801 and a memory 802 .
[0210] The memory 802 is used to store executable instructions of the processor 801. It can be understood that the processor 801 is configured to execute instructions to implement the group fault detection method in the above embodiment.
[0211] It should be noted that those skilled in the art can understand that Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include Figure 8 More or fewer components may be shown, or certain components may be combined, or the components may be arranged differently.
[0212] The processor 801 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire device. By running or executing software programs and / or modules stored in the memory 802, and calling data stored in the memory 802, it performs various functions of the electronic device and processes data, thereby monitoring the device as a whole. The processor 801 may include one or more processing units. Optionally, the processor 801 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 801.
[0213] The memory 802 may be used to store software programs and various data. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one functional module (such as a determination unit, a processing unit, etc.), etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0214] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 802 including instructions, and the above instructions can be executed by the processor 801 of the electronic device 80 to implement the method in the above embodiment.
[0215] In actual implementation, Figure 7 The processing unit 701, the determining unit 702 and the obtaining unit 703 functions can all be implemented by Figure 8 The processor 801 in the embodiment calls the computer program stored in the memory 802. The specific execution process can refer to the description of the method part in the above embodiment, which will not be repeated here.
[0216] Optionally, the embodiment of the present application further provides a vehicle, which may include the above Figure 7 Automatic exposure control in Figure 8 Electronic devices in.
[0217] Optionally, the computer-readable storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0218] In an exemplary embodiment, the present application also provides a computer program product including one or more instructions, and the one or more instructions can be executed by the processor 801 of the electronic device to complete the method in the above embodiment.
[0219] It should be noted that when the instructions in the above-mentioned computer-readable storage medium or one or more instructions in the computer program product are executed by the processor of the device, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect as the above-mentioned method can be achieved. To avoid repetition, they will not be repeated here.
[0220] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0221] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0222] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0223] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0224] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the full classification part or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute the full classification part or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or CD and other media that can store program code.
[0225] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. An automatic exposure control method, characterized in that: The method comprises: obtaining an intermediate image based on an input image, wherein the intermediate image is obtained by performing exposure compensation processing on the input image; and the number of the intermediate images is multiple; determining an exposure evaluation parameter of the intermediate image based on at least two image feature parameters of the intermediate image, wherein the exposure evaluation parameter of the intermediate image is used to characterize an exposure effect of the intermediate image; Based on the exposure evaluation parameter, determining the exposure compensation value corresponding to the best intermediate image as the best exposure compensation value, wherein the best intermediate image is the intermediate image with the highest exposure evaluation parameter; Based on the exposure type and the exposure compensation step length corresponding to the exposure type, the optimal exposure compensation value is increased or decreased multiple times to obtain multiple target exposure compensation values; the exposure type includes long exposure, short exposure and normal exposure; Exposure compensation processing is performed on the input image based on the multiple target exposure compensation values to obtain multiple output images and image labels of the multiple output images; the image labels of the multiple output images are used to train an automatic exposure algorithm.
2. The method according to claim 1, characterized in that The image characteristic parameters include at least two of the following: black level, brightness average, color accuracy, effective exposure, overexposure value and contrast.
3. The method according to claim 1, characterized in that The method further comprises: determining an exposure type of the output image based on the target exposure compensation value; A label for the output image is generated based on the exposure type of the output image.
4. The method according to claim 3, characterized in that The step of generating a label of the output image based on the exposure type of the output image comprises: determining an exposure difference value based on the target exposure compensation value and the optimal exposure compensation value; A label of the output image is generated based on a ratio between the exposure difference and an exposure type step length, where the exposure type step length is a step length corresponding to the exposure type of the output image.
5. The method according to any one of claims 1 to 4, characterized in that The step of determining the exposure evaluation parameter of the intermediate image based on at least two image feature parameters of the intermediate image comprises: An exposure evaluation parameter of the intermediate image is determined based on at least two image feature parameters of the intermediate image and a weight coefficient of each image feature parameter.
6. The method according to any one of claims 1 to 4, characterized in that The input image is a high dynamic range image.
7. The method according to claim 6, characterized in that The method further comprises: Acquire multiple initial images captured in the same scene, wherein the multiple initial images include a long exposure image, a normal exposure image, and a short exposure image; The input image is obtained based on the attention feature of each of the initial images and the fusion feature of the multiple initial images, wherein the attention feature is obtained by adopting the attention mechanism, and the fusion feature is obtained by aligning the multiple initial images.
8. An automatic exposure control device, characterized in that: It includes processing unit and determination unit: The processing unit is used to obtain an intermediate image based on the input image, wherein the intermediate image is obtained by performing exposure compensation processing on the input image; the number of the intermediate images is multiple; The determining unit is used to determine an exposure evaluation parameter of the intermediate image based on at least two image feature parameters of the intermediate image, wherein the exposure evaluation parameter of the intermediate image is used to characterize an exposure effect of the intermediate image; The processing unit is specifically used for: Based on the exposure evaluation parameter, determining the exposure compensation value corresponding to the best intermediate image as the best exposure compensation value, wherein the best intermediate image is the intermediate image with the highest exposure evaluation parameter; Based on the exposure type and the exposure compensation step length corresponding to the exposure type, the optimal exposure compensation value is increased or decreased multiple times to obtain multiple target exposure compensation values; the exposure type includes long exposure, short exposure and normal exposure; Exposure compensation processing is performed on the input image based on the multiple target exposure compensation values to obtain multiple output images and image labels of the multiple output images; the image labels of the multiple output images are used to train an automatic exposure algorithm.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 7.
10. A vehicle, characterized in that: Includes the automatic exposure control device as claimed in claim 8 or the electronic device as claimed in claim 9.
11. A computer-readable storage medium, characterized in that: When the computer-executable instructions stored in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is capable of performing the method as claimed in any one of claims 1 to 7.
12. A computer program product, comprising computer instructions, characterized in that: When the computer instructions are executed on a processor of an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Digital X-ray machine automatic exposure control method and device
CN104146724A
Exposure control method, apparatus and electronic device
CN109040609A
Method and device for determining exposure parameters
CN116801108A