Method and device for adjusting exposure parameters
By acquiring and analyzing image brightness information and exposure parameters, calculating and weighting the exposure intensity, the problem of uneven image brightness changes in the prior art is solved, and a more comfortable visual experience is achieved.
Patent Information
- Application Number
- CN202411676673.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-01-07
AI Technical Summary
The existing exposure parameter adjustment method causes the image brightness change to be not smooth enough, giving people a sense of discomfort.
By obtaining the brightness information of the current frame image and the exposure parameters of the previous N frame image, the exposure intensity compensation value of the scene category is determined, the second exposure intensity is calculated, and the weighted sum is performed to obtain the target exposure intensity, and the exposure of the next frame image is adjusted. parameters to achieve smooth brightness changes.
Improves the smoothness of image brightness changes and improves viewing comfort.
Smart Images

Figure CN119277211A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of camera parameter adjustment, and in particular to a method and device for adjusting exposure parameters. Background Art
[0002] With the continuous advancement of science and technology and the continuous development of society, autonomous driving technology and safety assistance systems are becoming more mature, and more and more safety driving assistance system equipment are being applied to automobiles. On-board cameras are currently one of the most commonly used sensors, which are used to acquire and analyze images to achieve the purpose of perceiving the surrounding environment and safe assisted driving.
[0003] The exposure intensity and brightness of an image are important indicators of image quality, and the exposure parameters of the camera play a decisive role in the exposure intensity and brightness of the image. The existing exposure parameters are usually adjusted by adjusting the step. However, by adjusting the step to obtain the latest exposure intensity and then adjusting the exposure parameters, the image brightness changes rapidly, which is not smooth and gives people a sense of discomfort. Summary of the invention
[0004] The embodiments of the present application provide a method and device for adjusting exposure parameters, which improve the smoothness of exposure parameter adjustment.
[0005] According to a first aspect of the present application, an embodiment of the present application provides a method for adjusting exposure parameters, the method comprising:
[0006] Obtaining brightness information and exposure parameters of a current frame image and first exposure intensities corresponding to N frames of images before the current frame image, where N is a positive integer;
[0007] Determining, according to the brightness information, an exposure intensity compensation value corresponding to the scene category of the current frame image;
[0008] Determining a second exposure intensity of the current frame image according to the exposure intensity compensation value and the exposure parameter;
[0009] Performing a weighted summation on the second exposure intensity and each of the first exposure intensities to obtain a target exposure intensity;
[0010] According to the target exposure intensity, the exposure parameters of the next frame of image are adjusted.
[0011] Optionally, performing weighted summation on the second exposure intensity and each first exposure intensity to obtain a target exposure intensity includes:
[0012] Obtain the exposure intensity weight of the current frame image and each of the previous N frames of images;
[0013] According to the weights of each exposure intensity, the second exposure intensity and each first exposure intensity are weighted and summed to obtain the target exposure intensity.
[0014] Optionally, the brightness information includes: an average brightness value of the current frame image, and the exposure parameters include: exposure time, analog gain, digital gain and iris aperture;
[0015] Determining a second exposure intensity of the current frame image according to brightness information and exposure parameters of the current frame image includes:
[0016] determining a third exposure intensity according to the product of the exposure time, the analog gain, the digital gain, and the iris aperture;
[0017] Determining a first adjustment step according to a ratio of the average brightness value to the target brightness value;
[0018] The product of the first adjustment step and the third exposure intensity is calculated to obtain the second exposure intensity.
[0019] Optionally, determining the first adjustment step according to the ratio of the average brightness value to the target brightness value includes:
[0020] Determine a ratio of the average brightness value to the target brightness value as a second adjustment step;
[0021] Determining a target interval corresponding to the second adjustment step according to the second adjustment step;
[0022] A target adjustment step value corresponding to the target interval is determined from the corresponding relationship between the preset adjustment step interval and the adjustment step, and the target adjustment step value is the first adjustment step.
[0023] Optionally, the brightness information also includes: an average brightness value of a green channel of the current frame image;
[0024] Before determining that the ratio of the average brightness value to the target brightness value is a second adjustment step, the method further includes:
[0025] Determine the target illumination value corresponding to the green channel average brightness value and the third exposure intensity according to the corresponding relationship between the preset green channel average brightness value and the preset third exposure intensity and the preset illumination value;
[0026] According to the magnitude relationship between the illuminance value and the illuminance threshold, the current brightness scene corresponding to the target illuminance value is determined;
[0027] According to the correspondence between the preset brightness scene and the preset brightness value, the preset brightness value corresponding to the current brightness scene is determined as the target brightness value.
[0028] Optionally, after determining that the ratio of the average brightness value to the target brightness value is a second adjustment step, the method further includes:
[0029] determining an adjustment method of the exposure parameter according to a magnitude relationship between the second adjustment step and an adjustment step threshold;
[0030] The step of adjusting the exposure parameters of the next frame of image according to the target exposure intensity includes:
[0031] According to the target exposure intensity, the exposure parameters of the next frame of image are adjusted according to the adjustment method.
[0032] Optionally, determining, according to the brightness information, an exposure intensity compensation value corresponding to the scene category of the current frame image includes:
[0033] Inputting the brightness information into a scene recognition model to determine the scene category corresponding to the current frame image;
[0034] From the relationship between the preset scene category and the preset exposure intensity compensation value, an exposure intensity compensation value corresponding to the scene category is determined.
[0035] Optionally, before inputting the brightness information into a scene recognition model to determine the scene category corresponding to the current frame image, the method further includes:
[0036] Inputting the brightness information into a deep learning network model to obtain multiple scenes;
[0037] Inputting pre-acquired images corresponding to a plurality of scenes into the deep learning network model for training to obtain a real value corresponding to each scene;
[0038] When the accuracy of the real value reaches a preset accuracy, the scene recognition model is obtained.
[0039] Optionally, determining the second exposure intensity of the current frame image according to the exposure intensity compensation value and the exposure parameter includes:
[0040] Determine that the sum of the exposure intensity compensation value, the product of the first adjustment step and the third exposure intensity is the second exposure intensity.
[0041] According to a second aspect of the present application, an embodiment of the present application provides an exposure parameter adjustment device, which includes:
[0042] A first acquisition module is used to acquire brightness information and exposure parameters of a current frame image and first exposure intensities corresponding to N frames of images before the current frame image, where N is a positive integer;
[0043] A first determination module, used to determine an exposure intensity compensation value corresponding to the scene category of the current frame image according to the brightness information;
[0044] A second determination module, used to determine a second exposure intensity of the current frame image according to the exposure intensity compensation value and the exposure parameter;
[0045] a weighted summation module, configured to perform a weighted summation on the second exposure intensity and each of the first exposure intensities to obtain a target exposure intensity;
[0046] The adjustment module is used to adjust the exposure parameters of the next frame of image according to the target exposure intensity.
[0047] According to a third aspect of the present application, an embodiment of the present application provides an exposure parameter adjustment device, the device comprising: a processor and a memory storing computer program instructions;
[0048] When the processor executes the computer program instructions, it implements the method for adjusting the exposure parameters of any one of the first aspects.
[0049] According to the fourth aspect of the present application, an embodiment of the present application provides a computer storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method for adjusting the exposure parameters of any one of the first aspects is implemented.
[0050] According to the fifth aspect of the present application, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the exposure parameter adjustment method of any one of the first aspects.
[0051] The exposure parameter adjustment method and device of the embodiment of the present application can obtain the brightness information of the current frame image, the exposure parameters when shooting the current frame image, and the first exposure intensity of the N frames before the current frame image, and then determine the exposure intensity compensation value corresponding to the scene category of the current frame image according to the brightness information. Then determine the second exposure intensity when shooting the current frame image according to the exposure intensity compensation value and the exposure parameter, so that after determining the second exposure intensity of the current frame image and the first exposure intensity of the N frames before the current frame image, weighted summation is performed to obtain the target exposure intensity required when the next frame image needs to be smooth, so as to adjust the exposure parameters when shooting the next frame image according to the target exposure intensity, based on this, after determining the smooth target exposure intensity according to the first exposure intensity of the N frames before the current frame image and the second exposure intensity of the current frame image, the exposure parameters are adjusted according to the target exposure intensity, so as to obtain the exposure parameters that can shoot the target exposure intensity, and then shoot the next frame image according to the adjusted exposure parameters, so that the exposure intensity of the next frame image can be the target exposure intensity, so that the brightness changes of the N frames before the current frame image and the next frame image are smooth, which improves the viewing comfort. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0053] Figure 1 is a flow chart of a method for adjusting exposure parameters according to an exemplary embodiment;
[0054] Figure 2 is a structural block diagram of a device for adjusting exposure parameters according to an exemplary embodiment;
[0055] Figure 3 is a structural block diagram of a device for adjusting exposure parameters according to an exemplary embodiment. DETAILED DESCRIPTION
[0056] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0057] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-otherwise inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0058] As described in the background technology section, in the prior art, exposure parameters are usually adjusted by adjusting the stepping method. However, by adjusting the stepping method to obtain the latest exposure intensity and then adjusting the exposure parameters, the image brightness changes rapidly, which is not smooth and gives people a sense of discomfort.
[0059] Based on this, in the exposure parameter adjustment method provided in the embodiment of the present application, by shooting the next frame image according to the adjusted exposure parameters, the exposure intensity of the next frame image can be made to be the target exposure intensity, so that the brightness changes of the previous N frames of images, the current frame image and the next frame image are smooth, thereby improving viewing comfort.
[0060] The present application provides a method and device for adjusting exposure parameters. The following first introduces the method for adjusting exposure parameters provided in the embodiment of the present application.
[0061] Figure 1 FIG. 1 is a flow chart showing a method for adjusting exposure parameters provided by an embodiment of the present application. Figure 1 As shown, the method may include the following steps:
[0062] S101, obtaining brightness information of a current frame image, exposure parameters, and first exposure intensities corresponding to N frames of images before the current frame image, where N is a positive integer;
[0063] S102, determining an exposure intensity compensation value corresponding to the scene category of the current frame image according to the brightness information;
[0064] S103, determining a second exposure intensity of the current frame image according to the exposure intensity compensation value and the exposure parameter;
[0065] S104, performing weighted summation on the second exposure intensity and each first exposure intensity to obtain a target exposure intensity;
[0066] S105: adjusting the exposure parameters of the next frame of image according to the target exposure intensity.
[0067] Based on the above embodiment, by acquiring the brightness information of the current frame image, the exposure parameters when shooting the current frame image, and the first exposure intensity of the N frames before the current frame image, the exposure intensity compensation value corresponding to the scene category of the current frame image can be determined according to the brightness information. Then, the second exposure intensity when shooting the current frame image is determined according to the exposure intensity compensation value and the exposure parameter. Thus, after determining the second exposure intensity of the current frame image and the first exposure intensity of the N frames before the current frame image, a weighted sum is performed to obtain the target exposure intensity required when the next frame image needs to be smooth, so as to adjust the exposure parameters when shooting the next frame image according to the target exposure intensity. Based on this, after determining the smooth target exposure intensity according to the first exposure intensity of the N frames before the current frame image and the second exposure intensity of the current frame image, the exposure parameters are adjusted according to the target exposure intensity to obtain the exposure parameters that can shoot the target exposure intensity, and then the next frame image is shot according to the adjusted exposure parameters, so that the exposure intensity of the next frame image can be the target exposure intensity, so that the brightness changes of the N frames before the current frame image, the current frame image and the next frame image are smooth, which improves the viewing comfort.
[0068] In the above S101, when the camera or camera is shooting a video, an image appears in each frame of the video. Since the camera can automatically adjust the exposure parameters, the brightness information and exposure parameters of each frame of the image are also different.
[0069] After determining the current frame image, use an appropriate image processing library or framework, such as OpenCV (Open Source Computer Vision Library), PIL (Python Imaging Library), etc. to process the image. Specifically, use the function in the image processing library to extract the brightness information of the current frame image.
[0070] By accessing the camera, you can directly obtain the exposure parameters of the camera when shooting the current frame image.
[0071] After determining the current frame image, you can trace back to determine the previous N frames of images, and you can also determine the first exposure intensity of each of the previous N frames of images when the camera or camera took the previous N frames of images by analyzing the previous N frames of images.
[0072] In the above S102, the exposure intensity compensation value corresponding to the scene category of the current frame image is determined according to the brightness information;
[0073] The brightness information can be input into a preset scene recognition model, and the scene category of the current frame image can be determined by the scene recognition module, and the exposure intensity value can be determined by the scene category.
[0074] In the above S103, the adjustment step of the current frame image is determined according to the exposure intensity compensation value and the exposure parameter, thereby determining the second exposure intensity of the current frame image.
[0075] Specifically, the brightness information may include: an average brightness value of the current frame image; the exposure parameters may include: exposure time, analog gain, digital gain and iris aperture.
[0076] S103 may include:
[0077] S1031, determining a third exposure intensity according to the product of the exposure time, the analog gain, the digital gain, and the iris aperture;
[0078] S1032, determining a first adjustment step according to a ratio of the average brightness value to the target brightness value;
[0079] S1033, calculating the product of the first adjustment step and the third exposure intensity to obtain a second exposure intensity.
[0080] In the above S1031, the product of the exposure time, the analog gain, the digital gain and the iris aperture is calculated, and the obtained product is determined to be the third exposure intensity.
[0081] Optionally, the calculation is performed by the following formula:
[0082] E=F -2 ·T·Again·Dgain
[0083] Where, T is the exposure time, Again is the analog gain, Dgain is the digital gain,
[0084] F -2 is the iris aperture, and E is the third exposure intensity.
[0085] In the above S1032, the average brightness value is compared with the target brightness to obtain a ratio between the two, thereby determining the amplitude by which the average brightness value of the current frame image and the required target brightness value need to be adjusted, and the amplitude is the first adjustment step.
[0086] More specifically, S1032 may also include:
[0087] Determine a ratio of the average brightness value to the target brightness value as a second adjustment step;
[0088] The first adjustment step is determined according to the second adjustment step.
[0089] The second adjustment step can be calculated and determined by the following formula.
[0090]
[0091] Wherein, adj_rate is the second adjustment step, Y is the average brightness value, and Y_target is the target brightness value; the target brightness value is related to the brightness scene.
[0092] More specifically, the brightness information also includes: the average brightness value of the green channel of the current frame image; the target brightness value can be confirmed by:
[0093] Determine the target illumination value corresponding to the green channel average brightness value and the third exposure intensity according to the corresponding relationship between the preset green channel average brightness value and the preset third exposure intensity and the preset illumination value;
[0094] According to the magnitude relationship between the illuminance value and the illuminance threshold, the current brightness scene corresponding to the target illuminance value is determined;
[0095] According to the correspondence between the preset brightness scene and the preset brightness value, the preset brightness value corresponding to the current brightness scene is determined as the target brightness value.
[0096] Since human eyes are more sensitive to green, it is necessary to obtain the average brightness value of the green channel of the current frame image from the brightness information. There is a linear relationship between the preset green channel average brightness value and the preset third exposure intensity and the preset illuminance value. Therefore, the target illuminance value corresponding to the green channel average brightness value and the third exposure intensity of the current frame image can be determined based on this linear relationship.
[0097] According to the size of the illumination value, the current frame image can be divided into high-brightness scenes, medium-brightness scenes and low-brightness scenes, and the target brightness value required for each brightness scene is different. The target illumination value is compared with the illumination threshold of the brightness scene division to determine the brightness scene to which the current frame image belongs. According to the experimental data and research of the technicians, each preset brightness scene can be set with a corresponding preset brightness value, that is, the correspondence between the preset brightness scene and the preset brightness value; thus, the brightness value corresponding to the current brightness scene can be confirmed from the correspondence, and thus, the brightness value is the above-mentioned target brightness value.
[0098] Based on this, by dividing the current frame image from the brightness scene, an accurate target brightness value suitable for the current frame image is determined, so that the second adjustment step is more suitable for the current frame image, and the image brightness changes more smoothly.
[0099] After determining the second adjustment step, in order to adjust the current frame image quickly and smoothly, the second adjustment step needs to be further adjusted. Therefore, the first adjustment step actually required for adjusting the current frame image needs to be determined according to the size of the second adjustment step.
[0100] Preferably, determining the first adjustment step according to the second adjustment step may include:
[0101] Determining a target interval corresponding to the second adjustment step according to the second adjustment step;
[0102] A target adjustment step value corresponding to the target interval is determined from the corresponding relationship between the preset adjustment step interval and the adjustment step, and the target adjustment step value is the first adjustment step.
[0103] Specifically, after the second adjustment step is determined, the second adjustment step may be divided according to the size of the second adjustment step, thereby determining the target interval to which the second adjustment step belongs.
[0104] According to the experimental results and research experience of the staff, the relationship between each preset step adjustment interval and the adjustment step can be obtained; thus, the adjustment step corresponding to the target interval can be determined in the relationship between the preset step adjustment interval and the adjustment step, and this adjustment step is the first adjustment step.
[0105] As an example, the relationship between each preset step adjustment interval and the adjustment step may be as follows:
[0106]
[0107] In the above S1033, the third exposure intensity of the current frame image and the calculated adjustment step are multiplied to obtain the second exposure intensity.
[0108] In one embodiment, the above S102 may further include:
[0109] Input the brightness information into the scene recognition model to determine the scene category corresponding to the current frame image;
[0110] Determining an exposure intensity compensation value corresponding to a scene category from a relationship between a preset scene category and a preset exposure intensity compensation value;
[0111] The exposure intensity compensation value is determined, and the sum of the product of the first adjustment step and the third exposure intensity is the second exposure intensity.
[0112] In some special cases, the brightness adjustment of the image is not ideal, especially in backlit scenes and when entering a tunnel. At this time, an exposure intensity compensation value is required to compensate the original exposure intensity, so as to achieve a better image brightness adjustment effect.
[0113] Therefore, before inputting the brightness information into the scene recognition model to determine the scene category corresponding to the current frame image, the method further includes:
[0114] Inputting the brightness information into a deep learning network model to obtain multiple scenes;
[0115] Inputting pre-acquired images corresponding to a plurality of scenes into the deep learning network model for training to obtain a real value corresponding to each scene;
[0116] When the accuracy of the real value reaches a preset accuracy, the scene recognition model is obtained.
[0117] As an example, the scene categories may include: front-lit scene, back-lit scene, tunnel-entering scene, and tunnel-leaving scene, etc.
[0118] As an example, the brightness information of each image is used as the input of the deep learning network model. According to the brightness size and distribution range of different input information and the brightness difference of adjacent areas, it is divided into four different scenes, namely, front-lit scene, back-lit scene, tunnel entry scene and tunnel exit scene. They are marked according to label 1, label 2, label 3 and label 4, and then a large number of collected images of different scenes are input into the deep learning network model for training. The output data is converted into real value of probability distribution using normalization function. When the accuracy reaches more than 99%, the training is completed, thereby obtaining a trained scene recognition model.
[0119] According to a large number of experiments by technicians, a corresponding exposure intensity compensation value can be set for each scene category based on experimental data or personal experience. Thus, the exposure intensity compensation value of the current frame image can be determined according to the scene category corresponding to the current frame image.
[0120] Therefore, after calculating the original second exposure intensity (the product of the first adjustment step and the third exposure intensity), adding the exposure intensity compensation value of the current frame image, a second exposure intensity analyzed in combination with the scene category corresponding to the current frame image can be obtained.
[0121] Based on this, by determining the scene category of the current frame image according to the brightness value, and then determining the required exposure intensity compensation value of the current frame image based on the scene category, the original second exposure intensity is calculated based on the product of the first adjustment step and the third exposure intensity, and then the original second exposure intensity is compensated according to the exposure intensity compensation value; the second exposure intensity thus obtained is more suitable for different scene categories, so that the brightness of the current frame image can be smoothed under different scene categories.
[0122] In the above S104, the first exposure intensity of each frame image in the previous N frames of images and the second exposure intensity of the current frame image are weightedly summed to obtain the target exposure intensity.
[0123] Specifically, S104 may include:
[0124] S1041, obtaining the exposure intensity weight of each frame image in the current frame image and the previous N frames image;
[0125] S1042: Perform weighted summation on the second exposure intensity and each first exposure intensity according to each exposure intensity weight to obtain a target exposure intensity.
[0126] In the above S1041, according to the experience of the staff, each frame image in the first N frames of images and the current frame image can be set with a one-to-one corresponding exposure intensity weight.
[0127] In one example, N is 4, the exposure intensity weight of the current frame image can be w=0.5, and the exposure intensity weight of each of the first 4 frames is assigned according to the distance from the current frame. The exposure intensity weight of the first frame image is 0.4w, the exposure intensity weight of the first 2 frames image is 0.3w, the exposure intensity weight of the first 3 frames image is 0.2w, and the exposure intensity weight of the first 4 frames image is 0.1w.
[0128] In the above S1042, the product of the exposure intensity of each frame image (the current frame image and the previous N frame images) and the exposure intensity weight is determined as the weighted exposure intensity of the frame image, and then the sum of the weighted exposure intensities of each frame image is determined as the target exposure intensity.
[0129] As an example, assume that the second exposure intensity of the current frame image is E1, the first exposure image of the previous frame image is E2, the first exposure image of the previous 2 frames image is E3, the first exposure image of the previous 3 frames image is E4, the first exposure image of the previous 5 frames image is E5, and the target exposure intensity is Ee.
[0130] Ee=0.5E1+0.4×0.5E2+0.3×0.5E3+0.2×0.5E4+0.1×0.5E5
[0131] By setting exposure intensity weights for the current frame image and each of the previous N frames, and then taking the weighted sum of the second exposure intensity of the previous frame image and the first exposure intensity of the previous N frames, it can be ensured that the exposure intensity of each frame image has a reasonable proportion to the exposure intensity of the next frame image, thereby making the connection between the target exposure intensity of the next frame image and the exposure intensity between the current frame image and the previous N frames smoother.
[0132] In the above S105, after the target exposure intensity is determined, the target exposure intensity required for the next frame image has now been determined. Therefore, based on the third exposure intensity formula calculated in the above S1021, when E is known, the exposure parameters (exposure time, analog gain, digital gain and iris aperture) corresponding to the current frame image can be adjusted, so that the exposure intensity of the next frame image is the target exposure intensity by adjusting the exposure parameters of the current frame image.
[0133] In order to adjust the exposure parameters more accurately, the present application also provides another implementation of the exposure parameter adjustment method.
[0134] After determining that the ratio of the average brightness value to the target brightness value is the second adjustment step, the method may further include the following steps:
[0135] S201, determining an adjustment method of the exposure parameter according to a magnitude relationship between the second adjustment step and the adjustment step threshold;
[0136] According to the target exposure intensity, the exposure parameters of the next frame image are adjusted, which may include:
[0137] S202: Adjust the exposure parameters of the next frame of image according to the target exposure intensity and the adjustment method.
[0138] Based on the above embodiment, the adjustment method for adjusting the exposure parameters is determined by the size relationship between the second adjustment step and the adjustment step threshold. Therefore, when adjusting the exposure parameters of the next frame image according to the target exposure intensity, the exposure parameters can be adjusted according to the adjustment method, thereby ensuring the accuracy and stability in the process of adjusting the exposure parameters, and improving the stability of the exposure parameters during adjustment.
[0139] In the above S201, the exposure parameters are adjusted according to a certain logic and calculation method T according to the second adjustment step size, thereby obtaining new exposure parameters (exposure time, analog gain and digital gain).
[0140] Specifically, the adjustment mode can be confirmed in the following ways, wherein the adjustment mode may include an adjustment method and an adjustment sequence:
[0141] The adjustment methods are divided into two categories, namely, the second adjustment step is greater than 1 and the second adjustment step is less than the adjustment step threshold (assuming the adjustment step threshold is 1); when the second adjustment step is greater than 1, when the actual brightness of the frame is less than the target brightness, the brightness value of the image needs to be increased. At this time, the exposure time, analog gain and digital gain need to be increased, and the order of increase is exposure time → analog gain → digital gain. The purpose is to reduce the generation of image noise as much as possible. When the second adjustment step is less than 1, when the actual brightness of the frame is greater than the target brightness, the brightness value of the image needs to be reduced. At this time, the exposure time, analog gain and digital gain need to be reduced. The order of reduction is digital gain → analog gain → exposure time. The purpose is also to reduce the generation of image noise.
[0142] When the second adjustment step is greater than 1, the adjustment order is exposure time, analog gain, and digital gain. First, enter the exposure time adjustment, calculate the exposure time according to the first adjustment step value, when the calculated value is less than the maximum value of the exposure time, set the calculated value to the current exposure time, and the gain does not need to be adjusted. When the calculated value is greater than the maximum value of the exposure time, set the maximum exposure time to the current exposure value. At this time, enter the gain adjustment. It is also necessary to determine whether the calculated value reaches the maximum value of the analog gain. If not, set the calculated value to the current analog gain, and the digital gain does not need to be adjusted. If it reaches or even exceeds it, set the maximum analog gain to the current analog gain, and then adjust the digital gain. Similarly, if the calculated value is less than the maximum value of the digital gain, set the calculated value to the current digital gain. If the calculated value exceeds the maximum value of the digital gain, then set the maximum value of the digital gain to the current digital gain.
[0143] When the second adjustment step is less than 1, the adjustment order is digital gain, analog gain and exposure time. First enter the digital gain adjustment to determine whether the calculated value is less than the minimum value of the digital gain. If it is reached, the analog gain needs to be adjusted. Continue to determine whether the calculated value of the analog gain is less than the minimum value. If it is, adjust the exposure time. After adjustment, the final exposure parameters are obtained.
[0144] In the above S202, after the adjustment sequence and adjustment method are determined, the exposure parameters when shooting the current frame image are adjusted according to the adjustment sequence and adjustment method, so that when shooting the next frame image, it can be shot according to the adjusted exposure parameters.
[0145] In order to more accurately obtain the brightness information of the current frame image, the present application also provides another implementation of the exposure parameter adjustment method.
[0146] Before the above S101, the method may further include the following steps:
[0147] S301, dividing the current frame image into a plurality of grids;
[0148] S302, obtaining the grid brightness value of each grid in the current frame image, and the grid weight corresponding to each grid;
[0149] S303, performing weighted average calculation on the brightness value of each grid and the grid weight to determine the average brightness value of the current frame image.
[0150] Based on the above embodiment, by dividing the current frame image into grids, the grid brightness values and grid weights of each grid are weighted to determine the average brightness value of the current frame image. Thus, by dividing the image into multiple grids, the brightness calculation can be performed only on each grid, rather than processing each pixel in the entire image. This can greatly reduce the amount of calculation and improve the processing speed; at the same time, by dividing the image into multiple parts (i.e., grids), the brightness calculation error caused by specific areas in the image (such as noise or outliers) can be reduced. Because the weight of each grid can be adjusted according to its importance or reliability, this method can enhance the robustness of the algorithm.
[0151] In the above S301, the entire area or a part of the area of the current frame image is sampled and divided, specifically, it can be divided into m×n grids.
[0152] In the above S302, each grid corresponds to a grid weight, and a larger grid weight indicates a greater influence of the grid on the brightness value of the current frame image.
[0153] Similarly, after the current frame image is divided into grids, the grid brightness value of each grid in the current frame image can be determined by analyzing the preset algorithm.
[0154] In the above S303, after the grid weights of each grid and the grid brightness values of each grid are known, the average brightness value of the current frame image is calculated through a weighted average algorithm.
[0155] It should be noted that the application scenarios described in the above-mentioned embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0156] Based on the same inventive concept, the present application also provides an exposure parameter adjustment device. Figure 2 Provide detailed explanation.
[0157] Figure 2A schematic diagram of the hardware structure of an exposure parameter adjustment device 200 provided in an embodiment of the present invention is shown.
[0158] like Figure 2 As shown, the exposure parameter adjustment device 200 may include:
[0159] The first acquisition module 210 is used to acquire brightness information and exposure parameters of a current frame image and first exposure intensities corresponding to N frames of images before the current frame image, where N is a positive integer;
[0160] A first determination module 220, configured to determine an exposure intensity compensation value corresponding to a scene category of a current frame image according to the brightness information;
[0161] A second determination module 230, configured to determine a second exposure intensity of the current frame image according to the exposure intensity compensation value and the exposure parameter;
[0162] A weighted summing module 240, configured to perform a weighted summation on the second exposure intensity and each of the first exposure intensities to obtain a target exposure intensity;
[0163] The adjustment module 250 is used to adjust the exposure parameters of the next frame of image according to the target exposure intensity.
[0164] In the exposure parameter adjustment device 400 provided in this embodiment, the brightness information of the current frame image is obtained by the first acquisition module 210. After the exposure parameters when shooting the current frame image and the first exposure intensity of the N frames before the current frame image are obtained, the first determination module 220 can determine the second exposure intensity when shooting the current frame image according to the brightness information and exposure parameters of the current frame image. Therefore, after the weighted summation module 230 determines the second exposure intensity of the current frame image and the first exposure intensity of the N frames before the current frame image, it performs weighted summation to obtain the target exposure intensity required when the next frame image needs to be smooth. The adjustment module 240 adjusts the exposure parameters when shooting the next frame of image according to the target exposure intensity. Based on this, after determining a smooth target exposure intensity according to the first exposure intensity of the previous N frames of image and the second exposure intensity of the current frame of image, the exposure parameters are adjusted according to the target exposure intensity to obtain exposure parameters that can shoot the target exposure intensity. Then, the next frame of image is shot according to the adjusted exposure parameters, so that the exposure intensity of the next frame of image can be the target exposure intensity, thereby making the brightness changes of the previous N frames of image, the current frame of image and the next frame of image smooth, thereby improving viewing comfort.
[0165] Optionally, the weighted summation module 240 may include:
[0166] The first acquisition submodule is used to acquire the exposure intensity weight of the current frame image and each frame image in the previous N frames of images;
[0167] The first weighted summation submodule is used to perform weighted summation on the second exposure intensity and each first exposure intensity according to each exposure intensity weight to obtain a target exposure intensity.
[0168] Optionally, the brightness information includes: an average brightness value of the current frame image, and the exposure parameters include: exposure time, analog gain, digital gain and iris aperture;
[0169] The first determination module 230 may include:
[0170] A first determination submodule, configured to determine a third exposure intensity according to a product of exposure time, analog gain, digital gain, and iris aperture;
[0171] A second determination submodule, used to determine a first adjustment step according to a ratio of the average brightness value to the target brightness value;
[0172] The calculation submodule is used to calculate the product of the first adjustment step and the third exposure intensity to obtain the second exposure intensity.
[0173] Optionally, the second determining submodule may include:
[0174] A first determining unit, configured to determine that a ratio of an average brightness value to a target brightness value is a second adjustment step;
[0175] A second determining unit, configured to determine a target interval corresponding to the second adjustment step according to the second adjustment step;
[0176] The third determining unit is used to determine a target adjustment step value corresponding to the target interval from a correspondence between a preset adjustment step interval and an adjustment step, wherein the target adjustment step value is a first adjustment step.
[0177] Optionally, the brightness information also includes: an average brightness value of a green channel of the current frame image;
[0178] The exposure parameter adjustment device 200 may further include:
[0179] A second determination module is used to determine the target illumination value corresponding to the green channel average brightness value and the third exposure intensity according to the corresponding relationship between the preset green channel average brightness value and the preset third exposure intensity and the preset illumination value;
[0180] A third determination module is used to determine the current brightness scene corresponding to the target illumination value according to the magnitude relationship between the illumination value and the illumination threshold;
[0181] The fourth determination module is used to determine the preset brightness value corresponding to the current brightness scene as the target brightness value according to the correspondence between the preset brightness scene and the preset brightness value.
[0182] Optionally, the calculation submodule may include:
[0183] A third determination unit, used to input the brightness information into a scene recognition model to determine the scene category corresponding to the current frame image;
[0184] a fourth determining unit, configured to determine an exposure intensity compensation value corresponding to a scene category from a relationship between a preset scene category and a preset exposure intensity compensation value;
[0185] The fifth determining unit is used to determine that the sum of the exposure intensity compensation value and the product of the first adjustment step and the third exposure intensity is the second exposure intensity.
[0186] Optionally, the exposure parameter adjustment device 200 may further include:
[0187] A fifth determining module, used to determine an adjustment method of the exposure parameter according to a magnitude relationship between the second adjustment step and the adjustment step threshold;
[0188] The adjustment module 240 may include:
[0189] The adjustment submodule is used to adjust the exposure parameters of the next frame image according to the target exposure intensity and the adjustment method.
[0190] Optionally, the exposure parameter adjustment device 200 may further include:
[0191] A first input module, used to input the brightness information into a deep learning network model to obtain multiple scenes;
[0192] A second input module is used to input pre-acquired images corresponding to a plurality of scenes into the deep learning network model for training to obtain a real value corresponding to each scene;
[0193] The fourth determination module is used to obtain the scene recognition model when the accuracy of the real value reaches a preset accuracy.
[0194] The exposure parameter adjustment device 200 provided in the embodiment of the present application can achieve Figure 1 The various processes implemented by the method embodiment can achieve the same technical effect, and to avoid repetition, they will not be described here.
[0195] Figure 3 A schematic diagram of the hardware structure of an exposure parameter adjustment device provided in an embodiment of the present invention is shown.
[0196] The data encryption and decryption exposure parameter adjustment device may include a processor 301 and a memory 302 storing computer program instructions.
[0197] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.
[0198] The memory 302 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 302 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 302 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 302 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 302 is a non-volatile solid-state memory.
[0199] In certain embodiments, the memory 302 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory 302 includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors 301), it is operable to perform the operations described with reference to the method according to an aspect of the present application.
[0200] The processor 301 reads and executes the computer program instructions stored in the memory 302 to implement any one of the data encryption and / or decryption exposure parameter adjustment devices in the above embodiments.
[0201] In one example, the data encryption and decryption exposure parameter adjustment device may also include a communication interface 303 and a bus 304. As shown in the figure, the processor 301, the memory 302, and the communication interface 303 are connected through the bus 304 and communicate with each other.
[0202] The communication interface 303 is mainly used to implement the communication between the modules, devices, units and / or equipment in the embodiment of the present invention.
[0203] The bus 304 includes hardware, software or both. For example and not limitation, the bus 304 may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnect, an industry standard architecture (ISA) bus, a wireless bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral control interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, the bus 304 may include one or more buses 304. Although the present application embodiment describes and shows a specific bus 304, the present application considers any suitable bus 304 or interconnection.
[0204] The data encryption and decryption exposure parameter adjustment device can be based on the current data encryption and decryption exposure parameter adjustment method, thereby realizing the combination Figure 1-2 A method and apparatus for adjusting exposure parameters are described.
[0205] In addition, the embodiment of the present application also provides a computer program product, including computer program instructions, and when the computer program product is executed by the processor 301, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0206] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0207] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0208] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0209] Aspects of the present disclosure are described above with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data encryption and / or decryption exposure parameter adjustment device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more boxes in the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0210] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for adjusting exposure parameters, characterized in that: The method comprises: Obtaining brightness information and exposure parameters of a current frame image and first exposure intensities corresponding to N frames of images before the current frame image, where N is a positive integer; Determining, according to the brightness information, an exposure intensity compensation value corresponding to the scene category of the current frame image; Determining a second exposure intensity of the current frame image according to the exposure intensity compensation value and the exposure parameter; Performing a weighted summation on the second exposure intensity and each of the first exposure intensities to obtain a target exposure intensity; According to the target exposure intensity, the exposure parameters of the next frame of image are adjusted.
2. The method according to claim 1, characterized in that The step of performing weighted summation on the second exposure intensity and each of the first exposure intensities to obtain a target exposure intensity includes: Obtaining the exposure intensity weight of the current frame image and each frame image in the previous N frames of image; According to each of the exposure intensity weights, the second exposure intensity and each of the first exposure intensities are weighted and summed to obtain the target exposure intensity.
3. The method according to claim 1, characterized in that The brightness information includes: the average brightness value of the current frame image, and the exposure parameters include: exposure time, analog gain, digital gain and iris aperture; The determining, according to the brightness information and the exposure parameter of the current frame image, the second exposure intensity of the current frame image comprises: determining a third exposure intensity according to the product of the exposure time, the analog gain, the digital gain, and the iris aperture; Determining a first adjustment step according to a ratio of the average brightness value to the target brightness value; The product of the first adjustment step and the third exposure intensity is calculated to obtain a second exposure intensity.
4. The method according to claim 3, characterized in that The determining the first adjustment step according to the ratio of the average brightness value to the target brightness value includes: Determine a ratio of the average brightness value to the target brightness value as a second adjustment step; Determining a target interval corresponding to the second adjustment step according to the second adjustment step; A target adjustment step value corresponding to the target interval is determined from a correspondence between a preset adjustment step interval and an adjustment step, and the target adjustment step value is the first adjustment step.
5. The method according to claim 4, characterized in that The brightness information also includes: the average brightness value of the green channel of the current frame image; Before determining that the ratio of the average brightness value to the target brightness value is a second adjustment step, the method further includes: Determine the corresponding target illumination value according to the corresponding relationship between the preset green channel average brightness value and the preset third exposure intensity and the preset illumination value; Determine the current brightness scene corresponding to the target illumination value according to the magnitude relationship between the illumination value and the illumination threshold; According to the correspondence between the preset brightness scene and the preset brightness value, the preset brightness value corresponding to the current brightness scene is determined as the target brightness value.
6. The method according to claim 4, characterized in that After determining that the ratio of the average brightness value to the target brightness value is a second adjustment step, the method further includes: determining an adjustment method of the exposure parameter according to a magnitude relationship between the second adjustment step and an adjustment step threshold; The step of adjusting the exposure parameters of the next frame of image according to the target exposure intensity includes: According to the target exposure intensity, the exposure parameters of the next frame of image are adjusted according to the adjustment method.
7. The method according to claim 3, characterized in that Determining the exposure intensity compensation value corresponding to the scene category of the current frame image according to the brightness information includes: Inputting the brightness information into a scene recognition model to determine the scene category corresponding to the current frame image; From the relationship between the preset scene category and the preset exposure intensity compensation value, an exposure intensity compensation value corresponding to the scene category is determined.
8. The method according to claim 7, characterized in that Before inputting the brightness information into the scene recognition model to determine the scene category corresponding to the current frame image, the method further includes: Inputting the brightness information into a deep learning network model to obtain multiple scenes; Inputting pre-acquired images corresponding to a plurality of scenes into the deep learning network model for training to obtain a real value corresponding to each scene; When the accuracy of the real value reaches a preset accuracy, the scene recognition model is obtained.
9. The method according to claim 3, characterized in that The step of determining the second exposure intensity of the current frame image according to the exposure intensity compensation value and the exposure parameter comprises: Determine that the sum of the exposure intensity compensation value, the product of the first adjustment step and the third exposure intensity is the second exposure intensity.
10. An exposure parameter adjustment device, characterized in that: The device comprises: A first acquisition module is used to acquire brightness information and exposure parameters of a current frame image and first exposure intensities corresponding to N frames of images before the current frame image, where N is a positive integer; A first determination module, used to determine an exposure intensity compensation value corresponding to the scene category of the current frame image according to the brightness information; A second determination module, used to determine a second exposure intensity of the current frame image according to the exposure intensity compensation value and the exposure parameter; a weighted summation module, configured to perform a weighted summation on the second exposure intensity and each of the first exposure intensities to obtain a target exposure intensity; The adjustment module is used to adjust the exposure parameters of the next frame of image according to the target exposure intensity.