Image acquisition method and device, electronic equipment and computer readable storage medium

By setting the exposure time to an integer multiple of the light source's power frequency cycle when flicker is detected, and by adjusting the transmittance using an electrochromic layer, the image quality problem caused by flicker is solved, achieving efficient flicker elimination and preservation of subject sharpness.

CN121908145APending Publication Date: 2026-04-21LUXSHARE PRECISION TECH(NANJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LUXSHARE PRECISION TECH(NANJING) CO LTD
Filing Date
2025-12-18
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In existing technologies, in order to solve the image quality degradation caused by flickering, the exposure time is usually extended to an integer multiple of the power frequency cycle of the artificial light source. However, this leads to overexposure or underexposure, affecting image quality.

Method used

When flicker is detected, the exposure time is set to an integer multiple of the light source's power frequency cycle, and the transmittance is adjusted through the color-changing area in the electrochromic layer. The target transmittance is determined based on the degree of flicker and the probability of the subject, thus balancing flicker elimination with subject sharpness.

Benefits of technology

It effectively eliminates flickering and avoids image quality degradation caused by exposure time adjustment, thus achieving high-quality image acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121908145A_ABST
    Figure CN121908145A_ABST
Patent Text Reader

Abstract

According to the image acquisition method and device, the electronic equipment and the computer readable storage medium provided by the embodiment of the invention, if it is detected that stroboflash exists in the acquired image, the power frequency period of the light source is acquired, and the optional value of the exposure time in the target image acquisition parameters is set as the integral multiple of the power frequency period of the light source; determining the stroboscopic degree and the subject probability of each unit area in the acquired image; for each unit area, calculating a target light transmittance corresponding to the stroboscopic degree and the subject probability; and setting each color changing area in the electrochromic layer to be the target light transmittance of the corresponding unit area. When the stroboscopic phenomenon is detected, the exposure time is limited to be the integral multiple of the power frequency period of the light source, so that the stroboscopic phenomenon is eliminated, and the light transmittance of the corresponding color changing area is specifically determined according to the stroboscopic degree and the subject probability of the specific unit area in the image acquisition parameters. And the reduction of image quality caused by exposure time adjustment is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image acquisition, and more particularly to an image acquisition method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] Because the power frequency of artificial light sources causes flickering, the light energy received by the sensor during different exposures is different when acquiring images under artificial light, resulting in flickering in the acquired images. In the existing technology, in order to solve this problem, the exposure time is extended to an integer multiple of the power frequency period of the artificial light source. However, this operation can lead to overexposure or underexposure, affecting the final image quality. Summary of the Invention

[0003] The main objective of this invention is to provide an image acquisition method, device, electronic device, and computer-readable storage medium, aiming to solve the problem of image quality degradation caused by flickering in the prior art.

[0004] To achieve the above objectives, the present invention provides an image acquisition method, the image acquisition method comprising: If flicker is detected in the acquired image, the power frequency period of the light source is obtained, and the optional value of the exposure time in the target image acquisition parameters is set to an integer multiple of the power frequency period of the light source; Determine the flicker level and subject probability of each unit region in the acquired image, wherein the acquired image is divided into multiple unit regions; For each of the aforementioned unit regions, the target transmittance corresponding to the flicker level and the subject probability is calculated, wherein the flicker level is negatively correlated with the target transmittance, and the subject probability is positively correlated with the target transmittance; Each color-changing region in the electrochromic layer is set to the target transmittance of the corresponding unit region.

[0005] Optionally, calculating the target transmittance corresponding to the flicker level and the subject probability includes: Obtain the first weight corresponding to the flicker level and the second weight corresponding to the subject probability, wherein the sum of the first weight and the second weight is 1; Calculate the weight difference between the flicker level weighted with a first weight and the subject probability weighted with a second weight; The target transmittance of the unit region is determined based on the weighted difference, and the weighted difference is negatively correlated with the target transmittance.

[0006] Optionally, determining the target transmittance of the unit region based on the weighted difference, wherein the weighted difference is negatively correlated with the target transmittance, includes: Obtain the weight difference corresponding to all the said unit regions; The light transmittance weight corresponding to each weight difference is obtained by normalizing the weight difference. For each of the aforementioned unit regions, the target transmittance corresponding to the transmittance weight is matched, wherein the transmittance weight is negatively correlated with the target transmittance.

[0007] Optionally, setting each color-changing region in the electrochromic layer to the target transmittance of the corresponding unit region includes: Obtain the optimized image acquired at the target transmittance; Obtain the flicker suppression rate and the main signal-to-noise ratio in the optimized acquired image; Calculate the optimization evaluation value corresponding to the optimized acquired image based on the flicker suppression rate and the main signal-to-noise ratio; The first weight and the second weight are updated based on the optimized evaluation value; The target transmittance is updated based on the updated first weight and the second weight.

[0008] Optionally, obtaining the flicker suppression rate and the main signal-to-noise ratio in the optimized acquired image includes: In the optimized acquired image, a flicker region and a main body region are determined, wherein the flicker region is a unit region in the optimized acquired image where the flicker level reaches a preset flicker threshold, and the main body region is a unit region in the optimized acquired image where the probability of the main body is greater than a preset main body threshold; Calculate the mean luminance variance of the flicker region and determine the flicker suppression rate that is negatively correlated with the mean luminance variance. The signal-to-noise ratio of the main body is obtained by calculating the mean signal-to-noise ratio of the main body region.

[0009] Optionally, updating the first weight and the second weight based on the optimized evaluation value includes: Determine the multiple optimization evaluation values ​​collected within the current time window; Calculate the difference in evaluation values ​​between any two adjacent optimized evaluation values; Determine whether the difference between all the evaluation values ​​is less than a preset evaluation threshold; If the difference between all the evaluation values ​​is less than the preset evaluation threshold, then the currently set first weight and second weight remain unchanged; If any of the evaluation values ​​differs from the preset evaluation threshold, the first weight and the second weight are updated based on the optimized evaluation value.

[0010] Optionally, updating the first weight and the second weight based on the optimized evaluation value includes: Obtain the previous optimization evaluation value and the current maximum optimization evaluation value corresponding to the previously optimized image; Determine whether the previous optimization evaluation value is greater than the current maximum optimization evaluation value; If the previous optimization evaluation value is greater than the current maximum optimization evaluation value, then determine the previous first weight corresponding to the previous optimization evaluation value, and the weight adjustment direction corresponding to the previous first weight; Obtain a preset perturbation value, and adjust the previous first weight according to the weight adjustment direction to obtain the updated first weight; Determine the second weight corresponding to the first weight.

[0011] To achieve the above objectives, the present invention also provides an image acquisition device, the image acquisition device comprising: The first acquisition module is used to acquire the power frequency period of the light source if flicker is detected in the acquired image, and set the optional value of the exposure time in the target image acquisition parameters to an integer multiple of the power frequency period of the light source; The first determining module is used to determine the flicker level and subject probability of each unit region in the acquired image, wherein the acquired image is divided into multiple unit regions; The first calculation module is used to calculate the target transmittance corresponding to the flicker level and the subject probability for each of the unit regions, wherein the flicker level is negatively correlated with the target transmittance, and the subject probability is positively correlated with the target transmittance; The first setting module is used to set each color-changing region in the electrochromic layer to the target transmittance of the corresponding unit region.

[0012] To achieve the above objectives, the present invention also provides an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the image acquisition method as described above.

[0013] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the image acquisition method described above.

[0014] This invention proposes an image acquisition method, apparatus, electronic device, and computer-readable storage medium. If flicker is detected in the acquired image, the system obtains the power frequency period of the light source and sets the optional value of the exposure time in the target image acquisition parameters to an integer multiple of the power frequency period of the light source. It determines the flicker level and subject probability of each unit region in the acquired image, wherein the acquired image is divided into multiple unit regions. For each unit region, it calculates the target transmittance corresponding to the flicker level and subject probability, wherein the flicker level is negatively correlated with the target transmittance, and the subject probability is positively correlated with the target transmittance. Finally, it sets each color-changing region in the electrochromic layer as the target transmittance of the corresponding unit region. By limiting the exposure time to an integer multiple of the light source's power frequency cycle when flicker is detected, flicker can be eliminated. By setting an electrochromic layer to reduce the amount of transmitted light, overexposure caused by increased exposure time can be eliminated. At the same time, the transmittance of the corresponding electrochromic region is specifically determined by the flicker level and subject probability of specific unit regions in the image acquisition parameters. This allows different unit regions to balance flicker elimination and subject clarity based on actual needs, avoiding image quality degradation due to exposure time adjustment. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the first embodiment of the image acquisition method of the present invention; Figure 2 This is a schematic diagram of the module structure of the electronic device of the present invention. Detailed Implementation

[0018] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0019] This invention provides an image acquisition method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the image acquisition method of the present invention. The method includes the following steps: Step S10: If flicker is detected in the acquired image, the power frequency period of the light source is obtained, and the optional value of the exposure time in the target image acquisition parameters is set to an integer multiple of the power frequency period of the light source. The acquired image is the image obtained by the image acquisition device during image acquisition. It should be noted that, in order to improve the efficiency of eliminating flicker, the acquired image can be a preview image acquired in real time by the image acquisition device. Flicker detection is achieved through the preview image, so that when the shooting operation is performed to obtain the output image, the target image acquisition parameters can be applied to acquire the image to be output, thereby eliminating flicker.

[0020] The power frequency period of the light source is the power frequency period of the light source in the image acquisition environment. The power frequency period of the light source depends on the power frequency of the light source. For example, if the power frequency in China is 50Hz, the corresponding power frequency period of the light source is 1000÷50÷2=10ms. For another example, if the power frequency in Japan is 60Hz, the corresponding power frequency period of the light source is 1000÷60÷2≈8.333ms. The following embodiments will be illustrated using a power frequency of 50Hz as an example.

[0021] The specific detection method for flicker can be set based on actual needs. For example, it can be determined by acquiring images, such as obtaining the exposure of each row of pixels in the acquired image, and calculating the variance based on the exposure of each row of pixels to obtain the flicker level. If the flicker level is greater than the preset level threshold, it is considered that flicker exists. If the flicker level is less than or equal to the preset level threshold, it is considered that no flicker occurs.

[0022] If no flicker is detected in the acquired image, image acquisition is performed based on the default parameters, i.e., no subsequent steps are executed; the default parameters can be user-set parameters or parameters determined by the image acquisition device based on the actual environment.

[0023] When the exposure time is not an integer multiple of the power frequency cycle of the light source, the amount of light emitted by the light source varies within the power frequency cycle due to the influence of the power supply frequency. As a result, different rows in the image receive different amounts of light energy, leading to differences in brightness between different rows. In this embodiment, the optional value of the exposure time is set to an integer multiple of the power frequency cycle of the light source, so that the exposure time can always maintain an integer multiple relationship with the power frequency cycle of the light source, thereby ensuring uniformity of brightness and avoiding the occurrence of flicker.

[0024] It should be noted that the exposure time here is only set as an integer multiple of the light source's operating frequency cycle. The specific exposure time value can be set based on actual needs, while still being an integer multiple. In practical applications, considering that excessive exposure time can lead to blurring and excessive increase in light intake, the exposure time can be set to one time the light source's operating frequency cycle.

[0025] Step S20: Determine the flicker level and subject probability of each unit region in the acquired image, wherein the acquired image is divided into multiple unit regions; A unit region is a pixel area obtained by dividing the pixels in the acquired image. The specific division method of the unit region can be set according to actual needs, such as one pixel as one unit region, or dividing the acquired image into a pixel array of X×Y to obtain a unit region corresponding to each pixel array, such as a unit of 16×16 pixels for the corresponding part. The more pixels a unit region contains, the fewer the number of unit regions the acquired image is divided into, the smaller the amount of data processing, and the higher the processing efficiency. Conversely, the fewer pixels a unit region contains, the more the number of unit regions the acquired image is divided into, the more data processing, and the higher the control precision.

[0026] The flicker level indicates the degree of flickering phenomenon occurring within the unit area.

[0027] The specific method for determining the flicker level can be set based on actual needs; for example, continuously acquiring a certain number of frames of images at a high frame rate, determining the brightness of each pixel in the acquired images, and performing a Fast Fourier Transform on the brightness of the pixels in the continuous frames over the time series of the continuous frame acquired images to obtain the brightness distribution. Then, for each unit area, the spectral energy integral within the target frequency band is determined by combining the brightness distribution of the pixels it contains. The spectral energy integral is used as the flicker level of that unit area. The specific value of the high frame rate can be set based on actual needs, such as 240fps. The target frequency band corresponds to the power frequency of the light source in the image acquisition environment. For example, a power frequency of 50Hz corresponds to a target frequency band of 95~105Hz; a power frequency of 60Hz corresponds to a target frequency band of 115~125Hz.

[0028] The subject probability indicator unit region is the region where the subject is located in the acquired image.

[0029] The subject is the key semantic object in the acquired image, such as a human body, pet, document, screen, or specific product in the acquired image; the subject probability can be determined by setting a semantic segmentation network to perform semantic segmentation on the acquired image; the specific type of semantic segmentation network can be set according to actual needs, such as an optimized DeepLab or UNet lightweight neural network model.

[0030] Semantic segmentation networks perform semantic segmentation on acquired images to determine the probability that each pixel in the acquired image is the subject. The probability can be output as a binary value of 1 or 0, or as a specific probability value within the range of 0 to 1. After determining the subject probability of each pixel, the subject probabilities of pixels in the unit region can be averaged to obtain the subject probability of the unit region. In addition to averaging, other calculation methods can be set, such as summation.

[0031] Step S30: For each unit area, calculate the target transmittance corresponding to the flicker level and the subject probability, where the flicker level is negatively correlated with the target transmittance and the subject probability is positively correlated with the target transmittance. Transmittance is the transmittance of the electrochromic layer, specifically the transmittance of the color-changing region in the electrochromic layer.

[0032] Understandably, the higher the degree of flicker, the more necessary it is to eliminate the flicker. This is achieved by combining two operations: reducing the amount of light entering the camera and extending the exposure time to an integer multiple. Therefore, the degree of flicker is set to be negatively correlated with the target transmittance.

[0033] The higher the probability of a subject, the greater the likelihood that a key subject exists in that unit area. The pixels in this part have higher requirements for image quality. Therefore, in this embodiment, the probability of a subject is set to be positively correlated with the target transmittance, so that when the probability of a subject is high, high transmittance can be maintained to improve the clarity of the subject area.

[0034] Step S40: Set the target transmittance of each color-changing region in the electrochromic layer to the target transmittance of the corresponding unit region.

[0035] The color-changing areas and unit areas are set in a one-to-one correspondence. Specifically, the electrochromic layer is set at the light inlet of the image sensor of the image acquisition device. The light from the external environment passes through the electrochromic layer and reaches the image sensor. The light passes through the color-changing area and reaches the image sensor to form the unit area on the acquired image.

[0036] The specific type of electrochromic layer can be set based on actual needs, such as electrochromic glass.

[0037] Electrochromic technology allows materials to undergo stable and reversible color changes in their optical properties, such as reflectivity, transmittance, and absorptivity, under the influence of an applied electric field, thereby enabling active and dynamic control of light and solar radiation. This manifests as reversible changes in color and transparency.

[0038] Electrochromic glass typically consists of five thin-film layers sandwiched between two substrates: a transparent conductive layer, an electrochromic layer, an electrolyte layer, an ion storage layer, and another transparent conductive layer. The working principle of electrochromic glass is that a voltage is applied to the electrodes at both ends of the electrochromic element. Under the influence of the electric field of the applied voltage, ions migrate into or out of the electrochromic layer, causing the valence of the electrochromic material to decrease or increase, thereby altering the light transmittance of the electrochromic glass.

[0039] When the transmittance of the electrochromic layer decreases, the amount of light received by the image sensor decreases, and the brightness of the image will decrease. However, due to the increase in the exposure time, the amount of light entering the image increases, so the image brightness will not change, thus solving the flicker problem and avoiding overexposure.

[0040] After determining the target transmittance of each unit area, the transmittance of the corresponding color-changing area of ​​the unit area is set as the target transmittance; then, image acquisition is performed under the set target transmittance, so that the acquired image can eliminate the flicker problem.

[0041] This embodiment eliminates flicker by limiting the exposure time to an integer multiple of the light source's power frequency cycle when flicker is detected. It also eliminates overexposure caused by increased exposure time by setting an electrochromic layer to reduce transmitted light. Furthermore, it determines the transmittance of corresponding electrochromic regions by analyzing the flicker level and subject probability in specific unit areas of the image acquisition parameters. This allows different unit areas to balance flicker elimination and subject clarity based on actual needs, avoiding image quality degradation due to exposure time adjustments.

[0042] Furthermore, in the second embodiment of the image acquisition method of the present invention based on the first embodiment, step S30 includes the following steps: Step S31: Obtain the first weight corresponding to the flicker level and the second weight corresponding to the subject probability, wherein the sum of the first weight and the second weight is 1; Step S32: Calculate the weight difference between the flicker level weighted with the first weight and the subject probability weighted with the second weight; Step S33: Determine the target transmittance of the unit region based on the weight difference, where the weight difference is negatively correlated with the target transmittance.

[0043] The degree of flicker indicates the need for flicker elimination, while the subject probability indicates the need for image quality. However, the relationship between the two and the target transmittance is inverse. Therefore, it is necessary to determine the most suitable target transmittance by balancing the degree of flicker and the subject probability.

[0044] The first weight indicates the importance of the flicker level, and the second weight indicates the importance of the subject probability. The sum of the first weight and the second weight is 1. When the first weight changes, the second weight changes accordingly, keeping the sum of the two at 1. The specific values ​​of the first weight and the second weight can be set according to actual needs. For example, the first weight and the second weight can both be set to 0.5, and then updated in real time based on the accuracy determined by the actual target transmittance in subsequent steps.

[0045] The specific weight difference C1 of the cell region includes:

[0046] Where α is the first weight; (1-α) is the second weight; F1 is the flicker level of the unit region; and S1 is the main probability of the unit region.

[0047] In this embodiment, the weighted difference is obtained by subtracting the weighted subject probability from the weighted flicker level. When the flicker level is greater, the weight difference is greater, and when the subject probability is greater, the weight difference is smaller. Therefore, based on the aforementioned relationship between the flicker level, subject probability and target transmittance, it can be seen that the weight difference is negatively correlated with the target transmittance.

[0048] Further, step S33 includes the following steps: Step S331: Obtain the weight difference corresponding to all cell regions; Step S332: Normalize each weight difference to obtain the light transmission weight corresponding to each weight difference; Step S333: For each unit area, match the target transmittance corresponding to the transmittance weight, wherein the transmittance weight is negatively correlated with the target transmittance.

[0049] It is understandable that in practical applications, since the specific values ​​of the flicker level and the probability of the subject are uncertain, the final weight difference value will vary greatly. In this embodiment, in order to facilitate the determination of the target transmittance, the weight difference is normalized. Specifically, the weight difference of each unit region is mapped to the interval [0, 1]. For example, the largest weight difference is set as 1, the smallest weight difference is set as 0, and the other weight differences are mapped to the interval [0, 1] based on the proportional relationship to achieve the normalization of the weight difference. The mapped weight difference is the transmittance weight.

[0050] After determining the light transmittance weight, the target light transmittance corresponding to the light transmittance weight can be matched; the correspondence between the light transmittance weight and the target light transmittance can be set according to actual needs, such as:

[0051] That is, when the light transmittance weight is 0~0.3, the probability of the main subject in the unit area is considered to be high, and it is identified as the main subject protection area. Therefore, the highest target light transmittance of 95% is set. When the transmittance weight is 0.3~0.4, the probability of the main subject in the unit area is similar to the flicker level and tends to target the main subject. It is judged as a smooth transition area. Therefore, a high target transmittance of 80% is set. When the transmittance weight is 0.4~0.6, the probability of the main subject in the unit area is considered to be equivalent to the flicker level, and it tends to target the main subject. Therefore, it is judged as a smooth transition area. Thus, the target transmittance is set to 50% in the center. When the transmittance weight is 0.6~0.7, the probability of the main body in the unit area is considered to be equivalent to the degree of flicker, and it is more inclined to target flicker. Therefore, it is judged as a smooth transition area, and a low target transmittance of 20% is set. When the transmittance weight is 0.7~1, the flicker level of the unit area is considered to be high, and it is determined to be a flicker elimination area. Therefore, the minimum target transmittance is set to 5%.

[0052] The specific values ​​in the table above are for illustrative purposes only. In practical applications, the specific values ​​can be set according to actual needs.

[0053] Further, the steps following step S40: Step S50: Obtain the optimized image acquired under the target transmittance; Step S60: Obtain the flicker suppression rate and the main signal-to-noise ratio in the optimized acquired image; The optimized image acquisition is the image acquired when the target transmittance is set for each color-changing region in the electrochromic layer.

[0054] In this embodiment, after setting the target transmittance, the image acquisition effect under the target transmittance is detected to iteratively update the target transmittance, thereby continuously optimizing the target transmittance and achieving better flicker suppression and image quality assurance.

[0055] The flicker suppression rate is the degree to which flicker problems are suppressed. The higher the flicker suppression rate, the less flickering occurs, the less obvious the stripes are, and the better the suppression effect.

[0056] The specific calculation method for flicker suppression rate can be set based on actual needs, such as by using the negative correlation function of pixel brightness variance.

[0057] The subject signal-to-noise ratio (SNR) represents the clarity of an image within a given unit area. A higher SNR indicates less noise and better subject image quality.

[0058] The specific calculation method for the subject signal-to-noise ratio can be set based on actual needs, such as determining it by calculating the ratio of average brightness to noise standard deviation, which can be estimated from flat areas of the image.

[0059] Further, step S60 includes the following steps: Step S61: Determine the flicker region and the main body region in the optimized acquired image. The flicker region is the unit region in the optimized acquired image where the flicker level reaches a preset flicker threshold, and the main body region is the unit region in the optimized acquired image where the probability of the main body is greater than a preset main body threshold. Step S62: Calculate the mean value of the brightness variance in the flicker region and determine the flicker suppression rate, which is negatively correlated with the mean value of the brightness variance. Step S63: Calculate the mean signal-to-noise ratio of the main region to obtain the main signal-to-noise ratio.

[0060] The flicker area refers to the unit area with a high degree of flicker in the optimized acquired image; The flicker level of unit regions in the acquired image can be determined first, and unit regions with flicker levels greater than the preset flicker threshold can be identified as flicker regions. The specific value of the preset flicker threshold can be set based on actual needs, such as 0.75.

[0061] It is understandable that the flicker area, as the main area with flicker in the optimized acquired image, reflects the flicker problem to a high degree. Therefore, it can also reflect the flicker suppression to a higher degree. Thus, in order to avoid interference from non-flicker areas in determining the flicker suppression, the flicker suppression rate is determined only by the mean of the brightness variance of the flicker area.

[0062] Understandably, the mean of the luminance variance is the average of the luminance variances of all flicker areas. The luminance variance indicates the difference in brightness within the flicker area; the larger the luminance variance, the greater the degree of flickering within the flicker area, and the lower the effectiveness of flicker suppression. Therefore, the mean of the luminance variance is negatively correlated with the flicker suppression rate. Specifically:

[0063] Where F2 is the flicker suppression rate; V1 is the mean of the luminance variance.

[0064] The main area is the unit region where the main subject is located in the optimized acquired image; The probability of the main subject in the unit region of the acquired image can be determined by optimizing the unit region first, and the unit region with the main subject probability greater than the preset main subject threshold can be regarded as the main subject region; the specific value of the main subject probability can be set according to actual needs, such as 0.5.

[0065] It is understandable that the subject region, as the part of the image in which the subject exists, is the main target area for high quality requirements. Therefore, in order to avoid interference from non-subject regions in determining image quality, the subject signal-to-noise ratio is determined only by the average signal-to-noise ratio of the subject region.

[0066] The mean signal-to-noise ratio is the average of the signal-to-noise ratios of all subject regions; the signal-to-noise ratio is the ratio of the average pixel brightness to the standard deviation of noise within the subject region.

[0067] Step S70: Calculate the optimized evaluation value corresponding to the acquired image based on the flicker suppression rate and the main signal-to-noise ratio; After obtaining the flicker suppression rate and the main signal-to-noise ratio, the optimized evaluation value corresponding to the optimized acquired image can be determined.

[0068] Specifically:

[0069] Where Score(α) is the optimized evaluation value when the first weight is α; S2 is the main signal-to-noise ratio.

[0070] It is understandable that the higher the flicker suppression rate, the better the effectiveness of flicker suppression and the better it meets the needs of image acquisition; the higher the subject signal-to-noise ratio, the less noise, the higher the image quality and the better it meets the needs of image acquisition. Therefore, both flicker suppression rate and subject signal-to-noise ratio are positively indicative parameters. Thus, in this embodiment, the flicker suppression rate and subject signal-to-noise ratio are weighted and summed to obtain an optimization evaluation value that reflects the optimization effectiveness of the first weight.

[0071] The higher the optimization evaluation value, the stronger the ability of the first weight to simultaneously satisfy flicker suppression and image quality, and the better it meets the needs of image acquisition.

[0072] Step S80: Update the first weight and the second weight based on the optimized evaluation value; Since the optimized evaluation value reflects the effectiveness of the first weight optimization, it can be used to determine whether the first weight meets the image acquisition requirements. When the first weight meets the requirements, the first and second weights are maintained; when the first weight does not meet the requirements, the first and second weights are adjusted to obtain better first and second weights, thus achieving a higher optimized evaluation value. (First cycle) Step S90: Update the target transmittance based on the updated first weight and second weight.

[0073] After determining the updated first and second weights, the target transmittance of the unit area can be recalculated based on the first and second weights, and then the transmittance of the corresponding color-changing area can be adjusted to the updated target transmittance.

[0074] Further, step S80 includes the following steps: Step S81: Determine the multiple optimization evaluation values ​​collected within the current time window; Step S82: Calculate the difference in evaluation values ​​between any two adjacent optimization evaluation values. Step S83: Determine whether the difference between all evaluation values ​​is less than the preset evaluation threshold; Step S84: If the difference between all evaluation values ​​is less than the preset evaluation threshold, then keep the currently set first weight and second weight unchanged. Step S88: If any difference in evaluation values ​​is greater than or equal to a preset evaluation threshold, then the first weight and the second weight are updated based on the optimized evaluation values.

[0075] The current time window is the time window for the current processing cycle, and the length of the time window can be set according to actual needs.

[0076] Within the current time window, multiple optimized image acquisitions are performed based on a preset frequency, and each optimized image can obtain an optimization evaluation value. It can be understood that if the current image is the first optimized image acquired after the target transmittance is set, only the optimization evaluation value can be calculated. After the optimization evaluation value is obtained in the next optimized image, the determination of whether to adjust the first weight and the second weight is then made.

[0077] The number of optimized images acquired within the current time window can be set based on actual needs.

[0078] The difference between adjacent optimized evaluation values ​​reflects the change in the optimized evaluation value caused by each setting of the first weight relative to the previous frame. When all evaluation value differences are less than the preset evaluation threshold, the optimized evaluation value is considered relatively stable, the setting of the first weight is also relatively stable, and the system has found the optimal working point. At this time, there is no need to adjust the first weight. At the same time, the target transmittance of each color-changing area is locked unchanged to ensure the stability of image acquisition. Since the first weight does not need to be updated frequently, the subsequent optimized evaluation values ​​can be detected at a lower frequency. When the optimized evaluation value is detected to be lower than the preset protection threshold, the first weight is readjusted. The specific value of the preset protection threshold can be set based on actual needs.

[0079] When the difference in evaluation values ​​is greater than or equal to the preset evaluation threshold, it is considered that the fluctuation of the optimized evaluation value is large and the adjustment of the first weight is also large. The system is still searching for the optimal operating point. Therefore, the first weight needs to be adjusted to continue searching for the optimal operating point.

[0080] The specific value of the preset evaluation threshold can be set based on actual needs.

[0081] Further, step S80 includes the following steps: Step S89: Obtain the previous optimization evaluation value and the current maximum optimization evaluation value corresponding to the previous optimized image; Step S810: Determine whether the previous optimization evaluation value is greater than the current maximum optimization evaluation value; Step S811: If the previous optimization evaluation value is greater than the current maximum optimization evaluation value, then determine the previous first weight corresponding to the previous optimization evaluation value and the weight adjustment direction corresponding to the previous first weight. Step S812: Obtain the preset perturbation value, adjust the preset perturbation value of the previous first weight in the weight adjustment direction, and obtain the updated first weight. Step S813: Determine the second weight corresponding to the first weight.

[0082] The previous optimized image is the optimized image captured in the previous frame.

[0083] The previous optimization evaluation value is the optimization evaluation value corresponding to the previous optimized image; The current maximum optimization evaluation value is the highest optimization evaluation value detected in this image acquisition.

[0084] In the process of continuously updating the first weight, a corresponding optimized evaluation value is obtained. After each new optimized evaluation value is obtained, it is compared with the maximum optimized evaluation value. If the previous optimized evaluation value is greater than the current maximum optimized evaluation value, it means that the first weight setting of the previous optimized evaluation value is more in line with the requirements than the first weight of the maximum optimized evaluation value. Therefore, the adjustment strategy of the first weight in the previous optimized evaluation value is correct. Continuing to adjust based on the adjustment strategy of the previous optimized evaluation value will make it easier to find the optimal operating point.

[0085] The first weight is the first weight corresponding to the target transmittance when the previous optimized image was acquired.

[0086] The weight adjustment direction indicates whether the first weight is increased or decreased.

[0087] The preset perturbation value is the step size for adjusting the first weight. The specific value can be set according to actual needs, such as 0.05.

[0088] When the weight adjustment direction indicates an increase in the first weight, a preset disturbance value is added to the previous first weight; when the weight adjustment direction indicates a decrease in the first weight, the preset disturbance value is subtracted from the previous first weight; thus updating the first weight.

[0089] If the previous optimization evaluation value is greater than the current maximum optimization evaluation value, the weight adjustment direction is the same as the weight adjustment direction of the first weight corresponding to the target transmittance when the previous optimized image was acquired; if the previous optimization evaluation value is less than or equal to the current maximum optimization evaluation value, the weight adjustment direction is opposite to the weight adjustment direction of the first weight corresponding to the target transmittance when the previous optimized image was acquired.

[0090] After determining the updated first weight, the updated second weight can be obtained based on the relationship that the sum of the first weight and the second weight is 1.

[0091] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0092] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0093] This application also provides an image acquisition device for implementing the above-described image acquisition method, the image acquisition device comprising: The first acquisition module is used to acquire the power frequency period of the light source if flicker is detected in the acquired image, and set the optional value of the exposure time in the target image acquisition parameters to an integer multiple of the power frequency period of the light source; The first determining module is used to determine the flicker level and subject probability of each unit region in the acquired image, wherein the acquired image is divided into multiple unit regions; The first calculation module is used to calculate the target transmittance corresponding to the flicker level and the subject probability for each unit area. The flicker level is negatively correlated with the target transmittance, and the subject probability is positively correlated with the target transmittance. The first setting module is used to set the target transmittance of each color-changing region in the electrochromic layer to the corresponding unit region.

[0094] This image acquisition device eliminates flicker by limiting the exposure time to an integer multiple of the light source's power frequency cycle when flicker is detected. It also eliminates overexposure caused by increasing the exposure time by setting an electrochromic layer to reduce the amount of transmitted light. At the same time, it determines the transmittance of the corresponding electrochromic region by specifically determining the flicker level and subject probability of a particular unit area in the image acquisition parameters. This allows different unit areas to balance flicker elimination and subject clarity based on actual needs, avoiding image quality degradation due to exposure time adjustment.

[0095] It should be noted that the first acquisition module in this embodiment can be used to execute step S10 in this application embodiment, the first determination module in this embodiment can be used to execute step S20 in this application embodiment, the first calculation module in this embodiment can be used to execute step S30 in this application embodiment, and the first setting module in this embodiment can be used to execute step S40 in this application embodiment.

[0096] Furthermore, the first computing module includes: The first acquisition submodule is used to acquire the first weight corresponding to the flicker level and the second weight corresponding to the subject probability, wherein the sum of the first weight and the second weight is 1; The first calculation submodule is used to calculate the weight difference between the flicker level after being weighted by the first weight and the main probability after being weighted by the second weight. The first determination submodule is used to determine the target transmittance of the unit region based on the weight difference, and the weight difference is negatively correlated with the target transmittance.

[0097] Furthermore, the first determining submodule includes: The first acquisition unit is used to acquire the weight difference corresponding to all unit regions; The first execution unit is used to normalize the weight differences to obtain the light transmission weights corresponding to each weight difference. The first matching unit is used to match the target transmittance corresponding to the transmittance weight for each unit area, wherein the transmittance weight is negatively correlated with the target transmittance.

[0098] Furthermore, the device also includes: The second acquisition module is used to set the target transmittance of each color-changing region in the electrochromic layer to the target transmittance of the corresponding unit region, and then acquire the optimized acquisition image acquired at the target transmittance. The third acquisition module is used to acquire the flicker suppression rate and the main signal-to-noise ratio in the optimized acquired image; The second calculation module is used to calculate the optimized evaluation value corresponding to the optimized acquired image based on the flicker suppression rate and the main signal-to-noise ratio. The first update module is used to update the first weight and the second weight based on the optimized evaluation value; The second update module is used to update the target transmittance based on the updated first weight and second weight.

[0099] Furthermore, the third acquisition module includes: The second determining submodule is used to determine the flicker region and the main body region in the optimized acquired image. The flicker region is a unit region in the optimized acquired image where the flicker level reaches a preset flicker threshold, and the main body region is a unit region in the optimized acquired image where the probability of the main body is greater than a preset main body threshold. The second calculation submodule is used to calculate the mean value of the brightness variance in the flicker region and determine the flicker suppression rate, which is negatively correlated with the mean value of the brightness variance. The third calculation submodule is used to calculate the average signal-to-noise ratio of the main region to obtain the main signal-to-noise ratio.

[0100] Furthermore, the second update module includes: The third determination submodule is used to determine multiple optimization evaluation values ​​collected within the current time window; The fourth calculation submodule is used to calculate the difference in evaluation values ​​between any two adjacent optimization evaluation values. The first judgment submodule is used to determine whether the difference between all evaluation values ​​is less than the preset evaluation threshold. The first holding submodule is used to keep the currently set first weight and second weight unchanged if the difference between all evaluation values ​​is less than the preset evaluation threshold. The first update submodule is used to update the first weight and the second weight based on the optimized evaluation value if the difference between any evaluation value is greater than or equal to the preset evaluation threshold.

[0101] Furthermore, the second update module includes: The second acquisition submodule is used to acquire the previous optimization evaluation value and the current maximum optimization evaluation value corresponding to the previous optimized acquisition image; The second judgment submodule is used to determine whether the previous optimization evaluation value is greater than the current maximum optimization evaluation value; The fourth determination submodule is used to determine the previous first weight corresponding to the previous optimization evaluation value and the weight adjustment direction corresponding to the previous first weight if the previous optimization evaluation value is greater than the current maximum optimization evaluation value. The third acquisition submodule is used to acquire a preset disturbance value, adjust the preset disturbance value of the previous first weight in the weight adjustment direction, and obtain the updated first weight. The fifth determination submodule is used to determine the second weight corresponding to the first weight.

[0102] Reference Figure 2In terms of hardware structure, the electronic device may include components such as a communication module 10, a memory 20, and a processor 30. In the electronic device, the processor 30 is connected to both the memory 20 and the communication module 10. The memory 20 stores a computer program, which is executed by the processor 30. When the computer program is executed, it implements the steps of the above-described method embodiments.

[0103] The communication module 10 can connect to external communication devices via a network. The communication module 10 can receive requests from external communication devices and can also send requests, instructions, and information to external communication devices. External communication devices can be other electronic devices, servers, or IoT devices, such as televisions, etc.

[0104] The memory 20 can be used to store software programs and various data. The memory 20 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as determining the flicker level and subject probability of each unit region in the acquired image), etc.; the data storage area may include a database, and may store data or information created based on system usage. Furthermore, the memory 20 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0105] The processor 30 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 20, and by calling data stored in the memory 20, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 30 may include one or more processing units; optionally, the processor 30 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 30.

[0106] although Figure 2 Not shown, but the above electronic device may also include a circuit control module for connecting to a power supply to ensure the normal operation of other components. Those skilled in the art will understand that... Figure 2 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0107] The present invention also proposes a computer-readable storage medium having a computer program stored thereon. The computer-readable storage medium may be... Figure 2The memory 20 in the electronic device may be at least one of ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk, etc. The computer-readable storage medium includes several instructions to cause a terminal device with a processor (which may be a television, automobile, mobile phone, computer, server, terminal, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0108] In this invention, the terms "first," "second," "third," "fourth," and "fifth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0109] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0110] Although embodiments of the present invention have been shown and described above, the scope of protection of the present invention is not limited thereto. It is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, and substitutions to the above embodiments within the scope of the present invention, and such changes, modifications, and substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An image acquisition method, characterized in that, The image acquisition method includes: If flicker is detected in the acquired image, the power frequency period of the light source is obtained, and the optional value of the exposure time in the target image acquisition parameters is set to an integer multiple of the power frequency period of the light source; Determine the flicker level and subject probability of each unit region in the acquired image, wherein the acquired image is divided into multiple unit regions; For each of the aforementioned unit regions, the target transmittance corresponding to the flicker level and the subject probability is calculated, wherein the flicker level is negatively correlated with the target transmittance, and the subject probability is positively correlated with the target transmittance; Each color-changing region in the electrochromic layer is set to the target transmittance of the corresponding unit region.

2. The image acquisition method as described in claim 1, characterized in that, The calculation of the target transmittance corresponding to the flicker level and the subject probability includes: Obtain the first weight corresponding to the flicker level and the second weight corresponding to the subject probability, wherein the sum of the first weight and the second weight is 1; Calculate the weight difference between the flicker level weighted with a first weight and the subject probability weighted with a second weight; The target transmittance of the unit region is determined based on the weighted difference, and the weighted difference is negatively correlated with the target transmittance.

3. The image acquisition method as described in claim 2, characterized in that, The step of determining the target transmittance of the unit region based on the weighted difference, wherein the weighted difference is negatively correlated with the target transmittance, includes: Obtain the weight difference corresponding to all the said unit regions; The light transmittance weight corresponding to each weight difference is obtained by normalizing the weight difference. For each of the aforementioned unit regions, the target transmittance corresponding to the transmittance weight is matched, wherein the transmittance weight is negatively correlated with the target transmittance.

4. The image acquisition method as described in claim 2, characterized in that, After setting the target transmittance of each color-changing region in the electrochromic layer to the corresponding unit region, the following is included: Obtain the optimized image acquired at the target transmittance; Obtain the flicker suppression rate and the main signal-to-noise ratio in the optimized acquired image; Calculate the optimization evaluation value corresponding to the optimized acquired image based on the flicker suppression rate and the main signal-to-noise ratio; The first weight and the second weight are updated based on the optimized evaluation value; The target transmittance is updated based on the updated first weight and the second weight.

5. The image acquisition method as described in claim 4, characterized in that, The step of obtaining the flicker suppression rate and the main signal-to-noise ratio in the optimized acquired image includes: In the optimized acquired image, a flicker region and a main body region are determined, wherein the flicker region is a unit region in the optimized acquired image where the flicker level reaches a preset flicker threshold, and the main body region is a unit region in the optimized acquired image where the probability of the main body is greater than a preset main body threshold; Calculate the mean luminance variance of the flicker region and determine the flicker suppression rate that is negatively correlated with the mean luminance variance. The signal-to-noise ratio of the main body is obtained by calculating the mean signal-to-noise ratio of the main body region.

6. The image acquisition method as described in claim 4, characterized in that, The step of updating the first weight and the second weight based on the optimized evaluation value includes: Determine the multiple optimization evaluation values ​​collected within the current time window; Calculate the difference in evaluation values ​​between any two adjacent optimized evaluation values; Determine whether the difference between all the evaluation values ​​is less than a preset evaluation threshold; If the difference between all the evaluation values ​​is less than the preset evaluation threshold, then the currently set first weight and second weight remain unchanged; If any of the evaluation values ​​differs from the preset evaluation threshold, the first weight and the second weight are updated based on the optimized evaluation value.

7. The image acquisition method as described in claim 4, characterized in that, The step of updating the first weight and the second weight based on the optimized evaluation value includes: Obtain the previous optimization evaluation value and the current maximum optimization evaluation value corresponding to the previously optimized image; Determine whether the previous optimization evaluation value is greater than the current maximum optimization evaluation value; If the previous optimization evaluation value is greater than the current maximum optimization evaluation value, then determine the previous first weight corresponding to the previous optimization evaluation value, and the weight adjustment direction corresponding to the previous first weight; Obtain a preset perturbation value, and adjust the previous first weight according to the weight adjustment direction to obtain the updated first weight; Determine the second weight corresponding to the first weight.

8. An image acquisition device, characterized in that, The image acquisition device includes: The first acquisition module is used to acquire the power frequency period of the light source if flicker is detected in the acquired image, and set the optional value of the exposure time in the target image acquisition parameters to an integer multiple of the power frequency period of the light source; The first determining module is used to determine the flicker level and subject probability of each unit region in the acquired image, wherein the acquired image is divided into multiple unit regions; The first calculation module is used to calculate the target transmittance corresponding to the flicker level and the subject probability for each of the unit regions, wherein the flicker level is negatively correlated with the target transmittance, and the subject probability is positively correlated with the target transmittance; The first setting module is used to set each color-changing region in the electrochromic layer to the target transmittance of the corresponding unit region.

9. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the image acquisition method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the image acquisition method as described in any one of claims 1 to 7.