Image acquisition method and device and electronic equipment

By dividing the camera image into blocks and calculating the average brightness, and adjusting the exposure parameters of long, medium, and short frames, the problem of overexposure in bright areas and underexposure in dark areas in complex scenes was solved, thus achieving high-quality image acquisition.

CN121865110APending Publication Date: 2026-04-14ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In complex and ever-changing shooting scenarios, existing cameras with fixed exposure duration and gain settings cause overexposure in bright areas and underexposure in dark areas, affecting image quality and information integrity.

Method used

The image of the shooting scene is divided into a preset number of blocks. The average brightness of each block is calculated to determine the bright and dark blocks. The exposure ratio and gain of long frames, medium frames and short frames are adjusted by scene dynamic values. The exposure parameters are gradually optimized to cover the full dynamic range and ensure the signal-to-noise ratio in the dark areas.

Benefits of technology

It effectively solves the problems of overexposure in bright areas and underexposure in dark areas, improves image quality, ensures a complete dynamic range from dark to bright areas, and preserves shadow details.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121865110A_ABST
    Figure CN121865110A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image acquisition method, an image acquisition device and electronic equipment, which are used for solving the problem that the image quality and the information integrity are influenced in related technologies. The image of the shooting scene is divided into the preset number of blocks, the bright blocks and the dark blocks are determined according to the bright region threshold value and the dark region threshold value, the first average value of the brightness of the pixel points of each bright block and the second average value of the brightness of the pixel points of each dark block are calculated, and the scene dynamic value is obtained through the ratio of the first average value and the second average value. The scene dynamic value can reflect the brightness difference degree of the bright area and the dark area of the shooting scene. The method comprises the following steps: determining a first exposure ratio of a long frame to a middle frame and a second exposure ratio of the middle frame to a short frame according to a scene dynamic value, adjusting exposure parameters of the middle frame and the short frame, ensuring that the long frame, the middle frame and the short frame cover a complete dynamic range from a dark part to a bright part, avoiding information loss, and determining exposure parameters of the long frame according to target brightness so as to improve the image quality. The problems of bright area overexposure and dark area underexposure can be effectively solved, and the image quality is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of surveillance camera technology, and in particular to an image acquisition method, device and electronic device. Background Technology

[0002] In the field of camera technology, achieving high-quality image capture has always been a core objective. Among these objectives, dynamic range is crucial for accurately reproducing the lighting information of the scene being captured. Dynamic range reflects a camera's ability to simultaneously capture details in both the brightest and darkest areas of a scene; a wide dynamic range means that a camera can better balance the exposure of bright and dark areas in high-contrast scenes.

[0003] Wide dynamic range (WDR) mode, as a key technology for improving the dynamic range of a camera, directly affects the final shooting effect through the settings of its exposure time and gain. Currently, the common setting method is to set a fixed exposure time and fixed gain. This method can indeed provide acceptable image quality in specific, relatively stable shooting scenarios.

[0004] However, the external environment is complex and variable, and actual shooting scenarios are often difficult to keep constant. When environmental changes occur in the shooting scene, such as strong light source illumination, bright and dark areas often coexist in the image. At this time, the limitations of fixed settings become apparent. Because the exposure time and gain are fixed, the camera cannot dynamically adjust the exposure parameters according to the real-time changes in the light in the scene. This can lead to overexposure in bright areas, resulting in the loss of bright details and the appearance of pure white; while dark areas may be underexposed, making it difficult to distinguish dark details and appearing as pitch black. This imbalance in exposure between bright and dark areas seriously affects the image quality and information integrity, failing to meet the requirements for accurate dynamic range representation in complex and ever-changing shooting scenarios. Summary of the Invention

[0005] This application provides an image acquisition method, apparatus, and electronic device to solve problems affecting image quality and information integrity in related technologies.

[0006] In a first aspect, embodiments of this application provide an image acquisition method, the method comprising:

[0007] Acquire an image of the shooting scene and divide the image into a preset number of blocks; determine bright blocks and dark blocks based on the brightness value of each pixel; determine a first average brightness of pixels in each bright block and a second average brightness of pixels in each dark block; and determine the scene dynamic value based on the ratio of the first average to the second average.

[0008] Determine the first exposure ratio between long frames and medium frames, and the second exposure ratio between medium frames and short frames, for the dynamic values ​​of the scene; and determine the exposure duration and gain for the preset target brightness as the first exposure duration and first gain of the long frames, and adjust the exposure duration and gain of the medium frames according to the preset first step length until the determined exposure ratio is the first exposure ratio; adjust the exposure duration and gain of the short frames according to the preset second step length until the determined exposure ratio is the second exposure ratio;

[0009] Acquire images based on determined exposure durations and gain for long, medium, and short frames.

[0010] Secondly, embodiments of this application also provide an image acquisition device, the device comprising:

[0011] The acquisition and determination module is used to acquire an image of the shooting scene, divide the image into a preset number of blocks; determine bright blocks and dark blocks according to the brightness value of each pixel; determine a first average brightness of pixels in each bright block and a second average brightness of pixels in each dark block; and determine scene dynamic values ​​according to the ratio of the first average value to the second average value.

[0012] The processing module is used to determine the first exposure ratio of long frames and medium frames saved for the scene dynamic values, and the second exposure ratio of medium frames and short frames; and to determine the exposure duration and gain saved for a preset target brightness as the first exposure duration and first gain of the long frames, and to adjust the exposure duration and gain of the medium frames according to a preset first step length until the determined exposure ratio is the first exposure ratio; to adjust the exposure duration and gain of the short frames according to a preset second step length until the determined exposure ratio is the second exposure ratio; and to acquire images based on the determined exposure duration and gain of the long frames, medium frames, and short frames.

[0013] Thirdly, embodiments of this application also provide an electronic device, which includes at least a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the steps of the image acquisition method as described in any of the preceding claims.

[0014] In this embodiment, the image of the shooting scene is divided into a preset number of blocks. This block division method allows for detailed local analysis of the image. An average brightness value is calculated for each block. Bright and dark areas are determined based on bright and dark area thresholds. A first average brightness value and a second average brightness value for each pixel in a bright area are calculated, and the ratio of these two values ​​yields a scene dynamic value. This scene dynamic value reflects the degree of brightness difference between bright and dark areas in the shooting scene. Based on the scene dynamic value, a first exposure ratio between long and medium frames and a second exposure ratio between medium and short frames are determined. The exposure parameters of medium and short frames are gradually adjusted to ensure that long, medium, and short frames cover the complete dynamic range from dark to bright areas, avoiding information loss. Furthermore, the exposure parameters of long frames are determined based on the average brightness value of dark areas, prioritizing the signal-to-noise ratio in dark areas, preserving shadow details, effectively solving the problems of overexposure in bright areas and underexposure in dark areas, and improving image quality. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a schematic diagram illustrating the process of an image acquisition method provided in an embodiment of this application;

[0017] Figure 2 A schematic diagram illustrating a process for determining the exposure parameters of a mid-frame, provided as an embodiment of this application;

[0018] Figure 3 This is a schematic diagram of an image acquisition structure provided in an embodiment of this application;

[0019] Figure 4 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation

[0020] The present application will now be described in further detail with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application.

[0021] To improve image quality, this application provides an image acquisition method, which includes: an electronic device acquiring an image of a shooting scene and dividing the image into a preset number of blocks; determining bright blocks and dark blocks based on the brightness value of each pixel; determining a first average brightness value of pixels in each bright block and a second average brightness value of pixels in each dark block, and determining a scene dynamic value based on the ratio of the first average value to the second average value; determining a first exposure ratio between long frames and medium frames, and a second exposure ratio between medium frames and short frames, for the scene dynamic value; determining the exposure duration and gain of a preset target brightness value as the first exposure duration and first gain of the long frame; adjusting the exposure duration and gain of the medium frame according to a preset first step length until the determined exposure ratio is the first exposure ratio; adjusting the exposure duration and gain of the short frame according to a preset second step length until the determined exposure ratio is the second exposure ratio; and acquiring an image based on the determined exposure duration and gain of the long, medium, and short frames.

[0022] Example 1:

[0023] Figure 1 This is a schematic diagram of an image acquisition method provided in an embodiment of this application. The process includes the following steps:

[0024] S101: Acquire an image of the shooting scene, divide the image into a preset number of blocks; determine bright blocks and dark blocks based on the brightness value of each pixel; determine a first average brightness value of pixels in each bright block and a second average brightness value of pixels in each dark block; determine the scene dynamic value based on the ratio of the first average value to the second average value.

[0025] The image acquisition method provided in this application is applied to an electronic device, which can be an image acquisition device, a PC, or a server, or other intelligent devices.

[0026] To accurately and effectively acquire images, electronic devices can determine the scene dynamics of the current shooting scene. These scene dynamics can also be referred to as dynamic range. The electronic device can first acquire an image of the shooting scene and divide it into a preset number of blocks, where each block has the same area. In one example, the image of the current shooting scene can be divided into X×Y blocks, where X and Y are both positive integers greater than 1.

[0027] Electronic devices can determine bright and dark areas based on the brightness value of each pixel. Specifically, they can calculate the average values ​​of the three channels (Red, R, Green, G, and Blue, B) for each block based on data from the Bayer image sensor.

[0028] Specifically, the electronic device can calculate the average value of a certain block of R channels using the following formula.

[0029]

[0030] Among them, R avg (x,y) represents the mean of the R channels of this block, where (x,y) represents the coordinate range or location identifier of this block, (ir,jr) is the coordinate of a pixel in a certain R channel, and (ir,jr)∈(x,y) indicates that the pixel in that R channel belongs to this block, N R This represents the total number of pixels in the R channel that participate in the calculation within this block, and R(ir,jr) represents the R value of the pixel at coordinates (ir,jr).

[0031] The electronic device can calculate the mean value of a certain block of G channels using the following formula.

[0032]

[0033] Among them, G avg (x,y) represents the mean of the G channel of this block, where (x,y) represents the coordinate range or location identifier of this block, (igr,jgr) represents the coordinates of a pixel in a Green-Red (Gr) channel, (igr,jgr)∈(x,y) means that a pixel in the Gr channel belongs to this block, (igb,jgb) represents the coordinates of a pixel in a Green-Blue (Gb) channel, (igb,jgb)∈(x,y) means that a pixel in the Gb channel belongs to this block, and N Gr N represents the total number of pixels in all Gr channels involved in the calculation within this block. Gb This represents the total number of pixels in all Gb channels that participated in the calculation within this block.

[0034] The electronic device can calculate the mean value of a certain block of R channels using the following formula.

[0035]

[0036] Among them, B avg (x,y) represents the mean of the B channels of this block, where (x,y) represents the coordinate range or location identifier of this block, (ib,jb) is the coordinate of a pixel in a certain B channel, and (ib,jb)∈(x,y) indicates that a pixel in the R channel belongs to this block, N B R(ib,jb) represents the total number of B-channel pixels in the block that are involved in the calculation, and R(ib,jb) represents the B value of the pixel at coordinates (ib,jb).

[0037] The electronic device can determine the average brightness of each block by determining the average values ​​of the R, G, and B channels of that block.

[0038] Specifically, electronic devices can determine the average brightness of a block using the following formula:

[0039] Y(x,y)=0.299*R avg (x,y)+0.587*G avg (x,y)+0.114*B avg (x,y)

[0040] Where Y(x,y) represents the average brightness of this block, and R avg (x,y) represents the mean of the R channel in this block, G avg (x,y) represents the mean of the G channel in this block, B avg (x,y) represents the mean value of channel B in this block.

[0041] Electronic devices can determine bright and dark blocks based on the average brightness of each block. In one example, electronic devices can determine blocks with an average brightness greater than a first threshold as bright blocks and blocks with an average brightness less than a second threshold as dark blocks. The first threshold is greater than the second threshold.

[0042] The electronic device determines the average brightness of the pixels in each bright block. For ease of distinction, this average value can be called the first average value. The electronic device also determines the average brightness of the pixels in each dark block. For ease of distinction, this average value can be called the second average value.

[0043] The electronic device can determine the scene dynamic value based on the ratio of the first average value to the second average value. In one example, the ratio of the first average value to the second average value can be used to determine the scene dynamic value.

[0044] Specifically, electronic devices can determine scene dynamic values ​​using the following formula:

[0045]

[0046] Among them, DR cur Y is a dynamic value for the scene. lavg Y is the first average value. davg This is the second average value.

[0047] In this embodiment, the electronic device can further perform mean filtering on each bright block to remove discrete bright and dark pixels. Since the human eye is not sensitive to the impact of discrete bright and dark points on dynamic range, but is more sensitive to large areas of bright and dark regions, removing discrete bright and dark pixels means they are not used as reference points for dynamic range calculation.

[0048] S102: Determine the first exposure ratio of the long frame and the medium frame saved for the scene dynamic value, and the second exposure ratio of the medium frame and the short frame; and determine the exposure duration and gain saved for the preset target brightness value as the first exposure duration and the first gain of the long frame, and adjust the exposure duration and gain of the medium frame according to the preset first step length until the determined exposure ratio is the first exposure ratio; adjust the exposure duration and gain of the short frame according to the preset second step length until the determined exposure ratio is the second exposure ratio.

[0049] In multi-frame fusion scenarios, it is necessary to dynamically adjust the exposure parameters of long frames, medium frames, and short frames to achieve high dynamic range imaging or detail optimization in specific scenarios.

[0050] After acquiring the scene dynamic values, the electronic device can obtain the first exposure ratio between long and medium frames, and the second exposure ratio between medium and short frames, stored for that scene dynamic value. In other words, it allocates the exposure ratios between the long and medium frames, and between the medium and short frames, within the three-frame wide dynamic range of the current shooting scene, based on the dynamic range of the scene. The electronic device can also obtain the first exposure duration and first gain of the long frame, stored for the target brightness value of pixels in dark areas. In one example, the exposure duration and gain required to meet the target brightness value can be directly assigned as the first exposure duration and first gain of the long frame.

[0051] Furthermore, the electronic device adjusts the exposure duration and gain of the intermediate frames according to a preset first step. This can be done by first initializing the exposure duration and gain of the intermediate frames, and then calculating the actual exposure ratio after each adjustment until a predetermined exposure ratio is determined. In one example, the electronic device can adjust the exposure duration and gain of the intermediate frames simultaneously, or it can adjust them alternately. Determining the exposure ratio of the long and short frames given their exposure durations and gains is existing technology and will not be elaborated upon here.

[0052] After determining the first exposure ratio, the electronic device adjusts the exposure duration and gain of the short frame according to the preset second step size. The exposure duration and gain of the short frame can be initialized first, and the actual exposure ratio can be calculated after each adjustment of the exposure duration and gain of the short frame until the determined exposure ratio is the second exposure ratio. In one example, the electronic device can adjust the exposure duration and gain of the short frame simultaneously, or it can adjust the exposure duration and gain of the short frame alternately.

[0053] In one example, the electronic device can also perform a final check to ensure that the parameters of long frames, medium frames, and short frames meet hardware constraints and image quality standards, such as the total frame duration not exceeding the system latency threshold. If the hardware constraints are not met or the image quality standards are not met, the step size needs to be adjusted back or the exposure parameters of the long frames need to be reset to ensure both response speed and image quality in dynamic scenes.

[0054] Assuming the image sensor's wide dynamic range three frames (i.e., long frame, medium frame, and short frame) have different light sensitivity levels, and with the same shutter speed and gain settings for the three frames, the ratio of the light sensitivity difference between the long frame, medium frame, and short frame is Ratio. L Ratio M Ratio S .

[0055] S103: Acquire images based on determined exposure duration and gain for long, medium, and short frames.

[0056] After determining the exposure duration and gain for long, medium, and short frames, the electronic device can acquire images based on the exposure duration and gain of the long, medium, and short frames.

[0057] This application provides a method for controlling the wide dynamic range of camera exposure ratio.

[0058] In this embodiment, the image of the shooting scene is divided into a preset number of blocks. This block division method allows for detailed local analysis of the image. An average brightness value is calculated for each block. Bright and dark areas are determined based on bright and dark area thresholds. A first average brightness value and a second average brightness value for each pixel in a bright area are calculated, and the ratio of these two values ​​yields a scene dynamic value. This scene dynamic value reflects the degree of brightness difference between bright and dark areas in the shooting scene. Based on the scene dynamic value, a first exposure ratio between long and medium frames and a second exposure ratio between medium and short frames are determined. The exposure parameters of medium and short frames are gradually adjusted to ensure that long, medium, and short frames cover the complete dynamic range from dark to bright areas, avoiding information loss. Furthermore, the exposure parameters of long frames are determined based on the average brightness value of dark areas, prioritizing the signal-to-noise ratio in dark areas, preserving shadow details, effectively solving the problems of overexposure in bright areas and underexposure in dark areas, and improving image quality.

[0059] Example 2:

[0060] To improve image quality, based on the above embodiments, in this embodiment, after determining the exposure duration and gain saved for a preset target brightness as the first exposure duration and first gain of the long frame, the method further includes adjusting the exposure duration and gain of the medium frame according to a preset first step length until the determined exposure ratio is the first exposure ratio:

[0061] The exposure time and gain of the long frame are adjusted to the first exposure time and the first gain to determine the first maximum shooting brightness of the long frame; the first target signal-to-noise ratio of the long frame under the first maximum shooting brightness is calculated; and the second target signal-to-noise ratio is determined based on the first target signal-to-noise ratio and a pre-saved signal-to-noise ratio drop threshold.

[0062] The exposure duration and gain of the intermediate frames are adjusted according to the preset first step length until the determined exposure ratio is the first exposure ratio:

[0063] The exposure time and gain of the frame are adjusted according to the preset first step length adjustment until the signal-to-noise ratio determined under the first maximum shooting brightness based on the adjusted second exposure time and second gain is the second target signal-to-noise ratio, and the exposure ratio determined based on the adjusted second exposure time, second gain, first exposure time and first gain is the first exposure ratio.

[0064] In order to keep the signal-to-noise ratio drop between long frames and medium frames within a small range and improve image quality, in this embodiment of the application, when adjusting the exposure time of the medium frame, it can be adjusted until the deviation between the signal-to-noise ratio of the medium frame and the long frame is small.

[0065] In one example, the electronic device can adjust the exposure time and gain of a long frame to a first exposure time and a first gain, and determine the maximum shooting brightness of the long frame under the first exposure time and the first gain. For ease of distinction, this maximum shooting brightness can be referred to as the first maximum shooting brightness. The electronic device calculates the first target signal-to-noise ratio (SNR) of the long frame under this first maximum shooting brightness. Considering the noise superposition effect in actual imaging, a pre-stored SNR drop threshold can be introduced to determine the second target SNR that the medium frame needs to meet. The difference between the first target SNR and the pre-stored SNR drop threshold can be determined as the second target SNR.

[0066] Alternatively, the electronic device can determine the first target signal-to-noise ratio using the following formula:

[0067]

[0068] Among them, SNR L For the primary target signal-to-noise ratio, Y L For the first maximum shooting brightness, MSE L The noise standard deviation of a long frame under the first maximum shooting brightness.

[0069] The method for determining the noise standard deviation of a long frame under a certain shooting brightness is existing technology and will not be elaborated here.

[0070] To keep the signal-to-noise ratio (SNR) drop between long and medium frames within a small range, the electronic device can adjust the exposure duration of the medium frame according to a preset first step, until the SNR determined under the first maximum shooting brightness based on the adjusted second exposure duration and second gain is the second target SNR, and the exposure ratio determined based on the adjusted second exposure duration, second gain, and the first exposure duration and first gain of the long frame is the first exposure ratio. In one example, the actual exposure ratio and SNR can be calculated after each adjustment of the exposure duration and gain of the medium frame until the determined exposure ratio is the first exposure ratio and the determined SNR is the second target SNR. In another example, the electronic device can adjust the exposure duration and gain of the medium frame simultaneously, or it can adjust the exposure duration and gain of the medium frame alternately.

[0071] One approach is to use an adaptive exposure ratio to set the camera's wide dynamic range (WDR) exposure ratio. This allows the WDR exposure ratio to be adjusted according to changes in the lighting conditions of the shooting scene, providing good scene adaptability and achieving dynamic range acquisition in the corresponding scene. However, this method results in significant differences in exposure duration between long and short frames, leading to signal-to-noise ratio issues at the boundary between bright and dark areas in the image after merging long and short frames, thus affecting image quality. The method provided in this application effectively avoids this problem and improves image quality.

[0072] Example 3:

[0073] To improve image quality, based on the above embodiments, in this embodiment, the step of adjusting the exposure duration and gain of the intermediate frame according to a preset first-step length adjustment until the signal-to-noise ratio determined under the first maximum shooting brightness based on the adjusted second exposure duration and second gain is the second target signal-to-noise ratio, and the exposure ratio determined based on the adjusted second exposure duration, second gain, first exposure duration, and first gain is the first exposure ratio, includes:

[0074] The gain of the mid-frame is determined to be the minimum mid-frame gain;

[0075] Repeat the following steps until the condition is met:

[0076] The exposure duration of the intermediate frame is adjusted according to the first duration step size in the preset first step length until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the intermediate frame under the first maximum shooting brightness is the second target signal-to-noise ratio. It is then determined whether the exposure ratio determined by the adjusted exposure duration and the current gain of the intermediate frame, the first exposure duration and the first gain is the first exposure ratio. If yes, the condition is satisfied. If no, the gain of the intermediate frame is adjusted according to the first gain step size in the preset first step length.

[0077] The exposure duration and gain when the conditions are met are determined as the second exposure duration and second gain for the medium frame.

[0078] In the process of optimizing the exposure parameters of the middle frame to achieve multi-frame collaborative imaging, the electronic device dynamically adjusts the exposure time and gain to meet the corresponding exposure ratio constraints while satisfying the second target signal-to-noise ratio.

[0079] In one example, the electronic device can determine the gain of the mid-frame as the minimum mid-frame gain and repeat the following steps until the condition is met:

[0080] The exposure duration of the intermediate frame is adjusted according to a preset first time step. The initial exposure duration of the intermediate frame can be the minimum exposure duration. The adjusted exposure duration and the signal-to-noise ratio (SNR) of the current gain of the intermediate frame at the first maximum shooting brightness are determined. It is then determined whether the SNR is the second target SNR. If the SNR is not the second target SNR, the exposure duration of the intermediate frame is adjusted according to the first time step until the determined SNR is the second target SNR. In one example, if the exposure duration of the intermediate frame reaches the maximum intermediate frame duration and the determined SNR is still not the second target SNR, then the maximum intermediate frame duration is determined as the current exposure duration of the intermediate frame. After determining the signal-to-noise ratio as the second target signal-to-noise ratio, the electronic device can determine the exposure ratio based on the adjusted exposure time, the current gain of the mid-frame, the first exposure time and the first gain of the long frame, and determine whether the exposure ratio is the first exposure ratio. If the exposure ratio is the first exposure ratio, the condition is met. If the exposure ratio is not the first exposure ratio, the gain of the mid-frame needs to be increased. In one example, the gain of the mid-frame can be adjusted according to the preset first gain step size, and the process can be repeated.

[0081] Figure 2 This application provides a schematic diagram of a process for determining the exposure parameters of a mid-frame, which includes the following steps:

[0082] S201: Determine the gain of the mid-frame as the minimum mid-frame gain.

[0083] S202: Adjust the exposure duration of the middle frame according to the preset first duration step.

[0084] S203: Determine the signal-to-noise ratio based on the adjusted exposure time and the current gain of the mid-frame at the first maximum shooting brightness.

[0085] S204: Determine whether the signal-to-noise ratio is the second target signal-to-noise ratio. If not, proceed to S205; if yes, proceed to S206.

[0086] S205: Determine whether the exposure duration of the medium frame has reached the maximum exposure duration. If yes, execute S207; otherwise, execute S202.

[0087] S206: Determine the exposure ratio based on the adjusted exposure duration, the current gain of the mid-frame, the first exposure duration, and the first gain.

[0088] S207: Determine whether the determined exposure ratio is the first exposure ratio. If yes, proceed to S208; otherwise, proceed to S209.

[0089] S208: Set the current exposure duration and gain as the second exposure duration and second gain for the medium frame, and end.

[0090] S209: Adjust the gain of the middle frame according to the preset first gain step size, and execute S206.

[0091] The exposure duration and gain when the conditions are met are determined as the second exposure duration and second gain for the medium frame.

[0092] In this embodiment, the dynamic range of the shooting scene is achieved by adjusting the exposure duration and gain of the three wide dynamic range frames, while keeping the signal-to-noise ratio drop between the three frames within a small range.

[0093] Example 4:

[0094] To improve image quality, based on the above embodiments, in this embodiment, after adjusting the exposure duration and gain of the middle frame according to a preset step size until the determined exposure ratio is the first exposure ratio, and before adjusting the exposure duration and gain of the short frame according to a preset second step size until the determined exposure ratio is the second exposure ratio, the method further includes:

[0095] The exposure time and gain of the mid-frame are adjusted to the second exposure time and the second gain to determine the second maximum shooting brightness of the mid-frame; the third target signal-to-noise ratio of the mid-frame under the second maximum shooting brightness is calculated; and the fourth target signal-to-noise ratio is determined based on the third target signal-to-noise ratio and the pre-saved signal-to-noise ratio drop threshold.

[0096] The step of adjusting the exposure duration and gain of the short frame according to the preset second step size until the determined exposure ratio is the second exposure ratio includes:

[0097] The exposure duration and gain of the short frame are adjusted according to the preset second step length until the signal-to-noise ratio determined under the second maximum shooting brightness based on the adjusted third exposure duration and third gain is the fourth target signal-to-noise ratio, and the exposure ratio determined based on the adjusted third exposure duration, third gain, second exposure duration and second gain is the second exposure ratio.

[0098] In order to keep the signal-to-noise ratio drop between medium and short frames within a small range and improve image quality, in this embodiment of the application, when adjusting the exposure time of the short frame, it can be adjusted until the deviation between the signal-to-noise ratio of the determined frame and the signal-to-noise ratio of the medium frame is small.

[0099] In one example, the electronic device can adjust the exposure duration and gain of the mid-frame to a second exposure duration and a second gain, and determine the maximum shooting brightness of the mid-frame under the second exposure duration and second gain. For ease of distinction, this maximum shooting brightness can be referred to as the second maximum shooting brightness. The electronic device calculates the third target signal-to-noise ratio (SNR) of the mid-frame under this second maximum shooting brightness. Considering the noise superposition effect in actual imaging, a pre-stored SNR drop threshold can be introduced to determine the fourth target SNR that the short frame must meet. The difference between the third target SNR and the pre-stored SNR drop threshold can be determined as the fourth target SNR.

[0100] Alternatively, the electronic device can determine the third target signal-to-noise ratio using the following formula:

[0101]

[0102] Among them, SNR M For the third target signal-to-noise ratio, Y M For the second maximum shooting brightness, MSE M The noise standard deviation of the medium frame under the second maximum shooting brightness.

[0103] The method for determining the noise standard deviation of a medium frame under a certain shooting brightness is existing technology and will not be elaborated here.

[0104] To keep the signal-to-noise ratio (SNR) drop between medium and short frames within a small range, the electronic device can adjust the exposure duration and gain of the short frames according to a preset second step size until the SNR determined under the second maximum shooting brightness based on the adjusted third exposure duration and third gain is the fourth target SNR. The exposure ratio determined based on the adjusted third exposure duration and third gain, and the second exposure duration and second gain of the medium frames, is the second exposure ratio. In one example, the actual exposure ratio and SNR can be calculated after each adjustment of the short frame's exposure duration and gain until the determined exposure ratio is the second exposure ratio and the determined SNR is the fourth target SNR. In another example, the electronic device can adjust the exposure duration and gain of the short frames simultaneously or alternately.

[0105] The method provided in this application embodiment, based on the current exposure time and gain settings of the three frames (long, medium, and short frames) in wide dynamic range, can achieve a signal-to-noise ratio drop between the three frames within a small range of the target threshold without sacrificing dynamic range. The initial exposure time and gain of the three frames (long, medium, and short frames) in wide dynamic range can be set, and a larger exposure ratio can be set to capture scenes with a larger dynamic range.

[0106] Example 5:

[0107] To improve image quality, based on the above embodiments, in this embodiment, the step of adjusting the exposure duration and gain of short frames according to a preset second step size until the signal-to-noise ratio determined under the second maximum shooting brightness based on the adjusted third exposure duration and third gain is the fourth target signal-to-noise ratio, and the exposure ratio determined based on the adjusted third exposure duration, third gain, second exposure duration, and second gain is the second exposure ratio, includes:

[0108] The gain of the short frame is determined as the minimum short frame gain;

[0109] Repeat the following steps until the condition is met:

[0110] The exposure duration of the short frame is adjusted according to the second duration step size in the preset second step size until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the short frame under the second maximum shooting brightness is the fourth target signal-to-noise ratio; it is determined whether the exposure ratio determined by the adjusted exposure duration and the current gain of the short frame, the second exposure duration and the second gain is the second exposure ratio. If yes, it is determined that the condition is met. If not, the gain of the short frame is adjusted according to the second gain step size in the preset second step size.

[0111] The exposure duration and gain that meet the conditions are determined as the third exposure duration and the third gain.

[0112] In the process of optimizing the exposure parameters of short frames to achieve multi-frame collaborative imaging, the electronic device dynamically adjusts the exposure time and gain to meet the fourth target signal-to-noise ratio while also complying with the corresponding exposure ratio constraints.

[0113] In one example, the electronic device can determine the gain of a short frame as the minimum short frame gain and repeat the following steps until the condition is met:

[0114] The exposure duration of the short frame is adjusted according to a preset second time step. The signal-to-noise ratio (SNR) of the adjusted exposure duration and the current gain of the short frame at the second maximum shooting brightness is determined. It is then determined whether this SNR is the fourth target SNR. If the SNR is not the fourth target SNR, the exposure duration of the short frame is adjusted according to the second time step until the determined SNR is the fourth target SNR. After the determined SNR is the fourth target SNR, the electronic device can determine the exposure ratio based on the adjusted exposure duration, the current gain of the short frame, the second exposure duration of the medium frame, and the second gain. It is then determined whether this exposure ratio is the second exposure ratio. If the exposure ratio is the second exposure ratio, the condition is met. If the exposure ratio is not the second exposure ratio, the gain of the short frame needs to be increased. In one example, the gain of the short frame can be adjusted according to a preset second gain step, and this process can be repeated.

[0115] The exposure duration and gain when the conditions are met are determined as the third exposure duration and third gain for short frames.

[0116] In this embodiment, the dynamic range of the shooting scene is achieved by adjusting the exposure duration and gain of the three wide dynamic range frames, while keeping the signal-to-noise ratio drop between the three frames within a small range.

[0117] Example 6:

[0118] To improve image quality, based on the above embodiments, in this embodiment of the application, determining the first maximum shooting brightness of the long frame includes:

[0119] Gradually increase the brightness of the light and record the output value of the sensor of the acquisition device under each light intensity.

[0120] The brightness at which the output value reaches the preset value is determined as the first maximum shooting brightness.

[0121] In this embodiment, the electronic device can gradually increase the ambient light intensity through a controllable light source system, while continuously acquiring the output signal of the sensor at a fixed frame rate to ensure that sufficient samples are collected at each brightness level to eliminate the influence of random noise. When the digital signal value output by the sensor reaches a preset value for the first time, which is the upper limit threshold of the dynamic range, the electronic device records the current light intensity value as the first maximum shooting brightness. This brightness value not only ensures that the signal is not saturated and truncated, but also provides a critical reference benchmark for subsequent exposure parameter optimization.

[0122] To improve image quality, based on the above embodiments, in this embodiment, determining the scene dynamic value according to the ratio of the first average value to the second average value includes:

[0123] The ratio of the first average value to the second average value is determined as the first dynamic value of the image; and the second dynamic value of the previous frame of the image is determined.

[0124] The scene dynamic value is determined based on the first dynamic value, the second dynamic value, and the preset weight.

[0125] To improve the accuracy of scene dynamic value determination, electronic devices can also determine the dynamic value of the previous frame of the image and the dynamic value of the current image, thereby determining the scene dynamic value.

[0126] In one example, the electronic device can determine a first dynamic value of the image by the ratio of a first average value and a second average value. It can also determine a second dynamic value of the previous frame of the image, wherein the electronic device can determine a third average value of the brightness of pixels in each bright area of ​​the previous frame and a fourth average value of the brightness of pixels in each dark area of ​​the previous frame, and determine the second dynamic value by the ratio of the third average value to the fourth average value.

[0127] The electronic device can determine the scene dynamic value based on the first dynamic value, the second dynamic value, and their corresponding weights. In one example, the weights corresponding to the first dynamic value and the second dynamic value can both be 0.5.

[0128] To improve image quality, based on the above embodiments, in this embodiment, determining bright and dark areas based on the brightness value of each pixel includes:

[0129] For each block, determine the average brightness value of each pixel in that block;

[0130] Determine the minimum and maximum average brightness values ​​for each block;

[0131] The product of the minimum average brightness value and a first preset value is determined as the dark block threshold, wherein the first preset value is greater than 1; the product of the maximum average brightness value and a second preset value is determined as the bright block threshold, wherein the second preset value is less than 1.

[0132] Blocks with an average brightness value less than the dark block threshold are identified as dark blocks; blocks with an average brightness value greater than the bright block threshold are identified as bright blocks.

[0133] In this embodiment, the electronic device can determine the average brightness value of each pixel in each block. The average brightness values ​​of each block are sorted to determine the minimum and maximum average brightness values ​​for each block. Bright block thresholds and dark block thresholds are then determined based on the minimum and maximum average brightness values. In one example, the electronic device can determine the dark block threshold by multiplying the minimum average brightness value by a first preset value, wherein the first preset value is greater than 1. In one example, the first preset value is less than 1.5. The electronic device can also determine the bright block threshold by multiplying the maximum average brightness value by a second preset value, wherein the second preset value is less than 1. In one example, the second preset value is greater than 0.5.

[0134] Electronic devices can identify blocks with average brightness values ​​less than the dark block threshold as dark blocks, and blocks with average brightness values ​​greater than the bright block threshold as bright blocks.

[0135] Example 7:

[0136] Figure 3 This is a schematic diagram of an image acquisition device provided in an embodiment of this application. The device includes:

[0137] The acquisition and determination module 301 is used to acquire an image of the shooting scene, divide the image into a preset number of blocks; determine bright blocks and dark blocks according to the brightness value of each pixel; determine a first average brightness of pixels in each bright block and a second average brightness of pixels in each dark block; and determine scene dynamic values ​​according to the ratio of the first average value to the second average value.

[0138] The processing module 302 is used to determine the first exposure ratio of the long frame and the medium frame, and the second exposure ratio of the medium frame and the short frame, which are saved for the scene dynamic values; and to determine the exposure duration and gain saved for the preset target brightness as the first exposure duration and the first gain of the long frame, and to adjust the exposure duration and gain of the medium frame according to the preset first step length until the determined exposure ratio is the first exposure ratio; to adjust the exposure duration and gain of the short frame according to the preset second step length until the determined exposure ratio is the second exposure ratio; and to acquire images based on the determined exposure duration and gain of the long frame, medium frame and short frame.

[0139] Furthermore, the processing module 302 is also used to adjust the exposure duration and gain of the long frame to the first exposure duration and the first gain, determine the first maximum shooting brightness of the long frame; calculate the first target signal-to-noise ratio of the long frame under the first maximum shooting brightness; and determine the second target signal-to-noise ratio based on the first target signal-to-noise ratio and a pre-saved signal-to-noise ratio drop threshold.

[0140] The processing module 302 is specifically used to adjust the exposure duration and gain of the middle frame according to the preset first step length, until the signal-to-noise ratio determined under the first maximum shooting brightness according to the adjusted second exposure duration and second gain is the second target signal-to-noise ratio, and the exposure ratio determined according to the adjusted second exposure duration, second gain, first exposure duration and first gain is the first exposure ratio.

[0141] Further, the processing module 302 is specifically used to determine the gain of the mid-frame as the minimum mid-frame gain; repeat the following steps until the condition is met: adjust the exposure duration of the mid-frame according to the first duration step size in the preset first step length until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the mid-frame under the first maximum shooting brightness is the second target signal-to-noise ratio; determine whether the exposure ratio determined according to the adjusted exposure duration and the current gain of the mid-frame, the first exposure duration and the first gain is the first exposure ratio; if yes, it is determined that the condition is met; if no, the gain of the mid-frame is adjusted according to the first gain step size in the preset first step length; and determine the exposure duration and gain when the condition is met as the second exposure duration and the second gain of the mid-frame.

[0142] Furthermore, the processing module 302 is also used to adjust the exposure duration and gain of the mid-frame to the second exposure duration and the second gain, determine the second maximum shooting brightness of the mid-frame; calculate the third target signal-to-noise ratio of the mid-frame under the second maximum shooting brightness; and determine the fourth target signal-to-noise ratio based on the third target signal-to-noise ratio and a pre-stored signal-to-noise ratio drop threshold.

[0143] The processing module 302 is specifically used to adjust the exposure duration and gain of the middle frame according to a preset second step size, until the signal-to-noise ratio determined under the second maximum shooting brightness based on the adjusted third exposure duration and third gain is the fourth target signal-to-noise ratio, and the exposure ratio determined based on the adjusted third exposure duration, third gain, second exposure duration and second gain is the second exposure ratio.

[0144] Further, the processing module 302 is specifically used to determine the gain of the short frame as the minimum short frame gain; repeat the following steps until the condition is met: adjust the exposure duration of the short frame according to the second duration step size in the preset second step size until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the short frame under the second maximum shooting brightness is the fourth target signal-to-noise ratio; determine whether the exposure ratio determined according to the adjusted exposure duration and the current gain of the short frame, the second exposure duration and the second gain is the second exposure ratio; if yes, it is determined that the condition is met; if no, the gain of the short frame is adjusted according to the second gain step size in the preset second step size; and determine the exposure duration and gain when the condition is met as the third exposure duration and the third gain.

[0145] Furthermore, the processing module 302 is specifically used to gradually increase the brightness of the illumination, record the output value of the sensor of the acquisition device under each illumination level, and determine the brightness when the output value reaches a preset value as the first maximum shooting brightness.

[0146] Furthermore, the acquisition and determination module 301 is specifically used to determine the ratio of the first average value to the second average value as the first dynamic value of the image; and to determine the second dynamic value of the previous frame of the image; and to determine the scene dynamic value based on the first dynamic value, the second dynamic value and a preset weight.

[0147] Further, the acquisition and determination module 301 is specifically used to: determine the average brightness value of each pixel in each block; determine the minimum average brightness value and the maximum average brightness value of each block; determine the product of the minimum average brightness value and a first preset value as a dark block threshold, wherein the first preset value is greater than 1; determine the product of the maximum average brightness value and a second preset value as a bright block threshold, wherein the second preset value is less than 1; determine blocks with average brightness values ​​less than the dark block threshold as dark blocks; and determine blocks with average brightness values ​​greater than the bright block threshold as bright blocks.

[0148] Example 8:

[0149] Figure 4 This application provides a schematic diagram of an electronic device structure based on an embodiment of the present application. In addition to the above embodiments, this application also provides an electronic device, such as... Figure 4 As shown, it includes: processor 401, communication interface 402, memory 403 and communication bus 404, wherein processor 401, communication interface 402 and memory 403 communicate with each other through communication bus 404.

[0150] The memory 403 stores a computer program, which, when executed by the processor 401, causes the processor 401 to perform the following steps:

[0151] Acquire an image of the shooting scene and divide the image into a preset number of blocks; determine bright blocks and dark blocks based on the brightness value of each pixel; determine a first average brightness of pixels in each bright block and a second average brightness of pixels in each dark block; and determine the scene dynamic value based on the ratio of the first average to the second average.

[0152] Determine the first exposure ratio between long frames and medium frames, and the second exposure ratio between medium frames and short frames, for the dynamic values ​​of the scene; and determine the exposure duration and gain for the preset target brightness as the first exposure duration and first gain of the long frames, and adjust the exposure duration and gain of the medium frames according to the preset first step length until the determined exposure ratio is the first exposure ratio; adjust the exposure duration and gain of the short frames according to the preset second step length until the determined exposure ratio is the second exposure ratio;

[0153] Acquire images based on determined exposure durations and gain for long, medium, and short frames.

[0154] In one possible implementation, after determining the exposure duration and gain stored for a preset target brightness as the first exposure duration and first gain of the long frame, the method further includes adjusting the exposure duration and gain of the medium frame according to a preset first step length until the determined exposure ratio is the first exposure ratio:

[0155] The exposure time and gain of the long frame are adjusted to the first exposure time and the first gain to determine the first maximum shooting brightness of the long frame; the first target signal-to-noise ratio of the long frame under the first maximum shooting brightness is calculated; and the second target signal-to-noise ratio is determined based on the first target signal-to-noise ratio and a pre-saved signal-to-noise ratio drop threshold.

[0156] The exposure duration and gain of the intermediate frames are adjusted according to the preset first step length until the determined exposure ratio is the first exposure ratio:

[0157] The exposure time and gain of the frame are adjusted according to the preset first step length adjustment until the signal-to-noise ratio determined under the first maximum shooting brightness based on the adjusted second exposure time and second gain is the second target signal-to-noise ratio, and the exposure ratio determined based on the adjusted second exposure time, second gain, first exposure time and first gain is the first exposure ratio.

[0158] In one possible implementation, the step of adjusting the exposure duration and gain of the intermediate frame according to a preset first-step length until the signal-to-noise ratio determined under the first maximum shooting brightness based on the adjusted second exposure duration and second gain is the second target signal-to-noise ratio, and the exposure ratio determined based on the adjusted second exposure duration, second gain, first exposure duration, and first gain is the first exposure ratio, includes:

[0159] The gain of the mid-frame is determined to be the minimum mid-frame gain;

[0160] Repeat the following steps until the condition is met:

[0161] The exposure duration of the intermediate frame is adjusted according to the first duration step size in the preset first step length until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the intermediate frame under the first maximum shooting brightness is the second target signal-to-noise ratio. It is then determined whether the exposure ratio determined by the adjusted exposure duration and the current gain of the intermediate frame, the first exposure duration and the first gain is the first exposure ratio. If yes, the condition is satisfied. If no, the gain of the intermediate frame is adjusted according to the first gain step size in the preset first step length.

[0162] The exposure duration and gain when the conditions are met are determined as the second exposure duration and second gain for the medium frame.

[0163] In one possible implementation, after adjusting the exposure duration and gain of the middle frame according to a preset step size until the determined exposure ratio is the first exposure ratio, and before adjusting the exposure duration and gain of the short frame according to a preset second step size until the determined exposure ratio is the second exposure ratio, the method further includes:

[0164] The exposure time and gain of the mid-frame are adjusted to the second exposure time and the second gain to determine the second maximum shooting brightness of the mid-frame; the third target signal-to-noise ratio of the mid-frame under the second maximum shooting brightness is calculated; and the fourth target signal-to-noise ratio is determined based on the third target signal-to-noise ratio and the pre-saved signal-to-noise ratio drop threshold.

[0165] The step of adjusting the exposure duration and gain of the short frame according to the preset second step size until the determined exposure ratio is the second exposure ratio includes:

[0166] The exposure duration and gain of the short frame are adjusted according to the preset second step length until the signal-to-noise ratio determined under the second maximum shooting brightness based on the adjusted third exposure duration and third gain is the fourth target signal-to-noise ratio, and the exposure ratio determined based on the adjusted third exposure duration, third gain, second exposure duration and second gain is the second exposure ratio.

[0167] In one possible implementation, the step of adjusting the exposure duration and gain of the short frame according to a preset second step size until the signal-to-noise ratio determined based on the adjusted third exposure duration and third gain at the second maximum shooting brightness is the fourth target signal-to-noise ratio, and the exposure ratio determined based on the adjusted third exposure duration, third gain, second exposure duration, and second gain is the second exposure ratio, includes:

[0168] The gain of the short frame is determined as the minimum short frame gain;

[0169] Repeat the following steps until the condition is met:

[0170] The exposure duration of the short frame is adjusted according to the second duration step size in the preset second step size until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the short frame under the second maximum shooting brightness is the fourth target signal-to-noise ratio; it is determined whether the exposure ratio determined by the adjusted exposure duration and the current gain of the short frame, the second exposure duration and the second gain is the second exposure ratio. If yes, it is determined that the condition is met. If not, the gain of the short frame is adjusted according to the second gain step size in the preset second step size.

[0171] The exposure duration and gain that meet the conditions are determined as the third exposure duration and the third gain.

[0172] In one possible implementation, determining the first maximum shooting brightness of the long frame includes:

[0173] Gradually increase the brightness of the light and record the output value of the sensor of the acquisition device under each light intensity.

[0174] The brightness at which the output value reaches the preset value is determined as the first maximum shooting brightness.

[0175] In one possible implementation, determining the scene dynamic value based on the ratio of the first average value to the second average value includes:

[0176] The ratio of the first average value to the second average value is determined as the first dynamic value of the image; and the second dynamic value of the previous frame of the image is determined.

[0177] The scene dynamic value is determined based on the first dynamic value, the second dynamic value, and the preset weight.

[0178] In one possible implementation, determining bright and dark areas based on the brightness value of each pixel includes:

[0179] For each block, determine the average brightness value of each pixel in that block;

[0180] Determine the minimum and maximum average brightness values ​​for each block;

[0181] The product of the minimum average brightness value and a first preset value is determined as the dark block threshold, wherein the first preset value is greater than 1; the product of the maximum average brightness value and a second preset value is determined as the bright block threshold, wherein the second preset value is less than 1.

[0182] Blocks with an average brightness value less than the dark block threshold are identified as dark blocks; blocks with an average brightness value greater than the bright block threshold are identified as bright blocks.

[0183] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0184] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0185] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0186] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0187] Example 9:

[0188] Based on the above embodiments, this application also provides a computer-readable storage medium storing a computer program executable by an electronic device. When the program is run on the electronic device, the electronic device performs the following steps:

[0189] The memory stores a computer program that, when executed by the processor, causes the processor to perform the following steps:

[0190] Acquire an image of the shooting scene and divide the image into a preset number of blocks; determine bright blocks and dark blocks based on the brightness value of each pixel; determine a first average brightness of pixels in each bright block and a second average brightness of pixels in each dark block; and determine the scene dynamic value based on the ratio of the first average to the second average.

[0191] Determine the first exposure ratio between long frames and medium frames, and the second exposure ratio between medium frames and short frames, for the dynamic values ​​of the scene; and determine the exposure duration and gain for the preset target brightness as the first exposure duration and first gain of the long frames, and adjust the exposure duration and gain of the medium frames according to the preset first step length until the determined exposure ratio is the first exposure ratio; adjust the exposure duration and gain of the short frames according to the preset second step length until the determined exposure ratio is the second exposure ratio;

[0192] Acquire images based on determined exposure durations and gain for long, medium, and short frames.

[0193] In one possible implementation, after determining the exposure duration and gain stored for a preset target brightness as the first exposure duration and first gain of the long frame, the method further includes adjusting the exposure duration and gain of the medium frame according to a preset first step length until the determined exposure ratio is the first exposure ratio:

[0194] The exposure time and gain of the long frame are adjusted to the first exposure time and the first gain to determine the first maximum shooting brightness of the long frame; the first target signal-to-noise ratio of the long frame under the first maximum shooting brightness is calculated; and the second target signal-to-noise ratio is determined based on the first target signal-to-noise ratio and a pre-saved signal-to-noise ratio drop threshold.

[0195] The exposure duration and gain of the intermediate frames are adjusted according to the preset first step length until the determined exposure ratio is the first exposure ratio:

[0196] The exposure time and gain of the frame are adjusted according to the preset first step length adjustment until the signal-to-noise ratio determined under the first maximum shooting brightness based on the adjusted second exposure time and second gain is the second target signal-to-noise ratio, and the exposure ratio determined based on the adjusted second exposure time, second gain, first exposure time and first gain is the first exposure ratio.

[0197] In one possible implementation, the step of adjusting the exposure duration and gain of the intermediate frame according to a preset first-step length until the signal-to-noise ratio determined under the first maximum shooting brightness based on the adjusted second exposure duration and second gain is the second target signal-to-noise ratio, and the exposure ratio determined based on the adjusted second exposure duration, second gain, first exposure duration, and first gain is the first exposure ratio, includes:

[0198] The gain of the mid-frame is determined to be the minimum mid-frame gain;

[0199] Repeat the following steps until the condition is met:

[0200] The exposure duration of the intermediate frame is adjusted according to the first duration step size in the preset first step length until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the intermediate frame under the first maximum shooting brightness is the second target signal-to-noise ratio. It is then determined whether the exposure ratio determined by the adjusted exposure duration and the current gain of the intermediate frame, the first exposure duration and the first gain is the first exposure ratio. If yes, the condition is satisfied. If no, the gain of the intermediate frame is adjusted according to the first gain step size in the preset first step length.

[0201] The exposure duration and gain when the conditions are met are determined as the second exposure duration and second gain for the medium frame.

[0202] In one possible implementation, after adjusting the exposure duration and gain of the middle frame according to a preset step size until the determined exposure ratio is the first exposure ratio, and before adjusting the exposure duration and gain of the short frame according to a preset second step size until the determined exposure ratio is the second exposure ratio, the method further includes:

[0203] The exposure time and gain of the mid-frame are adjusted to the second exposure time and the second gain to determine the second maximum shooting brightness of the mid-frame; the third target signal-to-noise ratio of the mid-frame under the second maximum shooting brightness is calculated; and the fourth target signal-to-noise ratio is determined based on the third target signal-to-noise ratio and the pre-saved signal-to-noise ratio drop threshold.

[0204] The step of adjusting the exposure duration and gain of the short frame according to the preset second step size until the determined exposure ratio is the second exposure ratio includes:

[0205] The exposure duration and gain of the short frame are adjusted according to the preset second step length until the signal-to-noise ratio determined under the second maximum shooting brightness based on the adjusted third exposure duration and third gain is the fourth target signal-to-noise ratio, and the exposure ratio determined based on the adjusted third exposure duration, third gain, second exposure duration and second gain is the second exposure ratio.

[0206] In one possible implementation, the step of adjusting the exposure duration and gain of the short frame according to a preset second step size until the signal-to-noise ratio determined based on the adjusted third exposure duration and third gain at the second maximum shooting brightness is the fourth target signal-to-noise ratio, and the exposure ratio determined based on the adjusted third exposure duration, third gain, second exposure duration, and second gain is the second exposure ratio, includes:

[0207] The gain of the short frame is determined as the minimum short frame gain;

[0208] Repeat the following steps until the condition is met:

[0209] The exposure duration of the short frame is adjusted according to the second duration step size in the preset second step size until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the short frame under the second maximum shooting brightness is the fourth target signal-to-noise ratio; it is determined whether the exposure ratio determined by the adjusted exposure duration and the current gain of the short frame, the second exposure duration and the second gain is the second exposure ratio. If yes, it is determined that the condition is met. If not, the gain of the short frame is adjusted according to the second gain step size in the preset second step size.

[0210] The exposure duration and gain that meet the conditions are determined as the third exposure duration and the third gain.

[0211] In one possible implementation, determining the first maximum shooting brightness of the long frame includes:

[0212] Gradually increase the brightness of the light and record the output value of the sensor of the acquisition device under each light intensity.

[0213] The brightness at which the output value reaches the preset value is determined as the first maximum shooting brightness.

[0214] In one possible implementation, determining the scene dynamic value based on the ratio of the first average value to the second average value includes:

[0215] The ratio of the first average value to the second average value is determined as the first dynamic value of the image; and the second dynamic value of the previous frame of the image is determined.

[0216] The scene dynamic value is determined based on the first dynamic value, the second dynamic value, and the preset weight.

[0217] In one possible implementation, determining bright and dark areas based on the brightness value of each pixel includes:

[0218] For each block, determine the average brightness value of each pixel in that block;

[0219] Determine the minimum and maximum average brightness values ​​for each block;

[0220] The product of the minimum average brightness value and a first preset value is determined as the dark block threshold, wherein the first preset value is greater than 1; the product of the maximum average brightness value and a second preset value is determined as the bright block threshold, wherein the second preset value is less than 1.

[0221] Blocks with an average brightness value less than the dark block threshold are identified as dark blocks; blocks with an average brightness value greater than the bright block threshold are identified as bright blocks.

[0222] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0223] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0224] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0225] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxesFigure 1 The steps of the function specified in one or more boxes.

[0226] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. An image acquisition method, characterized in that, The method includes: Acquire an image of the shooting scene and divide the image into a preset number of blocks; determine bright blocks and dark blocks based on the brightness value of each pixel; determine a first average brightness of pixels in each bright block and a second average brightness of pixels in each dark block; and determine the scene dynamic value based on the ratio of the first average to the second average. Determine the first exposure ratio between long frames and medium frames, and the second exposure ratio between medium frames and short frames, for the dynamic values ​​of the scene; and determine the exposure duration and gain for the preset target brightness as the first exposure duration and first gain of the long frames, and adjust the exposure duration and gain of the medium frames according to the preset first step length until the determined exposure ratio is the first exposure ratio; adjust the exposure duration and gain of the short frames according to the preset second step length until the determined exposure ratio is the second exposure ratio; Acquire images based on determined exposure durations and gain for long, medium, and short frames.

2. The method according to claim 1, characterized in that, After determining the exposure duration and gain saved for the preset target brightness as the first exposure duration and first gain of the long frame, the method further includes adjusting the exposure duration and gain of the medium frame according to the preset first step length until the determined exposure ratio is the first exposure ratio. The exposure time and gain of the long frame are adjusted to the first exposure time and the first gain to determine the first maximum shooting brightness of the long frame; the first target signal-to-noise ratio of the long frame under the first maximum shooting brightness is calculated; and the second target signal-to-noise ratio is determined based on the first target signal-to-noise ratio and a pre-saved signal-to-noise ratio drop threshold. The exposure duration and gain of the intermediate frames are adjusted according to the preset first step length until the determined exposure ratio is the first exposure ratio: The exposure time and gain of the frame are adjusted according to the preset first step length adjustment until the signal-to-noise ratio determined under the first maximum shooting brightness based on the adjusted second exposure time and second gain is the second target signal-to-noise ratio, and the exposure ratio determined based on the adjusted second exposure time, second gain, first exposure time and first gain is the first exposure ratio.

3. The method according to claim 2, characterized in that, The step of adjusting the exposure duration and gain of the intermediate frame according to the preset first step length until the signal-to-noise ratio determined under the first maximum shooting brightness based on the adjusted second exposure duration and second gain is the second target signal-to-noise ratio, and the exposure ratio determined based on the adjusted second exposure duration, second gain, first exposure duration, and first gain is the first exposure ratio, includes: The gain of the mid-frame is determined to be the minimum mid-frame gain; Repeat the following steps until the condition is met: The exposure duration of the intermediate frame is adjusted according to the first duration step size in the preset first step length until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the intermediate frame under the first maximum shooting brightness is the second target signal-to-noise ratio. It is then determined whether the exposure ratio determined by the adjusted exposure duration and the current gain of the intermediate frame, the first exposure duration and the first gain is the first exposure ratio. If yes, the condition is satisfied. If no, the gain of the intermediate frame is adjusted according to the first gain step size in the preset first step length. The exposure duration and gain when the conditions are met are determined as the second exposure duration and second gain for the medium frame.

4. The method according to claim 2 or 3, characterized in that, After adjusting the exposure duration and gain of the middle frame according to a preset step size until the determined exposure ratio is the first exposure ratio, and before adjusting the exposure duration and gain of the short frame according to a preset second step size until the determined exposure ratio is the second exposure ratio, the method further includes: The exposure time and gain of the mid-frame are adjusted to the second exposure time and the second gain to determine the second maximum shooting brightness of the mid-frame; the third target signal-to-noise ratio of the mid-frame under the second maximum shooting brightness is calculated; and the fourth target signal-to-noise ratio is determined based on the third target signal-to-noise ratio and the pre-saved signal-to-noise ratio drop threshold. The step of adjusting the exposure duration and gain of the short frame according to the preset second step size until the determined exposure ratio is the second exposure ratio includes: The exposure duration and gain of the short frame are adjusted according to the preset second step length until the signal-to-noise ratio determined under the second maximum shooting brightness based on the adjusted third exposure duration and third gain is the fourth target signal-to-noise ratio, and the exposure ratio determined based on the adjusted third exposure duration, third gain, second exposure duration and second gain is the second exposure ratio.

5. The method according to claim 4, characterized in that, The step of adjusting the exposure duration and gain of short frames according to a preset second step size until the signal-to-noise ratio determined under the second maximum shooting brightness based on the adjusted third exposure duration and third gain is the fourth target signal-to-noise ratio, and the exposure ratio determined based on the adjusted third exposure duration, third gain, second exposure duration, and second gain is the second exposure ratio, includes: The gain of the short frame is determined as the minimum short frame gain; Repeat the following steps until the condition is met: The exposure duration of the short frame is adjusted according to the second duration step size in the preset second step size until the signal-to-noise ratio determined by the adjusted exposure duration and the current gain of the short frame under the second maximum shooting brightness is the fourth target signal-to-noise ratio; it is determined whether the exposure ratio determined by the adjusted exposure duration and the current gain of the short frame, the second exposure duration and the second gain is the second exposure ratio. If yes, it is determined that the condition is met. If not, the gain of the short frame is adjusted according to the second gain step size in the preset second step size. The exposure duration and gain that meet the conditions are determined as the third exposure duration and the third gain.

6. The method according to claim 2, characterized in that, Determining the first maximum shooting brightness of the long frame includes: Gradually increase the brightness of the light and record the output value of the sensor of the acquisition device under each light intensity. The brightness at which the output value reaches the preset value is determined as the first maximum shooting brightness.

7. The method according to claim 1, characterized in that, Determining the scene dynamic value based on the ratio of the first average value to the second average value includes: The ratio of the first average value to the second average value is determined as the first dynamic value of the image; and the second dynamic value of the previous frame of the image is determined. The scene dynamic value is determined based on the first dynamic value, the second dynamic value, and the preset weight.

8. The method according to claim 1, characterized in that, The step of determining bright and dark areas based on the brightness value of each pixel includes: For each block, determine the average brightness value of each pixel in that block; Determine the minimum and maximum average brightness values ​​for each block; The product of the minimum average brightness value and a first preset value is determined as the dark block threshold, wherein the first preset value is greater than 1; the product of the maximum average brightness value and a second preset value is determined as the bright block threshold, wherein the second preset value is less than 1. Blocks with an average brightness value less than the dark block threshold are identified as dark blocks; blocks with an average brightness value greater than the bright block threshold are identified as bright blocks.

9. An image acquisition device, characterized in that, The device includes: The acquisition and determination module is used to acquire an image of the shooting scene, divide the image into a preset number of blocks; determine bright blocks and dark blocks according to the brightness value of each pixel; determine a first average brightness of pixels in each bright block and a second average brightness of pixels in each dark block; and determine scene dynamic values ​​according to the ratio of the first average value to the second average value. The processing module is used to determine the first exposure ratio of long frames and medium frames saved for the scene dynamic values, and the second exposure ratio of medium frames and short frames; and to determine the exposure duration and gain saved for a preset target brightness as the first exposure duration and first gain of the long frames, and to adjust the exposure duration and gain of the medium frames according to a preset first step length until the determined exposure ratio is the first exposure ratio; to adjust the exposure duration and gain of the short frames according to a preset second step length until the determined exposure ratio is the second exposure ratio; and to acquire images based on the determined exposure duration and gain of the long frames, medium frames, and short frames.

10. An electronic device, characterized in that, The electronic device includes at least a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the steps of the image acquisition method as described in any one of claims 1-8.