Image stroboflash elimination method and device, equipment, storage medium and program product
By utilizing spatial feature analysis and exposure table switching in smart terminal devices, flickering can be quickly eliminated, solving image quality problems caused by flickering, improving processing efficiency, and reducing device power consumption. This method is suitable for smart terminal devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, flickering causes a decrease in image quality during image acquisition in smart terminal devices. Furthermore, flicker detection and elimination rely on complex image processing algorithms or additional hardware sensors, resulting in slow processing speeds, high computational resource consumption, and difficulty in adapting to rapidly changing shooting scenarios.
By acquiring multiple preset exposure tables and historical exposure parameters, spatial domain feature analysis is used to determine whether there are flickering features in the image. When flickering is present, different exposure tables are switched to adjust the exposure parameters to eliminate flickering. Combined with the reuse of historical exposure tables, camera parameters are quickly initialized, avoiding complex algorithm calculations.
It significantly reduces computational complexity and resource consumption, improves processing efficiency, reduces device power consumption, and achieves efficient flicker elimination. No additional hardware support is required, and it is suitable for various smart terminal devices.
Smart Images

Figure CN121815092A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image flicker elimination method, apparatus, device, storage medium, and program product. Background Technology
[0002] In the image acquisition process of smart terminal devices (such as smartphones, digital cameras, security cameras, smartwatches, etc.), flicker is a significant issue affecting image quality. Flicker is usually caused by a mismatch between the AC-powered light source (such as light-emitting diode (LED) lamps or fluorescent lamps) and the line-by-line exposure mechanism of the complementary metal-oxide-semiconductor (CMOS) image sensor.
[0003] In related technologies, flicker detection and elimination functions often rely on complex image processing algorithms or additional hardware sensors, resulting in slow processing speed, high computational resource consumption, and difficulty in adapting to rapidly changing shooting scenarios.
[0004] Therefore, there is an urgent need for a high-efficiency, low-power flicker detection and elimination method that requires no additional hardware support. Summary of the Invention
[0005] This application provides image flicker elimination methods, apparatus, devices, storage media, and program products, which can efficiently and with low power consumption detect and eliminate flicker without additional hardware support.
[0006] In a first aspect, embodiments of this application provide an image flicker elimination method, including:
[0007] Multiple preset exposure tables and historical exposure parameters are obtained, and each preset exposure table corresponds to a different light source frequency;
[0008] Based on the first exposure table corresponding to the historical exposure parameters, a first image is obtained, wherein the first exposure table is an exposure table among the plurality of preset exposure tables;
[0009] Based on the spatial characteristics of the first image, determine whether the first image has flickering characteristics;
[0010] If the first image has flickering characteristics, switch to the second exposure table and use the second exposure table as the target exposure table. The second exposure table is an exposure table that is different from the first exposure table among the plurality of preset exposure tables.
[0011] Based on the target exposure table, adjust the exposure parameters to obtain a flicker-free image.
[0012] In one possible implementation, obtaining the first image based on the first exposure table corresponding to the historical exposure parameters includes:
[0013] Based on the first exposure table, multiple second images are obtained;
[0014] Based on the multiple second images, determine whether the shooting scene has changed;
[0015] If the shooting scene remains unchanged, any one of the multiple second images from which it is successfully determined that the shooting scene has not changed is taken as the first image.
[0016] In one possible implementation, determining whether the shooting scene has changed based on the plurality of second images includes:
[0017] For any two adjacent images among the plurality of second images, it is determined whether the shooting scene has changed based on the content, lighting characteristics, and position information of the two adjacent images.
[0018] In one possible implementation, determining whether the first image has flicker features based on the spatial characteristics of the first image includes:
[0019] Obtain the brightness difference between any horizontally adjacent pixels, vertically adjacent pixels, or diagonally adjacent pixels in the first image;
[0020] Based on the brightness difference and brightness difference threshold, it is determined whether the first image has flickering characteristics.
[0021] In one possible implementation, the method further includes:
[0022] Obtain the intensity of the current ambient light;
[0023] The brightness difference threshold is adjusted based on the intensity of the current ambient light.
[0024] In one possible implementation, the step of switching to a second exposure table when the first image exhibits flickering characteristics, and using the second exposure table as the target exposure table, includes:
[0025] If the first image exhibits flickering characteristics, switch to the second exposure table;
[0026] Based on the second exposure table, multiple third images are obtained;
[0027] Based on the multiple third images, determine whether the shooting scene has changed;
[0028] If the shooting scene remains unchanged, based on the spatial characteristics of the fourth image, it is determined whether the fourth image has flicker characteristics. The fourth image is any one of the multiple third images from which it is successfully determined that the shooting scene has not changed.
[0029] If the fourth image does not exhibit flicker characteristics, the second exposure table will be used as the target exposure table.
[0030] Secondly, embodiments of this application provide an image flicker elimination device, comprising:
[0031] The acquisition module is used to acquire multiple preset exposure tables and historical exposure parameters, wherein each preset exposure table corresponds to a different light source frequency;
[0032] The generation module is used to obtain a first image based on the first exposure table corresponding to the historical exposure parameters, wherein the first exposure table is an exposure table among the plurality of preset exposure tables;
[0033] The judgment module is used to determine whether the first image has flickering features based on the spatial features of the first image;
[0034] The switching module is used to switch to the second exposure table when the first image has flickering characteristics, and to use the second exposure table as the target exposure table. The second exposure table is an exposure table that is different from the first exposure table among the plurality of preset exposure tables.
[0035] The adjustment module is used to adjust the exposure parameters based on the target exposure table to obtain a flicker-free image.
[0036] In one possible implementation, the generation module is specifically used for:
[0037] Based on the first exposure table, multiple second images are obtained;
[0038] Based on the multiple second images, determine whether the shooting scene has changed;
[0039] If the shooting scene remains unchanged, any one of the multiple second images from which it is successfully determined that the shooting scene has not changed is taken as the first image.
[0040] In one possible implementation, the generation module is specifically used for:
[0041] For any two adjacent images among the plurality of second images, it is determined whether the shooting scene has changed based on the content, lighting characteristics, and position information of the two adjacent images.
[0042] In one possible implementation, determining whether the first image has flicker features based on the spatial characteristics of the first image includes:
[0043] Obtain the brightness difference between any horizontally adjacent pixels, vertically adjacent pixels, or diagonally adjacent pixels in the first image;
[0044] Based on the brightness difference and brightness difference threshold, it is determined whether the first image has flickering characteristics.
[0045] In one possible implementation, the acquisition module is further configured to acquire the intensity of the current ambient light;
[0046] The adjustment module is also used to adjust the brightness difference threshold according to the intensity of the current ambient light.
[0047] In one possible implementation, the switching module is specifically used for:
[0048] If the first image exhibits flickering characteristics, switch to the second exposure table;
[0049] Based on the second exposure table, multiple third images are obtained;
[0050] Based on the multiple third images, determine whether the shooting scene has changed;
[0051] If the shooting scene remains unchanged, based on the spatial characteristics of the fourth image, it is determined whether the fourth image has flicker characteristics. The fourth image is any one of the multiple third images from which it is successfully determined that the shooting scene has not changed.
[0052] If the fourth image does not exhibit flicker characteristics, the second exposure table will be used as the target exposure table.
[0053] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0054] The memory stores computer-executed instructions;
[0055] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0056] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0057] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0058] The image flicker elimination method, apparatus, device, storage medium, and program products provided in this application quickly initialize camera parameters by reusing historical exposure tables and replace traditional analysis methods with spatial domain analysis, significantly reducing computational complexity. Furthermore, the switching of preset exposure tables directly matches the light source frequency, avoiding complex algorithm calculations and further reducing resource consumption. In other words, the method of this application significantly improves processing efficiency and reduces device power consumption while ensuring flicker elimination effects, and requires no additional hardware support, making it suitable for various smart terminal devices. Attached Figure Description
[0059] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0060] Figure 1 Flowchart of the image flicker elimination method provided in the embodiments of this application Figure 1 ;
[0061] Figure 2 Flowchart of the image flicker elimination method provided in the embodiments of this application Figure 2 ;
[0062] Figure 3 This is a schematic diagram of the image flicker elimination device provided in the embodiments of this application;
[0063] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0064] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0066] In the embodiments of this application, the term "multiple (items)" refers to two (items) or more, and other quantifiers are similar.
[0067] The terms "first," "second," etc., used in the embodiments of this application are for illustrative purposes and to distinguish the objects being described. They do not indicate any order or a specific limitation on the number of objects in the embodiments of this application, and cannot constitute any limitation on the embodiments of this application. For example, the use of terms such as "first exposure table" and "second exposure table" is only to distinguish different exposure tables, and does not indicate any difference in the size, priority, or importance of the two exposure tables.
[0068] It should be further understood that the terms "comprising" or "including" indicate the presence of the aforementioned features, steps, operations, elements, components, types, and / or groups, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, types, and / or groups.
[0069] In this application, terms such as "exemplary," "in some embodiments," and "in other embodiments" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in this application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the term "exemplary" is used to present the concept in a specific manner.
[0070] It should be understood that although the steps in the flowcharts of this application's embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figures may include at least one sub-step or at least one stage. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0071] To facilitate understanding of the technical solution of this application, the relevant technologies involved in this application will be explained first below.
[0072] Because the energy of AC power changes periodically over time, when a light source operates under this type of power, if the exposure time of the imaging device does not match the frequency of the light source, there will be variations in brightness in the captured image due to differences in light intensity during the exposure process. Furthermore, since the exposure strategy of CMOS elements is line-by-line exposure, and there is a time difference between lines, there are variations in brightness between the line data of the image, which is the fundamental cause of flickering in the captured image.
[0073] Typically, background information is removed by subtracting the sum of row data from adjacent frames to obtain flicker information in the image. Frequency domain analysis is then used to determine the light source frequency, or time domain analysis is used to periodically determine if ripples exist in the image. The exposure time is then adjusted to match the light source frequency to eliminate flicker. However, when using the adjacent frame background removal method, if the flicker in two frames is identical, the stripes will appear in the same position, making it impossible to effectively extract flicker information and causing inaccurate light source frequency detection. Extracting flicker data by subtracting the sum of adjacent row data from a single frame is significantly affected by background and noise, leading to inaccurate data extraction and abnormalities in the detected flicker frequency or period, ultimately resulting in incorrect detection results. Flicker sensors directly collect light source brightness from the environment to extract the flicker frequency, avoiding interference from background information in the image. However, this usually requires hardware support and incurs costs, lacking universality.
[0074] To address the aforementioned technical problems, the image flicker elimination method provided in this application rapidly initializes camera parameters by reusing historical exposure tables and combines spatial domain analysis with traditional methods, significantly reducing computational complexity. Furthermore, the switching of the preset exposure table directly matches the light source frequency, avoiding complex algorithm calculations and further reducing resource consumption. In other words, the method of this application significantly improves processing efficiency and reduces device power consumption while ensuring flicker elimination effectiveness, and requires no additional hardware support, making it suitable for various smart terminal devices.
[0075] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0076] Figure 1 Flowchart of the image flicker elimination method provided in the embodiments of this application Figure 1 ,like Figure 1 As shown, the method includes the following steps:
[0077] S101. Obtain multiple preset exposure tables and historical exposure parameters. Each preset exposure table corresponds to a different light source frequency.
[0078] The execution subject of this application embodiment can be an electronic device, a chip, or a chip module, or it can be an image flicker elimination device installed in an electronic device, a chip, or a chip module. The image flicker elimination device can be implemented by software or by a combination of software and hardware.
[0079] Among them, the electronic device can be a device with shooting function, such as a mobile phone, camera (such as a digital camera, security camera, etc.), video watch, etc., and this application does not limit it.
[0080] The number of preset exposure tables can be two or more. For example, multiple preset exposure tables can be an exposure table corresponding to a 50Hz light source frequency and an exposure table corresponding to a 60Hz light source frequency.
[0081] For any given preset exposure table, it may include multiple exposure times, each exposure time being an integer multiple of the light source period. For example, the exposure table corresponding to a 50Hz light source frequency may include exposure times of 10 milliseconds, 20 milliseconds, 40 milliseconds, etc. In addition to exposure time, the preset exposure table may also include exposure gain (i.e., International Organization for Standardization (ISO) sensitivity) and / or aperture. The preset exposure table may also be referred to as a preset exposure parameter set, and this application does not impose any limitations on this.
[0082] Historical exposure parameters can be the exposure parameters of the electronic device when it last exited the camera.
[0083] S102. Based on the first exposure table corresponding to the historical exposure parameters, a first image is obtained. The first exposure table is an exposure table among multiple preset exposure tables.
[0084] Historical exposure parameters refer to parameters that determine the brightness, image quality, and dynamic range of an image. For example, historical exposure parameters may include exposure time, ISO sensitivity, etc., but this application does not limit this.
[0085] The first exposure table corresponding to the historical exposure parameters can refer to one or more exposure parameters in the historical exposure parameters being parameters in the first exposure table. For example, the exposure time in the historical exposure parameters is an exposure time in the first exposure table. The first exposure table corresponding to the historical exposure parameters can refer to the exposure table applied when the electronic device last exited the camera, and can also be called a historical exposure table; this application does not limit this.
[0086] Obtaining the first image based on the first exposure table can mean taking a picture using any set of exposure parameters in the first exposure table.
[0087] For example, the first exposure table can be an exposure table corresponding to a 50 Hz light source frequency or an exposure table corresponding to a 60 Hz light source frequency.
[0088] S103. Based on the spatial characteristics of the first image, determine whether the first image has flickering characteristics.
[0089] The spatial domain features of the first image can refer to the features extracted directly from the position, gray / color values and spatial distribution of pixels in the two-dimensional pixel space of the image (i.e., the length × width plane of the original pixel matrix). In other words, the features are observed or calculated directly from the pixel arrangement, brightness and color distribution and spatial structure of the image itself without undergoing frequency domain transformation such as Fourier transform. These are the most basic and intuitive features of the image.
[0090] Flicker characteristics can refer to water ripples, moiré patterns, etc.
[0091] In one possible implementation, the presence of flickering features in the first image can be determined based on the spatial characteristics of the first image in the following manner:
[0092] Obtain the brightness difference between any horizontally adjacent pixels, vertically adjacent pixels, or diagonally adjacent pixels in the first image; based on the brightness difference and the brightness difference threshold, determine whether the first image has flickering characteristics.
[0093] The oblique direction can refer to a 45° direction or a 135° direction, and this application does not limit it.
[0094] Determining whether a first image has flicker characteristics based on brightness difference and brightness difference threshold means: determining whether the brightness difference exceeding the brightness difference threshold forms a periodic continuous fluctuation. If a periodic continuous fluctuation is formed, the first image is determined to have flicker characteristics; if no periodic continuous fluctuation is formed, the first image is determined not to have flicker characteristics.
[0095] The first image used for flicker feature determination is a grayscale image. If the first image is a color image, it can be converted to grayscale before flicker feature determination.
[0096] For example, suppose the pixel brightness values of the first image are as shown in the table below, and the flicker feature is water ripples. The method for judging water ripples will be explained in detail below with reference to the table.
[0097]
[0098] 1. First define adjacent pixels
[0099] Horizontal adjacency: (R,C) and (R,C+1) (left-right); Vertical adjacency: (R,C) and (R+1,C) (top-bottom); Diagonal adjacency (45°): (R,C) and (R+1,C+1). Where R represents the row and C represents the column.
[0100] 2. Calculate the brightness difference (absolute value difference) between adjacent pixels of various types.
[0101] The following calculations are centered on the core pixels (2,2), (2,3), (3,2), and (3,3).
[0102] (1) Brightness difference between horizontally adjacent pixels (left and right)
[0103] • (2,2) and (2,3): |190 - 120| = 70 (≥ threshold 20, significant difference point);
[0104] • (3,2) and (3,3): |110 - 90| = 20 (= threshold 20, significant difference point);
[0105] • Other adjacent levels (e.g. (1,1) and (1,2): |80-100|=20): partially meet the standard, but there is no obvious pattern.
[0106] (2) Brightness difference between vertically adjacent pixels (top and bottom)
[0107] • (2,2) and (3,2): |190 - 170| = 20 (= threshold 20, significant difference point);
[0108] • (2,3) and (3,3): |120 - 90| = 30 (≥ threshold 20, significant difference point);
[0109] • Other vertically adjacent pairs (such as (1,3) and (2,3): |180-190|=10): most do not meet the standard.
[0110] (3) Diagonal brightness difference between adjacent pixels (45°, lower right corner)
[0111] • (1,1) and (2,2): |80 - 190| = 110 (≥20, significant difference point);
[0112] • (1,2) and (2,3): |100 - 120| = 20 (=20, significant difference point);
[0113] • (1,3) and (2,4): |180 - 85| = 95 (≥20, significant difference point);
[0114] • (2,1) and (3,2): |90 - 110| = 20 (=20, significant difference point);
[0115] • (2,2) and (3,3): |190 - 90| = 100 (≥20, significant difference point);
[0116] • (2,3) and (3,4): |120 - 100| = 20 (=20, significant difference point);
[0117] • (3,1) and (4,2): |170 - 85| = 85 (≥20, significant difference point);
[0118] • (3,2) and (4,3): |110 - 100| = 10 (<20, non-significant difference);
[0119] • (3,3) and (4,4): |90 - 190| = 100 (≥20, significant difference).
[0120] 3. Threshold filtering (assuming brightness difference threshold = 20)
[0121] Mark all "significant difference points" with a brightness difference ≥ 20. In the core region (R=1~4, C=1~4), more than 80% of the diagonally adjacent pairs are significant difference points, and their distribution is concentrated.
[0122] 4. Periodic verification
[0123] Observe the distribution pattern of the points of significant difference and see if it conforms to the characteristics of water ripples:
[0124] Significantly different points diagonally adjacent to each other exhibit a repetitive fluctuation of "bright → dark → bright → dark", for example, (1,1) (dark 80) → (2,2) (bright 190) (difference 110), (2,2) (bright 190) → (3,3) (dark 90) (difference 100), (3,3) (dark 90) → (4,4) (bright 190) (difference 100). The "bright-dark alternation" repeats once every diagonal pixel, with a period of 2.
[0125] Comparing the horizontal / vertical directions: Although there are some significant differences, there are no continuous periodic fluctuations (e.g., the difference between (2,2) and (2,3) in the horizontal direction is 70, and the difference between (2,3) and (2,4) is 35, with no regular repetition).
[0126] Final judgment:
[0127] The brightness difference between diagonally adjacent pixels in the image exhibits "periodic continuous fluctuations," which matches the core characteristics of water ripples, thus confirming the presence of water ripples.
[0128] In one possible implementation, the brightness difference threshold can be dynamically changed, and can be adjusted based on the following method:
[0129] Obtain the intensity of the current ambient light; adjust the brightness difference threshold based on the intensity of the current ambient light.
[0130] For example, the brightness difference threshold is proportional to the intensity of the current ambient light. A higher ambient light intensity can increase the brightness difference threshold, while a lower ambient light intensity can decrease it.
[0131] By dynamically adjusting the brightness difference threshold, spatial domain detection can adapt to the flicker characteristics under different lighting conditions, significantly reducing the false judgment rate.
[0132] S104. If the first image has flickering characteristics, switch to the second exposure table and use the second exposure table as the target exposure table. The second exposure table is an exposure table that is different from the first exposure table among multiple preset exposure tables.
[0133] For example, if multiple preset exposure tables are an exposure table corresponding to a 50Hz light source frequency and an exposure table corresponding to a 60Hz light source frequency, then if the first exposure table is the exposure table corresponding to a 50Hz light source frequency, the second exposure table is the exposure table corresponding to a 60Hz light source frequency; and if the first exposure table is the exposure table corresponding to a 60Hz light source frequency, the second exposure table is the exposure table corresponding to a 50Hz light source frequency.
[0134] S105. Based on the target exposure table, adjust the exposure parameters to obtain a flicker-free image.
[0135] Adjusting exposure parameters based on the target exposure table means adjusting the exposure parameters of the electronic device's camera to the optimal exposure parameters based on the image content.
[0136] Figure 1 The illustrated embodiment rapidly initializes camera parameters by reusing historical exposure tables and replaces traditional analysis methods with spatial domain analysis, significantly reducing computational complexity. Furthermore, the switching of preset exposure tables directly matches the light source frequency, avoiding complex algorithm calculations and further reducing resource consumption. In other words, the method of this application significantly improves processing efficiency and reduces device power consumption while ensuring flicker elimination, and requires no additional hardware support, making it suitable for various smart terminal devices.
[0137] Figure 2 Flowchart of the image flicker elimination method provided in the embodiments of this application Figure 2 ,like Figure 2 As shown, the method includes the following steps:
[0138] S201. Obtain multiple preset exposure tables and historical exposure parameters. Each preset exposure table corresponds to a different light source frequency.
[0139] It should be noted that the execution process of S201 can be referred to the execution process of S101, and will not be repeated here.
[0140] S202. Based on the first exposure table corresponding to the historical exposure parameters, obtain multiple second images.
[0141] It should be noted that the descriptions of historical exposure parameters and the first exposure table can be found in the corresponding descriptions in S102, and will not be repeated here.
[0142] Obtaining multiple second images based on the first exposure table means taking multiple second images using any set of exposure parameters from the first exposure table. These multiple second images are taken at different times.
[0143] S203. Based on multiple second images, determine whether the shooting scene has changed.
[0144] The shooting scene can refer to the content being shot.
[0145] In one possible implementation, the shooting scene can be determined based on multiple images in the following way: for any two adjacent images among the multiple second images, the shooting scene can be determined based on the content, lighting characteristics and position information of the two adjacent images.
[0146] The content of two adjacent images can refer to the key elements of the two adjacent images, such as objects, tasks, scene structures, backgrounds, etc.
[0147] Illumination features can refer to features determined by ambient light, such as the brightness, contrast, and color temperature of an image.
[0148] Location information can refer to the location information of an electronic device when the corresponding image is captured. Location information can be obtained based on the positioning functions of the electronic device, such as Global Positioning System (GPS) and Beidou.
[0149] It should be noted that the number of second images is two or more. For example, first take two second images, naming them Image 1 and Image 2 in chronological order of capture time. Based on Image 1 and Image 2, determine if the shooting scene has changed. If the shooting scene has not changed, stop shooting and proceed to the next step. If the shooting scene has changed, take a third image. Based on Image 2 and Image 3, determine if the shooting scene has changed. If the shooting scene has not changed, stop shooting and proceed to the next step. If the shooting scene has changed, take a fourth image, and so on, until it is determined that the shooting scene has not changed.
[0150] Performing the next step (i.e., determining whether the image has flicker characteristics) under the premise that the shooting scene has not changed can improve the accuracy of flicker characteristic determination.
[0151] S204. If the shooting scene has not changed, take any one of the multiple second images from which it is successfully determined that the shooting scene has not changed as the first image.
[0152] Based on the description in S203, it can be understood that the first image can be the last image taken among multiple second images, or the second-to-last image taken among multiple second images. For example, if there are three second images, and the three second images are named as image 1, image 2, and image 3 in chronological order of being taken, then the first image can be either image 2 or image 3.
[0153] S205. Based on the spatial characteristics of the first image, determine whether the first image has flickering characteristics.
[0154] It should be noted that the execution process of S205 can be referred to the execution process of S103, and will not be repeated here.
[0155] S206. If the first image does not have flicker characteristics, the first exposure table shall be used as the target exposure table.
[0156] S207. If the first image has flickering characteristics, switch to the second exposure table.
[0157] S208. Based on the second exposure table, multiple third images are obtained.
[0158] S209. Based on multiple third images, determine whether the shooting scene has changed.
[0159] S210. If the shooting scene remains unchanged, determine whether the fourth image has flickering characteristics based on the spatial characteristics of the fourth image. The fourth image is any one of the multiple third images from which it was successfully determined that the shooting scene has not changed.
[0160] It should be noted that the execution process of S208 to S210 can be referred to the execution process of S202 to S205, and will not be repeated here.
[0161] S211. If the fourth image does not have flicker characteristics, the second exposure table shall be used as the target exposure table.
[0162] Assuming the number of preset exposure meters is 2, if the fourth image has flickering characteristics, it can be determined that the light source period is not 50Hz / 60Hz or the stripes are part of the image content. Other methods can be used to determine the light source period later.
[0163] Assuming there are 3 or more preset exposure tables, if the fourth image has flickering characteristics, you can continue to switch exposure tables until the flickering characteristics of the image disappear or all preset exposure tables fail to eliminate the flickering characteristics.
[0164] S212. Based on the target exposure table, adjust the exposure parameters to obtain a flicker-free image.
[0165] It should be noted that the execution process of S212 can be referred to the execution process of S105, and will not be repeated here.
[0166] exist Figure 2 In the illustrated embodiment, camera parameters are quickly initialized by reusing historical exposure tables, and scene judgment and spatial domain analysis are combined to replace traditional analysis methods, significantly reducing computational complexity. Furthermore, the switching of preset exposure tables directly matches the light source frequency, avoiding complex algorithm calculations and further reducing resource consumption. In other words, the method of this application significantly improves processing efficiency and reduces device power consumption while ensuring flicker elimination effects, and requires no additional hardware support, making it suitable for various smart terminal devices.
[0167] Figure 3 This is a schematic diagram of the image flicker elimination device provided in the embodiments of this application, as shown below. Figure 3 As shown, the image flicker elimination device 10 includes:
[0168] The acquisition module 11 is used to acquire multiple preset exposure tables and historical exposure parameters. Each preset exposure table corresponds to a different light source frequency.
[0169] The generation module 12 is used to obtain a first image based on a first exposure table corresponding to historical exposure parameters. The first exposure table is an exposure table among multiple preset exposure tables.
[0170] The judgment module 13 is used to determine whether the first image has flickering features based on the spatial features of the first image;
[0171] The switching module 14 is used to switch to the second exposure table when the first image has flickering characteristics, and to use the second exposure table as the target exposure table. The second exposure table is an exposure table that is different from the first exposure table among multiple preset exposure tables.
[0172] The adjustment module 15 is used to adjust the exposure parameters based on the target exposure table to obtain a flicker-free image.
[0173] In one possible implementation, the generation module 12 is specifically used for:
[0174] Based on the first exposure table, multiple second images are obtained;
[0175] Based on multiple second images, determine whether the shooting scene has changed;
[0176] If the shooting scene remains unchanged, any one of the multiple second images from which it is successfully determined that the shooting scene has not changed is taken as the first image.
[0177] In one possible implementation, the generation module 12 is specifically used for:
[0178] For any two adjacent images among multiple second images, determine whether the shooting scene has changed based on the content, lighting features, and position information of the two adjacent images.
[0179] In one possible implementation, determining whether the first image has flickering features based on its spatial characteristics includes:
[0180] Obtain the brightness difference between any horizontally adjacent pixels, vertically adjacent pixels, or diagonally adjacent pixels in the first image;
[0181] Based on the brightness difference and brightness difference threshold, it is determined whether the first image has flickering characteristics.
[0182] In one possible implementation, the acquisition module 11 is also used to acquire the intensity of the current ambient light;
[0183] The adjustment module 15 is also used to adjust the brightness difference threshold according to the intensity of the current ambient light.
[0184] In one possible implementation, the switching module 14 is specifically used for:
[0185] If the first image exhibits flickering characteristics, switch to the second exposure table;
[0186] Based on the second exposure table, multiple third images were obtained;
[0187] Based on multiple third images, determine whether the shooting scene has changed;
[0188] If the shooting scene remains unchanged, based on the spatial characteristics of the fourth image, it is determined whether the fourth image has flicker characteristics. The fourth image is any one of the multiple third images from which it was successfully determined that the shooting scene has not changed.
[0189] If the fourth image does not exhibit flicker characteristics, the second exposure table will be used as the target exposure table.
[0190] The image flicker elimination device provided in this embodiment can perform the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0191] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4As shown, the electronic device 20 includes a transceiver 21, a memory 22, and a processor 23. The transceiver 21 may include a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, transmitter port, or transmitter interface, etc., and the receiver may also be referred to as a receiver, receiver port, or receiver interface, etc. Exemplarily, the transceiver 21, memory 22, and processor 23 are interconnected via a bus 24.
[0192] Memory 22 is used to store program instructions;
[0193] The processor 23 is used to execute the program instructions stored in the memory to cause the electronic device to perform any of the power control methods shown above.
[0194] Transceiver 21 is used to perform the sending and receiving functions of electronic devices.
[0195] In one possible implementation, the memory 22 may be the storage medium described above.
[0196] Electronic devices can include chips, modules, integrated development environments (IDEs), etc.
[0197] Figure 4 The electronic device shown in the embodiments can execute the technical solutions shown in the above method embodiments. Its implementation principle and beneficial effects are similar, and will not be repeated here.
[0198] This application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the image flicker elimination method described above.
[0199] This application provides a computer program product, including a computer program that, when executed by a processor, can implement any of the above-described image flicker elimination methods.
[0200] This application provides a chip on which a computer program is stored. When the computer program is executed by the chip, it implements the above-described image flicker elimination method.
[0201] In one possible implementation, the chip is a chip in a chip module.
[0202] The computer-readable storage medium and computer program product of this application embodiment can execute the technical solution shown in the above-described image flicker elimination method embodiment. Their implementation principle and beneficial effects are similar, and will not be described again here.
[0203] All or part of the steps in the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above-described method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.
[0204] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of 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 processing unit 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 processing unit 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.
[0205] 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.
[0206] 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 boxes Figure 1 The steps of the function specified in one or more boxes.
[0207] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
Claims
1. A method for eliminating image flicker, characterized in that, include: Multiple preset exposure tables and historical exposure parameters are obtained, and each preset exposure table corresponds to a different light source frequency; Based on the first exposure table corresponding to the historical exposure parameters, a first image is obtained, wherein the first exposure table is an exposure table among the plurality of preset exposure tables; Based on the spatial characteristics of the first image, determine whether the first image has flickering characteristics; If the first image has flickering characteristics, switch to the second exposure table and use the second exposure table as the target exposure table. The second exposure table is an exposure table that is different from the first exposure table among the plurality of preset exposure tables. Based on the target exposure table, adjust the exposure parameters to obtain a flicker-free image.
2. The method according to claim 1, characterized in that, The process of obtaining the first image based on the first exposure table corresponding to the historical exposure parameters includes: Based on the first exposure table, multiple second images are obtained; Based on the multiple second images, determine whether the shooting scene has changed; If the shooting scene remains unchanged, any one of the multiple second images from which it is successfully determined that the shooting scene has not changed is taken as the first image.
3. The method according to claim 2, characterized in that, The step of determining whether the shooting scene has changed based on the multiple second images includes: For any two adjacent images among the plurality of second images, it is determined whether the shooting scene has changed based on the content, lighting characteristics, and position information of the two adjacent images.
4. The method according to any one of claims 1-3, characterized in that, The determination of whether the first image has flicker features based on the spatial domain features of the first image includes: Obtain the brightness difference between any horizontally adjacent pixels, vertically adjacent pixels, or diagonally adjacent pixels in the first image; Based on the brightness difference and brightness difference threshold, it is determined whether the first image has flickering characteristics.
5. The method according to claim 4, characterized in that, The method further includes: Obtain the intensity of the current ambient light; The brightness difference threshold is adjusted based on the intensity of the current ambient light.
6. The method according to any one of claims 1-5, characterized in that, The step of switching to the second exposure table when the first image exhibits flickering characteristics, and using the second exposure table as the target exposure table, includes: If the first image exhibits flickering characteristics, switch to the second exposure table; Based on the second exposure table, multiple third images are obtained; Based on the multiple third images, determine whether the shooting scene has changed; If the shooting scene remains unchanged, based on the spatial characteristics of the fourth image, it is determined whether the fourth image has flicker characteristics. The fourth image is any one of the multiple third images from which it is successfully determined that the shooting scene has not changed. If the fourth image does not exhibit flicker characteristics, the second exposure table will be used as the target exposure table.
7. An image flicker elimination device, characterized in that, The device includes: The acquisition module is used to acquire multiple preset exposure tables and historical exposure parameters, wherein each preset exposure table corresponds to a different light source frequency; The generation module is used to obtain a first image based on the first exposure table corresponding to the historical exposure parameters, wherein the first exposure table is an exposure table among the plurality of preset exposure tables; The judgment module is used to determine whether the first image has flickering features based on the spatial features of the first image; The switching module is used to switch to the second exposure table when the first image has flickering characteristics, and to use the second exposure table as the target exposure table. The second exposure table is an exposure table that is different from the first exposure table among the plurality of preset exposure tables. The adjustment module is used to adjust the exposure parameters based on the target exposure table to obtain a flicker-free image.
8. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.