Image processing method and device, storage medium and electronic device

By identifying and adjusting the image flicker phenomenon of the CMOS sensor camera, using two-dimensional Gabor transform and Fourier transform to identify brightness rolling stripes, and adjusting the exposure time and acquisition parameters, the problem of unnatural color transitions caused by image flicker is solved and image quality is improved.

CN119136061BActive Publication Date: 2025-10-03ZHEJIANG DAHUA TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411312670.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-10-03
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

In the prior art, when a CMOS sensor camera experiences image flicker in a shooting environment, the color transition of the image displayed is unnatural.

Method used

By acquiring images from an image acquisition device, the image flicker phenomenon is identified and the exposure time and acquisition parameters are adjusted, including using two-dimensional Gabor transform and Fourier transform to identify brightness rolling stripes, and adjusting the exposure time and image acquisition parameters to eliminate the flicker phenomenon.

Benefits of technology

The accuracy of image flicker recognition is improved, image quality is improved, and more natural color transitions and higher-quality image acquisition are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119136061B_ABST
    Figure CN119136061B_ABST
Patent Text Reader

Abstract

The present application discloses an image processing method and apparatus, a storage medium, and an electronic device. The method comprises: acquiring a first image captured by an image acquisition device in the i-th time frame; performing image flicker recognition on the first image, and if image flicker occurs in the first image, updating the first exposure time to a second exposure time, and acquiring a second image captured by the image acquisition device in the i+j-th time frame; performing image flicker recognition on the second image, and if image flicker does not occur in the second image, determining a first target image acquisition parameter based on the first ambient brightness of the second image and a predetermined target brightness, and setting the image acquisition device according to the first target image acquisition parameter. The present application solves the technical problem in the related art of unnatural color transitions in image display when correcting image flicker.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to an image processing method and device, a storage medium, and an electronic device. Background Art

[0002] Because CMOS sensor cameras often exhibit rolling horizontal stripes of light and dark brightness in the images they capture under certain shooting conditions, also known as image flicker, related technologies primarily use a sinusoidal curve to perform pixel correction on the brightness of each row of pixels in each frame of image data. However, since the correction coefficients for pixel correction are often based on the image data of the current frame without reference to historical image data, related technologies suffer from the technical problem of unnatural color transitions in image display.

[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0004] The embodiments of the present application provide an image processing method and device, a storage medium, and an electronic device to at least solve the technical problem in the related art of unnatural color transition of image display when correcting image flicker.

[0005] According to one aspect of an embodiment of the present application, there is provided an image processing method, comprising: acquiring a first image acquired by an image acquisition device at an i-th time frame, wherein the first image represents an image acquired according to a first exposure time, and i is a positive integer; performing image flicker recognition on the first image, and when image flicker occurs in the first image, updating the first exposure time to a second exposure time, and acquiring a second image acquired by the image acquisition device at an i+j-th time frame, wherein the second exposure time is longer than the first exposure time, and the occurrence of the image flicker in the first image indicates that, during a process of calculating gradient values ​​row by row for a first frequency domain feature image corresponding to the first image, gradient values ​​corresponding to any two adjacent rows satisfy a preset condition. The second image represents an image captured according to the second exposure time, and j is a positive integer less than or equal to i; the image flicker identification is performed on the second image, and when the image flicker phenomenon does not occur in the second image, the first target image capture parameters are determined based on the first ambient brightness of the second image and a predetermined target brightness, and the image capture device is set according to the first target image capture parameters, wherein the fact that the image flicker phenomenon does not occur in the second image indicates that, during the process of calculating the gradient values ​​row by row in the second frequency domain feature image corresponding to the second image, the gradient values ​​corresponding to any two adjacent rows do not meet the preset condition, and the target brightness represents the ambient brightness of the image captured by the image capture device without the image flicker phenomenon.

[0006] According to another aspect of an embodiment of the present application, an image processing device is further provided, comprising: an acquisition module for acquiring a first image acquired by an image acquisition device in an i-th time frame, wherein the first image represents an image acquired according to a first exposure time, and i is a positive integer; an execution module for performing image flicker recognition on the first image, and in the case where image flicker occurs in the first image, updating the first exposure time to a second exposure time, and acquiring a second image acquired by the image acquisition device in an i+j-th time frame, wherein the second exposure time is longer than the first exposure time, and the occurrence of the image flicker in the first image indicates that, in the process of calculating the gradient value row by row of the first frequency domain feature image corresponding to the first image, the gradient values ​​corresponding to any two adjacent rows meet a predetermined value. Assume that the second image represents an image captured according to the second exposure time, j is a positive integer less than or equal to i; a processing module is used to perform the image flicker identification on the second image, and when the second image does not have the image flicker phenomenon, determine the first target image acquisition parameters based on the first ambient brightness of the second image and a predetermined target brightness, and set the image acquisition device according to the first target image acquisition parameters, wherein the fact that the second image does not have the image flicker phenomenon means that, during the process of calculating the gradient values ​​row by row of the second frequency domain feature image corresponding to the second image, the gradient values ​​corresponding to any two adjacent rows do not meet the preset condition, and the target brightness represents the ambient brightness of the image captured by the image acquisition device without the image flicker phenomenon.

[0007] Optionally, the device is used to obtain a first image captured by an image acquisition device in the i-th time frame in the following manner, including: obtaining an initial image captured by the image acquisition device in the i-th time frame; performing a chroma removal operation on the initial image to obtain a brightness information image; performing a negation operation on the brightness value of each pixel in the brightness information image to determine the first image, wherein the brightness value of each pixel in the first image is the difference between the brightness value of each pixel in the brightness information image and a preset pixel brightness value.

[0008] Optionally, the device is used to perform image flicker recognition on the first image in the following manner: when image flicker occurs in the first image, the first exposure time is updated to a second exposure time, and a second image captured by the image acquisition device at the i+jth time frame is obtained, including: converting the pixel value of each pixel point in the first image from the spatial domain to the frequency domain to obtain the first frequency domain feature image, wherein the first frequency domain feature image represents an image containing horizontal stripe frequency characteristics; determining the pixel cumulative value corresponding to each row of the first frequency domain feature image row by row along the horizontal direction, using the pixel cumulative value to determine m corresponding gradient values ​​in the first frequency domain feature image, and determining the gradient average value based on the m gradient values, and determining the gradient average value based on the gradient average value. whether image flicker occurs in the first image, m is a positive integer, and the first frequency domain feature image includes m+1 rows of pixels; if image flicker occurs in the first image, the first exposure time is updated to a second exposure time, and the second image captured by the image acquisition device in the i+jth time frame is obtained, and a second target image acquisition parameter is determined based on a second ambient brightness of the first image and a predetermined second target brightness, and the image acquisition device is set according to the second target image acquisition parameter, wherein the second ambient brightness and the second target brightness both correspond to the first exposure time; if the image flicker does not occur in the first image, the image acquisition device captures the second image according to the first exposure time.

[0009] Optionally, the device is used to convert the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain to obtain the first frequency domain feature image in the following manner, including: converting the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain to obtain an intermediate frequency domain feature image; performing a filtering operation on the intermediate frequency domain feature image to obtain the first frequency domain feature image.

[0010] Optionally, the device is used to convert the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain to obtain the first frequency domain feature image in the following manner, including: converting the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain based on the two-dimensional Gabor transform to obtain the first frequency domain feature image; or converting the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain based on the Fourier transform to obtain the first frequency domain feature image.

[0011] Optionally, the device is used to convert the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain based on the two-dimensional Gabor transform in the following manner to obtain the first frequency domain feature image, including: obtaining the pixel values ​​of each pixel point in the first image; performing the two-dimensional Gabor transform on the pixel values ​​of each pixel point in the first image based on the target window function, and adding amplitude information and phase information to each pixel point in the first image, wherein the target window function is used to determine the transformation range of the Gabor filter in the two-dimensional Gabor transform on the first image; and determining the first frequency domain feature image based on each pixel point in the first image to which the amplitude information and the phase information are added.

[0012] Optionally, the device is used to determine the cumulative values ​​of pixels corresponding to each row of the first frequency domain feature image row by row along the horizontal direction in the following manner, use the pixel cumulative values ​​to determine m corresponding gradient values ​​in the first frequency domain feature image, and determine n gradient averages based on the m gradient values, and determine whether image flickering has occurred in the first image based on the n gradient averages, including: adding the pixel values ​​of each row to the first pixel of each row in sequence along the horizontal direction to obtain m+1 pixel cumulative values; determining the m gradient values ​​based on the pixel cumulative values ​​corresponding to each two adjacent rows; determining the gradient average based on the m gradient values, wherein one gradient average among the gradient averages is determined by n adjacent gradient values, n is a positive integer, n≤m; and determining whether image flickering has occurred in the first image based on whether the product of any two gradient averages among the gradient averages is greater than a second preset threshold.

[0013] Optionally, the device is used to perform image flicker recognition on the second image in the following manner: when the image flicker phenomenon does not occur in the second image, determine the first target image acquisition parameters based on the first ambient brightness of the second image and a predetermined target brightness, and set the image acquisition device according to the first target image acquisition parameters, including: when the image flicker phenomenon does not occur in the second image, determine the first ambient brightness; determine the target brightness difference based on the first ambient brightness and the target brightness; based on a predetermined mapping relationship set, determine the first target image acquisition parameters from a set of target image acquisition parameters according to the target brightness difference, wherein the mapping relationship set includes the set of target image acquisition parameters, a set of brightness differences, and a mapping relationship between the set of target image acquisition parameters and the set of brightness differences, and the set of brightness differences includes the target brightness difference; set the image acquisition device according to the first target image acquisition parameters.

[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned image processing method when running.

[0015] According to another aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described image processing method.

[0016] According to another aspect of the embodiments of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the image processing method through the computer program.

[0017] In an embodiment of the present application, a first image captured by an image acquisition device at an i-th time frame is acquired, wherein the first image represents an image captured according to a first exposure time, and i is a positive integer; image flicker recognition is performed on the first image, and when image flicker occurs in the first image, the first exposure time is updated to a second exposure time, and a second image captured by the image acquisition device at an i+j-th time frame is acquired, wherein the second exposure time is longer than the first exposure time, and image flicker occurs in the first image, indicating that in the process of calculating the gradient value row by row of the first frequency domain feature image corresponding to the first image, the gradient values ​​corresponding to any two adjacent rows meet a preset condition, and the second image represents an image captured according to the second exposure time, and j is a positive integer less than or equal to i; image flicker recognition is performed on the second image, and when image flicker does not occur in the second image In the case of flickering, the first target image acquisition parameters are determined based on the first ambient brightness of the second image and the predetermined target brightness, and the image acquisition device is set according to the first target image acquisition parameters, wherein the second image does not have the image flicker phenomenon, which means that in the process of calculating the gradient values ​​of the second frequency domain feature image corresponding to the second image row by row, the gradient values ​​corresponding to any two adjacent rows do not meet the preset conditions, and the target brightness represents the ambient brightness of the image captured by the image acquisition device without the image flicker phenomenon. By adjusting the exposure time and acquisition parameters, the purpose of improving the flicker recognition accuracy and improving the image quality is achieved, thereby achieving the technical effect of more natural color transition and higher quality image acquisition, and thus solving the technical problem of unnatural color transition of image display when correcting image flickering in the related technology. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 is a schematic diagram of an application environment of an optional image processing method according to an embodiment of the present application;

[0020] Figure 2 is a flowchart of an optional image processing method according to an embodiment of the present application;

[0021] Figure 3 is a schematic diagram of an optional image processing method according to an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0023] Figure 5 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0024] Figure 6 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0025] Figure 7 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0026] Figure 8 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0027] Figure 9 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0028] Figure 10 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0029] Figure 11 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0030] Figure 12 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

[0031] Figure 13 is a schematic structural diagram of an optional image processing device according to an embodiment of the present application;

[0032] Figure 14is a schematic structural diagram of an optional image processing product according to an embodiment of the present application;

[0033] Figure 15 It is a schematic structural diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0035] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0036] The present application will be described below with reference to the following embodiments:

[0037] According to one aspect of an embodiment of the present application, a method for processing an image is provided. Optionally, in this embodiment, the above-mentioned method for processing an image can be applied to Figure 1 In the hardware environment composed of the server 101 and the terminal device 103 shown in FIG. Figure 1As shown, the server 101 is connected to the terminal 103 via a network and can be used to provide services for the terminal device or the application 107 installed on the terminal device. The application can be a video application, instant messaging application, browser application, educational application, game application, etc. A database 105 may be set up on the server or independently of the server to provide data storage services for the server 101, for example, a game data storage server. The above-mentioned network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The terminal device 103 may be a terminal configured with an application, and may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop computer, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a virtual reality (VR) terminal, an augmented reality (AR) terminal, a mixed reality (MR) terminal and other computer devices. The above-mentioned server may be a single server, a server cluster consisting of multiple servers, or a cloud server.

[0038] Combine Figure 1 As shown, the above-mentioned image processing method can be executed by an electronic device, which can be a terminal device or a server. The above-mentioned image processing method can be implemented by the terminal device or the server separately, or by the terminal device and the server together.

[0039] The above is only an example and is not specifically limited in this embodiment.

[0040] Alternatively, as an optional implementation, Figure 2 As shown, the image processing method includes:

[0041] S202, acquiring a first image captured by an image capture device in an i-th time frame, wherein the first image represents an image captured according to a first exposure time, and i is a positive integer;

[0042] Optionally, in an embodiment of the present application, the above-mentioned image acquisition device may include but is not limited to a camera, a surveillance camera, a smart phone, a tablet, a computer, etc. The above-mentioned first exposure time refers to the exposure time set by the image acquisition device when taking the above-mentioned first image, and the exposure time refers to the length of time that the camera shutter is open and allows light to enter.

[0043] Exemplarily, the first image refers to a frame of image corresponding to any time frame captured by the image acquisition device at the first exposure time, and may include but is not limited to any object in the visible area that can be captured by the image acquisition device.

[0044] S204, performing image flicker recognition on the first image. If image flicker occurs in the first image, updating the first exposure time to a second exposure time, and acquiring a second image captured by the image capture device in the (i+j)th time frame, wherein the second exposure time is longer than the first exposure time. The occurrence of image flicker in the first image indicates that, during a process of calculating gradient values ​​row by row in a first frequency domain feature image corresponding to the first image, gradient values ​​corresponding to any two adjacent rows satisfy a preset condition. The second image represents an image captured according to the second exposure time, and j is a positive integer less than or equal to i.

[0045] Optionally, in an embodiment of the present application, the above-mentioned image flicker recognition is used to identify whether the first image has a screen flicker problem, the above-mentioned second exposure time is different from the above-mentioned first exposure time, the above-mentioned second image may also include but is not limited to any object in the visible area that can be captured by the image acquisition device, and the above-mentioned gradient value calculation may be implemented but is not limited to by template walking.

[0046] For example, Figure 3 FIG. 1 is a schematic diagram of an optional image processing method according to an embodiment of the present application. The above-mentioned image flicker recognition process may include but is not limited to the following: Figure 3 As shown, including but not limited to:

[0047] S302, start;

[0048] S304: Obtain the current frame image I (the first image) of the camera. Considering the image flicker phenomenon, the image has brightness changes. Therefore, the influence of the color component is eliminated and the image brightness information is extracted for processing. The specific steps are as follows:

[0049] If the image format is RGB, you need to convert RGB to YUV to obtain an image containing only brightness information, that is, according to Y = 0.298 × R + 0.612 × G + 0.117 × B, and calculate the corresponding brightness value based on each pixel value. If the image format type has brightness information (for example: YUV, YCrCb, etc.), no conversion is required, and you can directly obtain an image containing only brightness information, that is, I y ;

[0050] It should be noted that if the image format type of the above-mentioned first image carries brightness information (for example: YUV (YUV decomposes color into Y (brightness component), U (blue chrominance component) and V (red chrominance component)), YCrCb (YCbCr decomposes color into Y (brightness component), Cb (blue chrominance component), Cr (red chrominance component)), etc.), then no conversion is required, and an image containing only brightness information is directly obtained, that is, I_y (Y (brightness component)).

[0051] S306: Considering that the brightness rolling horizontal stripe feature of the first image with the flickering phenomenon is a black stripe, in order to highlight the texture feature in the image, it is necessary to adjust the brightness information image I y Perform preprocessing, that is: obtain I y Maximum value I max , will I max With image I y Subtract the pixel values ​​in and perform the inverse operation on the image to obtain the corresponding image I′ y That is, the inversion operation is performed on each pixel of the first image (255-original pixel brightness value) to obtain the corresponding brightness information image I' y ;

[0052] S308: Considering that the image flickering in the picture is manifested as brightness rolling at a certain frequency, the brightness information image I′ obtained in S1 is converted to y Convert to the frequency domain for analysis to identify image flicker frequency characteristics, specifically:

[0053] Since the related art performs Fourier transform on the image to obtain the frequency domain image for analysis, this patent considers that the Fourier transform is actually an integration process of the entire time domain, that is, the time domain signal is averaged on the entire time axis. This is feasible for stable image information. However, the brightness rolling stripes in the actual camera image are fused with the noise signal, which is a non-stationary signal. For non-stationary signals with significant changes in time, the Fourier transform cannot accurately analyze and identify the frequency information of the brightness rolling stripes.

[0054] That is, the brightness information image I is transformed into the image by using the two-dimensional Gabor transform (two-dimensional Gaussian-Rayleigh transform, which convolves the image with a set of complex exponential functions with different directions, frequencies and scales to extract the local features of the image). y ' is divided into many small time intervals, and a local Fourier transform analysis is performed on each time interval to determine the frequency characteristics existing in the time interval. The target window function used for Gabor transform can include but is not limited to Gaussian function. The specific transformation formula is:

[0055]

[0056] Among them, the real part is the amplitude information in the two-dimensional Gabor transform, which is used to extract the brightness information image I′ y The texture and edge information can be expressed as:

[0057] The imaginary part is the phase information in the Gabor transform, which is used to extract the brightness information image I′ y The direction information can be expressed as:

[0058]

[0059] In addition, x and y are spatial domain variables (used to determine the position of the Gabor kernel function on the image), λ is the wavelength of the tuning function (defining the oscillation characteristics of the Gabor kernel function, corresponding to the spatial frequency of the image), which cannot be greater than 1 / 5 of the pixel size of the input image, and θ is the direction of the Gabor kernel function, with a value range of [0,360°]. is the phase shift of the tuning function (defining the phase change of the Gabor kernel function in space, corresponding to the local features of the image), with a value of [-180°, 180°], σ is the bandwidth, that is, the standard deviation of the Gaussian function, and γ is the pixel aspect ratio of the pixel space of the image, with a value range of (0, 1].

[0060] S310, combining the direction of the brightness flickering rolling stripes with Gabor transform according to Step 2, you can get the corresponding image containing the frequency characteristics of the stripes Count the pixel accumulation values ​​row by row along the horizontal direction, specifically:

[0061] Count the pixel accumulation values ​​horizontally, and add up the brightness values ​​of each pixel in each row to get the pixel accumulation value of each row (the pixel value without chromaticity information is the brightness value). The pixel accumulation value of each row corresponds to the first pixel position of each row, that is, each pixel in the first column of the filtered image corresponds to the pixel accumulation value of each row;

[0062] Furthermore, removing the image The number of lines of the horizontal boundary is preset to reduce the interference of incomplete image information on the recognition results; in addition, consider the inverted image I′ y The rolling stripe feature of medium brightness is an obvious bright band, so the brightness rolling stripe screening threshold T can be set. r The pixel accumulation value in the horizontal direction is calculated according to T r =I max ×n×ratio to further filter and get the filtered image (the first frequency domain feature image mentioned above).

[0063] Where n is the number of image columns, ratio is the maximum brightness percentage, and its value range is (0,1].

[0064] S312, filtering the image Gradient values ​​are calculated row by row. That is, the gradient values ​​of the first frequency domain feature image are calculated row by row. In order to reduce the influence of residual noise frequency information (that is, to reduce the influence of local minimum extreme points when the gradient value changes), a template walking method can be used for statistical analysis. Specifically:

[0065] Statistical average value ΔS of m gradient values avg (The value of m must be at least greater than 1. When the value of m is too large, the operation speed is slow and the accuracy of detecting gradient extreme points is low. Therefore, the value of m should not exceed 10% of the length of the image in the horizontal direction).

[0066] S314, determine whether the product of the front and back gradient values ​​is a negative number, if so, execute S316, otherwise execute S318;

[0067] Specifically, since the gradient value has directionality, when ΔS avg Compared with the previous segment ΔS′ avg When the product is negative (the above preset condition), it is considered that there are brightness rolling stripes in the first image, that is, there is a screen flickering phenomenon in the image. avg Compared with the previous segment ΔS′ avg When the multiplication is always positive, there is no screen flickering in the first image;

[0068] For example, assuming m=3:

[0069] The difference between the accumulated pixel value of the first row and the accumulated pixel value of the second row is A, and the difference between the accumulated pixel value of the second row and the accumulated pixel value of the third row is B. ΔS avg =(A+B) / 2, then the previous segment ΔS′ avg = 0 (for the initial gradient, there is no previous ΔS′ avg , can be preset to a value = 0);

[0070] Then loop through each row:

[0071] The difference between the accumulated pixel value of the fourth row and the accumulated pixel value of the third row is C;

[0072] ΔS avg =(B+C) / 2, then the previous segment ΔS′ avg =(A+B) / 2;

[0073] As long as there is a corresponding ΔS avg *ΔS′avg <0, that is, there is screen flickering.

[0074] S316: The first image has a flickering phenomenon;

[0075] S318: There is no screen flickering in the first image;

[0076] S320, end.

[0077] In an exemplary embodiment, Figure 4 This is a schematic diagram of an optional image processing method according to an embodiment of the present application. If the first image has a screen flickering phenomenon, it can be as follows Figure 4 As shown, the image parameters of the first image are adjusted, and the exposure time of the next frame when the image is captured is adjusted, or only the exposure time of the next frame when the image is captured is adjusted, and the image parameters of the first image do not need to be adjusted. This application is not limited to this. For example, the image parameters of the first image are adjusted, and the exposure time of the next frame when the image is captured is adjusted, as shown. Figure 4 As shown:

[0078] S402, start;

[0079] S404, determining whether the first image has image flickering, if so, executing S406, otherwise executing S410;

[0080] S406, changing the exposure time of the next frame image acquisition device, specifically:

[0081] Based on the frequency characteristics of the light source, the exposure time is changed in a certain step size. For example, the exposure time is updated according to a fixed exposure path of 8.3ms, 10ms, 16.6ms, 20ms, 33.3ms, etc. Or the exposure time is automatically updated in a fixed step size (or a regular step size change method) from the minimum exposure time supported by each sensor, so that the first exposure time is adjusted to the second exposure time. For example, if the first exposure time is 8.3ms, the above second exposure time can be adjusted to 10ms.

[0082] S408: Adjust image parameters of the first image, specifically:

[0083] The image flicker phenomenon is eliminated by changing the exposure time, and the image parameters of the first image are corrected according to the linkage mapping relationship between the target brightness difference between the first image brightness and the target brightness and the image parameters, for example:

[0084] Obtain the linkage mapping relationship between the difference between the preset different ambient brightness and the target brightness, and the image parameters (such as contrast, brightness, saturation, etc.). The mapping relationship can be a linear relationship or a nonlinear relationship. Combined with the mapping relationship, the image parameters of the first image are adaptively adjusted to optimize the overbrightness of the picture, thereby improving the quality of image display.

[0085] S410, end.

[0086] S206. Perform image flicker recognition on the second image. When no image flicker occurs in the second image, determine first target image acquisition parameters based on the first ambient brightness of the second image and a predetermined target brightness, and set the image acquisition device according to the first target image acquisition parameters. The fact that no image flicker occurs in the second image indicates that, during a process of calculating gradient values ​​row by row for a second frequency domain feature image corresponding to the second image, gradient values ​​corresponding to any two adjacent rows do not satisfy a preset condition. The target brightness indicates the ambient brightness of the image captured by the image acquisition device without the image flicker phenomenon.

[0087] Optionally, in an embodiment of the present application, the above-mentioned first ambient brightness refers to the image brightness when the second image is captured, and the above-mentioned target brightness refers to the image brightness without screen flickering under the current light source environment. The above-mentioned first target image acquisition parameters may include but are not limited to image contrast, brightness, saturation, etc.

[0088] Furthermore, considering that the image is generally in a high-brightness environment when flickering occurs and the gain has reached the minimum value, when each frame recognizes the flickering phenomenon, its target brightness remains unchanged. Therefore, the ambient brightness difference (the above-mentioned target brightness difference) when the exposure time changes is obtained, for example: ambient brightness difference = current frame image statistical brightness - target brightness. Then, due to the change in exposure time, the picture will gradually become brighter. Therefore, considering the problem of brighter picture caused by eliminating the flickering phenomenon, this application adopts a method of linking image parameters according to different environmental differences to optimize image quality until there is no flickering phenomenon in the image and the brightness is displayed naturally and the color transition is soft.

[0089] In an exemplary embodiment, Figure 5 is a schematic diagram of another optional image processing method according to an embodiment of the present application. The image processing method proposed in the present application can be as follows Figure 5 As shown:

[0090] S502, start;

[0091] S504: Acquire an image captured by a camera (the above-mentioned image acquisition device) and perform image flicker recognition on the image. Specifically:

[0092] And through the RGB to YUV formula, Figure 6 This is a schematic diagram of another optional image processing method according to an embodiment of the present application. For an image containing only brightness information, Figure 6 As shown;

[0093] Next, the image is inverted to obtain an inverted image, highlighting the edge information of the brightness flickering rolling horizontal stripes. Figure 7 is a schematic diagram of another optional image processing method according to an embodiment of the present application, wherein the inverted image is as follows: Figure 7 As shown; perform a two-dimensional Gabor transform on the inverted image to obtain the frequency feature information in the horizontal direction, wherein the Gabor transform may include but is not limited to setting λ to 30, θ to 0 in the horizontal direction, φ to 0, σ to 4, and γ to 0.2, Figure 8 This is a schematic diagram of another optional image processing method according to an embodiment of the present application. The frequency characteristic information diagram in the horizontal direction after Gabor transformation is as follows: Figure 8 As shown;

[0094] Furthermore, 10 rows of pixels at the upper and lower boundaries of the image obtained by S3 are removed to reduce the interference of incomplete image information at the boundaries on the recognition results. The number of columns corresponding to the image and the maximum brightness value are set, and the ratio is taken as 0.8. The brightness rolling horizontal stripe screening threshold T is calculated and set. r , the pixel accumulation value in the horizontal direction is further filtered to obtain the filtered frequency domain feature image, Figure 9 This is a schematic diagram of another optional image processing method according to an embodiment of the present application. The frequency domain feature image after further screening is as follows: Figure 9 As shown, Figure 10 This is a schematic diagram of another optional image processing method according to an embodiment of the present application, corresponding to the cumulative distribution diagram of pixels in the horizontal direction as shown in FIG. Figure 10 As shown;

[0095] S506, determine whether there is image flickering: calculate the gradient value of the filtered frequency domain feature image line by line, set the template width m to 5, calculate the product of the gradient value difference between the front and back segments, and combine Figure 10 It can be seen that there is a case where the product is a negative number, which determines that the current image has image flickering;

[0096] S508: If there is image flicker, the exposure time of the next frame is updated according to a certain regular exposure path. Specifically, the exposure time is updated from 8.3ms, 10ms, 16.6ms, 20ms, 33.3ms, etc. The current camera frame rate is 25 frames. When the exposure time is adjusted to 10ms, the actual power frequency is 50HZ. The image flicker detection result shows that there is no screen flicker. The detection result is consistent with the actual environment. However, due to the limited exposure time of the camera, the image is overexposed. Figure 11 is a schematic diagram of another optional image processing method according to an embodiment of the present application, such as Figure 11 As shown;

[0097] S510, adaptive adjustment of image parameters, specifically:

[0098] The camera combines the pre-calibrated interpolation between different ambient brightness and target brightness and the mapping relationship between the linkage strength of ISP parameters (brightness, contrast, gamma curve). Taking the linear mapping relationship of this patent as an example, the basic value of the linkage of image parameters (brightness, contrast, gamma curve) is the parameter of the normal camera in the stage without image flicker. Adaptive optimization is performed for the effect of blurred image. Figure 12 This is a schematic diagram of another optional image processing method according to an embodiment of the present application, and the corresponding effect image is obtained as follows Figure 12 shown.

[0099] S512, end.

[0100] According to an embodiment of the present application, a first image captured by an image acquisition device in an i-th time frame is acquired, wherein the first image represents an image captured according to a first exposure time, and i is a positive integer; image flicker recognition is performed on the first image, and when image flicker occurs in the first image, the first exposure time is updated to a second exposure time, and a second image captured by the image acquisition device in an i+j-th time frame is acquired, wherein the second exposure time is longer than the first exposure time, and image flicker occurs in the first image, indicating that in the process of calculating the gradient value row by row of the first frequency domain feature image corresponding to the first image, the gradient values ​​corresponding to any two adjacent rows meet a preset condition, and the second image represents an image captured according to the second exposure time, and j is a positive integer less than or equal to i; image flicker recognition is performed on the second image, and no image flicker occurs in the second image. In the case of the image flicker phenomenon, the first target image acquisition parameters are determined based on the first ambient brightness of the second image and the predetermined target brightness, and the image acquisition device is set according to the first target image acquisition parameters, wherein the second image does not have the image flicker phenomenon, which means that in the process of calculating the gradient values ​​of the second frequency domain feature image corresponding to the second image row by row, the gradient values ​​corresponding to any two adjacent rows do not meet the preset conditions, and the target brightness represents the ambient brightness of the image captured by the image acquisition device without the image flicker phenomenon. By adjusting the exposure time and acquisition parameters, the purpose of improving the flicker recognition accuracy and improving the image quality is achieved, thereby achieving the technical effect of more natural color transition and higher quality image acquisition, and further solving the technical problem in the related art that the accuracy of identifying image flicker is low, resulting in unnatural color transition of image display.

[0101] As an optional solution, the above-mentioned acquisition of the first image captured by the image acquisition device in the i-th time frame includes: acquiring the initial image captured by the above-mentioned image acquisition device in the above-mentioned i-th time frame; performing a chroma removal operation on the above-mentioned initial image to obtain a brightness information image; performing a negation operation on the brightness value of each pixel point in the above-mentioned brightness information image to determine the above-mentioned first image, wherein the brightness value of each pixel point in the above-mentioned first image is the difference between the brightness value of each pixel point in the above-mentioned brightness information image and the preset pixel brightness value.

[0102] Optionally, in an embodiment of the present application, the above-mentioned initial image refers to an image directly captured by the image acquisition device without any preprocessing operation, and the above-mentioned chroma removal operation refers to converting the initial image from the RGB color space to the YUV color space, wherein the YUV color space is a color space that separates brightness information from chroma information, wherein the Y component represents brightness, and the U and V components represent chroma. The U and V components are removed and only the Y component is retained to obtain an image containing only brightness information, that is, the above-mentioned brightness information image.

[0103] Optionally, in an embodiment of the present application, the above-mentioned inversion operation can be understood as subtracting the brightness value of each of the above-mentioned pixel points (the pixel value of each pixel point in the image after the chroma removal operation is the brightness value of each pixel point here) from the above-mentioned preset pixel brightness value (taking an 8-bit image as an example, the maximum value of the image color channel is 255), and re-determining the obtained value as the brightness value of each pixel point.

[0104] In an exemplary embodiment, the above inversion operation may invert the brightness value of each pixel point from the range of 0 to 255, that is, if the original brightness value is x, the inverted brightness value is 255-x.

[0105] Through the embodiments of the present application, a brightness information image containing only brightness information can be obtained, in which the brightness value of each pixel is the result of chromaticity removal, inversion and preset pixel brightness value adjustment, which facilitates subsequent image flicker recognition operations, avoids the influence of color information, and improves recognition accuracy.

[0106] As an optional solution, the above-mentioned image flicker recognition is performed on the above-mentioned first image. When image flicker occurs in the above-mentioned first image, the above-mentioned first exposure time is updated to the second exposure time, and the second image captured by the above-mentioned image acquisition device in the i+jth time frame is obtained, including: converting the pixel value of each pixel point in the above-mentioned first image from the spatial domain to the frequency domain to obtain the above-mentioned first frequency domain feature image, wherein the above-mentioned first frequency domain feature image represents an image containing horizontal stripe frequency characteristics; determining the pixel cumulative value corresponding to each row of the above-mentioned first frequency domain feature image row by row along the horizontal direction, using the above-mentioned pixel cumulative value to determine m corresponding gradient values ​​in the above-mentioned first frequency domain feature image, and determining the gradient average value based on the above-mentioned m gradient values, and determining the above-mentioned first frequency domain feature image based on the above-mentioned gradient average value. Whether an image has image flickering, m is a positive integer, and the above-mentioned first frequency domain feature image includes m+1 rows of pixels; if the above-mentioned first image has image flickering, the above-mentioned first exposure time is updated to the second exposure time, and the second image captured by the above-mentioned image acquisition device in the i+jth time frame is obtained, and the second target image acquisition parameters are determined based on the second ambient brightness of the above-mentioned first image and the predetermined second target brightness, and the above-mentioned image acquisition device is set according to the above-mentioned second target image acquisition parameters, wherein the above-mentioned second ambient brightness and the above-mentioned second target brightness both correspond to the above-mentioned first exposure time; if the above-mentioned first image has not image flickering, the above-mentioned image acquisition device captures the above-mentioned second image according to the above-mentioned first exposure time.

[0107] Optionally, in an embodiment of the present application, the above-mentioned spatial domain refers to pixel space, the above-mentioned frequency domain refers to frequency space, the image information in the above-mentioned first frequency domain feature image includes frequency feature information, such as phase information and frequency information, etc. The above-mentioned horizontal stripe frequency feature refers to the periodic horizontal stripes appearing in the image, which may be caused by certain problems of the image acquisition device, such as inaccurate exposure time, sensor noise, etc. The second ambient brightness refers to the image brightness of the first image, and the above-mentioned second target brightness refers to the brightness of the target image corresponding to the first exposure time. There is no image flickering phenomenon in the target image. The above-mentioned second target image acquisition parameters may include but are not limited to image contrast, saturation, etc.

[0108] In an exemplary embodiment, it is assumed that an image acquisition device is used to acquire a first image in the i-th time frame with an exposure time of T1. Then, image flicker recognition is performed on the first image:

[0109] a. converting the pixel value of each pixel in the first image from the spatial domain to the frequency domain to obtain a first frequency domain feature image;

[0110] b. Determine the accumulated pixel values ​​corresponding to each row of the first frequency domain feature image row by row along the horizontal direction;

[0111] c. Use the pixel cumulative value to determine the m corresponding gradient values ​​in the first frequency domain feature image (assuming m = 5);

[0112] d. Determining n gradient averages based on the m gradient values; if the product of any two gradient averages among the n gradient averages is negative, it is considered that image flicker has occurred in the first image;

[0113] Furthermore, if the first image experiences image flickering:

[0114] a. Update the first exposure time T1 to the second exposure time T2.

[0115] b. Determine the second target image acquisition parameters (eg, image saturation, contrast, etc.) based on the second environment brightness (assumed to be L2) of the first image and the predetermined second target brightness (assumed to be B2).

[0116] c. Set the exposure time of the image acquisition device according to the second exposure time T2, and obtain the second image acquired by the image acquisition device in the i+jth time frame (assuming j=1).

[0117] On the contrary, if the first image does not have an image flickering phenomenon, the image acquisition device may continue to acquire images according to the first exposure time T1.

[0118] Repeat the above process to continue acquiring images in subsequent time frames, and perform image flicker recognition and exposure time update.

[0119] Through the embodiments of the present application, image flicker recognition and correction can be performed independently on each frame of captured image, thereby effectively identifying image flicker phenomena and adjusting exposure time or image acquisition parameters according to the flicker phenomena to improve image quality.

[0120] As an optional solution, the above-mentioned converting the pixel values ​​of each pixel point in the above-mentioned first image from the spatial domain to the frequency domain to obtain the above-mentioned first frequency domain feature image includes: converting the pixel values ​​of each pixel point in the above-mentioned first image from the spatial domain to the frequency domain to obtain an intermediate frequency domain feature image; performing a filtering operation on the above-mentioned intermediate frequency domain feature image to obtain the above-mentioned first frequency domain feature image.

[0121] Optionally, in the embodiment of the present application, the intermediate frequency domain feature image can be obtained by performing a two-dimensional Gabor transform on an image with only luminance information removed from the chromaticity information to obtain a corresponding intermediate frequency domain feature image containing horizontal stripe frequency characteristics, which can be expressed as f(x, y; λ, θ, φ, σ, γ), where λ, θ, σ, γ represent the horizontal stripe frequency characteristics of each pixel.

[0122] In an exemplary embodiment, the above screening operation can be performed according to T r =I max ×n×ratio execution, where I max is the maximum value of the pixel value, n is the number of image columns, ratio is the maximum brightness percentage, and the value range is (0,1]. Specifically, the pixel cumulative value is counted along the horizontal direction, and the brightness values ​​of each pixel in each row are accumulated to obtain the pixel cumulative value of each row. The brightness rolling horizontal stripe screening threshold T is set. r Filter the pixel cumulative value of each row in the horizontal direction, and the pixel cumulative value is greater than T r If yes, keep this row; otherwise, remove the pixels in this row.

[0123] Through the embodiments of the present application, the pixel values ​​of each pixel point in the above-mentioned first image are converted from the spatial domain to the frequency domain to obtain an intermediate frequency domain feature image; a filtering operation is performed on the above-mentioned intermediate frequency domain feature image to obtain the above-mentioned first frequency domain feature image, thereby removing unnecessary noise and details in the first image and retaining only key information for subsequent image flicker recognition.

[0124] As an optional solution, the above-mentioned converting the pixel values ​​of each pixel point in the above-mentioned first image from the spatial domain to the frequency domain to obtain the above-mentioned first frequency domain feature image includes: converting the pixel values ​​of each pixel point in the above-mentioned first image from the spatial domain to the frequency domain based on the two-dimensional Gabor transform to obtain the above-mentioned first frequency domain feature image; or converting the pixel values ​​of each pixel point in the above-mentioned first image from the spatial domain to the frequency domain based on the Fourier transform to obtain the above-mentioned first frequency domain feature image.

[0125] As an optional solution, the above-mentioned two-dimensional Gabor transform is based on converting the pixel values ​​of each pixel point in the above-mentioned first image from the spatial domain to the frequency domain to obtain the above-mentioned first frequency domain feature image, including: obtaining the pixel value of each pixel point in the above-mentioned first image; performing the above-mentioned two-dimensional Gabor transform on the pixel value of each pixel point in the above-mentioned first image based on the target window function, and adding amplitude information and phase information to each pixel point in the above-mentioned first image, wherein the above-mentioned target window function is used to determine the transformation range of the Gabor filter in the above-mentioned two-dimensional Gabor transform on the above-mentioned first image; and determining the above-mentioned first frequency domain feature image according to each pixel point in the above-mentioned first image to which the above-mentioned amplitude information and the above-mentioned phase information are added.

[0126] Optionally, in the embodiment of the present application, the amplitude information and phase information can represent the horizontal stripe frequency characteristics, that is, the λ, θ, φ, σ, γ of each pixel corresponding to f(x, y; λ, θ, φ, σ, γ) in the first frequency domain feature image. σ, γ.

[0127] In an exemplary embodiment, the pixel value of each pixel point in the first image may be converted from the spatial domain to the frequency domain through two-dimensional Gabor transform and Fourier transform to obtain the first frequency domain feature image.

[0128] It should be noted that the two-dimensional Gabor transform is a mathematical tool for texture analysis. It can convert images from the spatial domain to the frequency domain. The Gabor function is a plane wave with a specific frequency and direction. By convolving it with the image, the local frequency and direction information in the image can be extracted. The Fourier transform is a mathematical method that converts signals from the time domain (or spatial domain) to the frequency domain. In image processing, the Fourier transform can be used to analyze the frequency components of the image and thus extract the features of the image.

[0129] Exemplarily, a two-dimensional Gabor transform is performed using a localized frequency filter (the Gabor filter described above):

[0130] S1, obtaining the pixel value of each pixel in the first image.

[0131] S2, uses the target window function to perform a two-dimensional Gabor transform on each pixel in the image.

[0132] S3, through two-dimensional Gabor transform, adds amplitude and phase information to each pixel, which reflects the characteristics of the pixel at a specific frequency and direction.

[0133] S4: construct a first frequency domain feature image based on the features of each pixel point in a specific frequency and direction.

[0134] Through the embodiments of the present application, two-dimensional Gabor transform and Fourier transform are used to convert the pixel values ​​of each pixel point in the above-mentioned first image from the spatial domain to the frequency domain to obtain the above-mentioned first frequency domain feature image, thereby achieving in-depth analysis and understanding of the first image and providing strong support for subsequent image flicker recognition.

[0135] As an optional solution, the above-mentioned method of determining the cumulative values ​​of pixels corresponding to each row of the above-mentioned first frequency domain feature image row by row along the horizontal direction, using the above-mentioned pixel cumulative values ​​to determine m corresponding gradient values ​​in the above-mentioned first frequency domain feature image, and determining n gradient average values ​​based on the above-mentioned m gradient values, and determining whether the above-mentioned first image has image flickering based on the above-mentioned n gradient average values, includes: adding the pixel values ​​of each row to the first pixel of each row in sequence along the horizontal direction to obtain m+1 pixel cumulative values; determining the above-mentioned m gradient values ​​based on the cumulative values ​​of pixels corresponding to every two adjacent rows; determining the above-mentioned gradient average value based on the above-mentioned m gradient values, wherein one gradient average value among the above-mentioned gradient average values ​​is determined by n adjacent gradient values, n is a positive integer, and n≤m; and determining whether the above-mentioned first image has image flickering based on whether the product of any two gradient average values ​​among the above-mentioned gradient average values ​​is greater than a second preset threshold.

[0136] Optionally, in an embodiment of the present application, the above-mentioned m gradient values ​​are used to reflect the rate of change of the image brightness of the first frequency domain feature image in the horizontal direction, and the above-mentioned gradient average value refers to grouping these m gradient values, and averaging the cumulative values ​​of pixels corresponding to each horizontal row contained in each group to obtain the gradient average value.

[0137] Exemplarily, for each row of the frequency domain feature image, the pixel values ​​are accumulated from left to right until the last pixel in the row to obtain a cumulative value. For example, if a row has 5 pixels and their values ​​are [10, 20, 30, 40, 50], the cumulative value is 150. Then, for two adjacent rows, the gradient value can be obtained by calculating the difference between their cumulative values. For example, the cumulative value of the first row is 150, the cumulative value of the second row is 160, and the cumulative value of the third row is 140. Then, the first gradient value is the gradient value of the first and second rows, which is 10; the second gradient value is the gradient value of the second and third rows, which is -20. If n=2, the average of these two gradient values ​​can be calculated, recorded as the first gradient average, which is -5.

[0138] Similarly, the third gradient value is determined to be the gradient value of the third and fourth rows, which is 10; the fourth gradient value is determined to be the gradient value of the fourth and fifth rows, which is 10; and the second gradient average value can be obtained, which is 10.

[0139] Furthermore, since the product of the first gradient average value and the second gradient average value is less than 0 and is a negative number, it is considered that flickering occurs in the first image.

[0140] Through the embodiments of the present application, an image containing frequency characteristics is used to perform image flicker recognition, and the gradient difference is calculated to determine whether there are large brightness jumps in the horizontal lines of the image. If so, it indicates that there is flicker in the image, ensuring the accuracy of image flicker recognition and effectively improving the reliability and credibility of image flicker recognition.

[0141] As an optional solution, the above-mentioned image flicker recognition is performed on the above-mentioned second image. When the above-mentioned image flicker phenomenon does not occur in the above-mentioned second image, the first target image acquisition parameters are determined based on the first ambient brightness of the above-mentioned second image and the predetermined target brightness, and the above-mentioned image acquisition device is set according to the above-mentioned first target image acquisition parameters, including: when the above-mentioned image flicker phenomenon does not occur in the above-mentioned second image, the above-mentioned first ambient brightness is determined; the target brightness difference is determined according to the above-mentioned first ambient brightness and the above-mentioned target brightness; based on a predetermined mapping relationship set, the above-mentioned first target image acquisition parameters are determined according to the above-mentioned target brightness difference from a set of target image acquisition parameters, wherein the above-mentioned mapping relationship set includes the above-mentioned set of target image acquisition parameters, a set of brightness differences, and a mapping relationship between the above-mentioned set of target image acquisition parameters and the above-mentioned set of brightness differences, and the above-mentioned set of brightness differences includes the above-mentioned target brightness difference; and the above-mentioned image acquisition device is set according to the above-mentioned first target image acquisition parameters.

[0142] Optionally, in an embodiment of the present application, the above-mentioned target brightness difference refers to the difference between the value of the first ambient brightness and the value of the above-mentioned target brightness. For example, the first ambient brightness refers to the image brightness of the second image (obtained by averaging the brightness values ​​of all pixels in the second image). The above-mentioned mapping relationship set can be a linear mapping relationship set or a nonlinear mapping relationship set.

[0143] In an exemplary embodiment, the mapping relationship set is as follows:

[0144] Target image acquisition parameter A corresponds to a brightness difference range of 0-100 lux; target image acquisition parameter B corresponds to a brightness difference range of 101-200 lux; and target image acquisition parameter C corresponds to a brightness difference range of 201-300 lux. In this case, the target brightness difference is 200 lux, which falls within the brightness difference range (101-200 lux) of target image acquisition parameter B. Therefore, the image acquisition device can be set according to the first target image acquisition parameter, that is, the image display effect of the second image can be adjusted according to target image acquisition parameter B. For example, the image contrast, brightness, and saturation of the second image can be increased by 1 unit.

[0145] Through the embodiment of the present application, the mapping relationship set is screened according to the target brightness difference to determine the first target image acquisition parameter, so as to dynamically adjust the image display effect according to the first target image acquisition parameter to ensure that the image will not be too bright or too dark.

[0146] For example, the image processing method proposed in this application can be applied to the field of image processing technology, such as exposure control scenarios, image recognition scenarios, image enhancement scenarios, etc. Specifically, the image processing method proposed in this application may include but is not limited to the three steps of image flicker recognition, image flicker elimination, and image parameter adaptation:

[0147] S1, obtain the current frame image I of the camera. Considering the characteristics of image flicker, there are brightness changes in the picture. Therefore, to exclude the influence of color components, it is necessary to extract the image brightness information for processing. The specific steps are as follows: if the image format is RGB format, it is necessary to convert the RGB to YUV formula to obtain an image containing only brightness information, that is, calculate the corresponding brightness value based on each pixel value according to formula (1). If the image format type has brightness information (for example: YUV, YCrCb, etc.), no conversion is required, and the image containing only brightness information is directly obtained, that is, I y ;

[0148] Formula (1): Y=0.298×R+0.612×G+0.117×B;

[0149] In addition, considering that the brightness rolling stripe feature is a black stripe, in order to highlight the texture feature in the image, it is necessary to y Perform preprocessing, that is: obtain I y Maximum value I max , will I max With image I y Subtract the pixel values ​​in and perform the inverse operation on the image to obtain the corresponding image I′ y ;

[0150] S2, since the image flicker is displayed in the form of brightness rolling at a certain frequency, the brightness information image I' obtained in the previous step is y Converting to the frequency domain for analysis helps to identify the frequency characteristics of image flicker. The conventional method is to perform Fourier transform on the image to obtain the frequency domain image for analysis. This patent considers that when performing Fourier transform, the entire time domain is actually integrated, that is, the time domain signal is averaged over the entire time axis. This is feasible for stable image information. However, in actual camera images, the brightness rolling stripes are fused with the noise signal, which is a non-stationary signal. For non-stationary signals with significant changes in time, the Fourier transform cannot accurately analyze and identify the frequency information of the brightness rolling stripes. Therefore, this patent uses a two-dimensional Gabor transform to divide the image signal into many small time intervals, and performs local Fourier transform analysis on each time interval to determine the frequency characteristics existing in the time interval. The window function used for the Gabor transform in this patent is a Gaussian function, and the specific transformation formula is:

[0151]

[0152] The real part in formula (2) is:

[0153]

[0154] The imaginary part in formula (2) is:

[0155]

[0156] In addition, x and y are spatial domain variables, λ is the wavelength of the sine function, which cannot be greater than 1 / 5 of the input image size, and θ is the direction of the Gabor kernel function, which ranges from [0,360°]. is the phase shift of the tuning function, which is in the range of [-180°, 180°], σ is the bandwidth, i.e. the standard deviation of the Gaussian function, and γ is the aspect ratio of the space, which is in the range of (0, 1].

[0157] S3, combined with the direction of the brightness flickering rolling stripes, perform Gabor transform according to Step 2 to obtain the corresponding image containing the stripe frequency characteristics Count the pixel accumulation values ​​row by row in the horizontal direction, discard a certain number of rows at the beginning and end of the horizontal boundary of the image to reduce the interference of incomplete image information on the recognition results; In addition, consider the inverted image I′ y The rolling stripe feature of medium brightness is an obvious bright band, so the brightness rolling stripe screening threshold T is set. r The pixel accumulation value in the horizontal direction is further filtered according to formula (5) to obtain the filtered image

[0158]

[0159] Formula (5): T r =I max ×n×ratio;

[0160] Where n is the number of image columns, ratio is the maximum brightness percentage, and its value range is (0,1].

[0161] S4, for screening images The gradient value is calculated row by row. In order to reduce the influence of residual noise frequency information (that is, to reduce the influence of local minimum extreme points when the gradient value changes), the template walking method is used for statistical analysis. Specifically, the average value ΔS of the sum of m gradient values ​​is calculated. avg (The value of m should be at least greater than 1. When the value of m is too large, the operation speed is slow and the accuracy of detecting the gradient extreme point is low. Therefore, the value of m should not exceed 10% of the length of the image in the horizontal direction.) Since the gradient value has directionality, when ΔS avg Compared with the previous segment ΔS′ avg When the product is negative, it is considered that there are brightness rolling stripes in the image, that is, there is a flickering phenomenon in the image. avg Compared with the previous segment ΔS′ avg When the multiplication is always positive, there is no flickering in the image;

[0162] S5. If there is screen flickering, it is necessary to eliminate the phenomenon. Specifically, the elimination method may include but is not limited to the following: after detecting the existence of image flickering, the exposure time is changed according to a certain step size in combination with the frequency characteristics of the light source. For example, the exposure time is updated according to a fixed exposure path of 8.3ms, 10ms, 16.6ms, 20ms, 33.3ms..., or the exposure time is automatically updated according to a fixed step size (or a certain regular step size change method) from the minimum exposure time supported by each sensor. At the same time, each frame of the image is identified according to the image flicker recognition step. When the exposure time is adjusted to a certain value, that is, the image flicker recognition result is that there is no screen flickering phenomenon, it is necessary to count the difference between the ambient brightness and the target brightness at the current exposure time. Since the exposure time is fixed, in a brighter environment, the exposure time cannot continue to be updated and reduced, which will cause the picture to be too bright.

[0163] For example, based on the difference between the ambient brightness and the target brightness, a mapping relationship between different brightness differences and image parameters (such as contrast, brightness, saturation, etc.) is preset. The mapping relationship can be a linear relationship or a nonlinear relationship. The image parameters are adaptively adjusted based on the mapping relationship to optimize the problem of excessive picture brightness and improve the monitoring quality. In addition, considering the smooth transition of the image effect between the image flicker elimination stage and the normal no-image flicker stage, the basic value of the image parameter linkage should be the parameter of the normal camera no-image flicker stage.

[0164] In an exemplary embodiment, first, a camera image is acquired, and an image containing only brightness information is acquired through the RGB to YUV formula. Then, the image is inverted to highlight the brightness flickering rolling horizontal stripe edge information to obtain an inverted image. The inverted image is subjected to Gabor transform to obtain frequency feature information in the horizontal direction, wherein in the Gabor transform, λ can be set to 30, θ can be 0 in the horizontal direction, φ can be 0, σ can be set to 4, and γ can be set to 0.2. Furthermore, 10 rows of pixels at the upper and lower boundaries of the image are discarded to reduce the interference of incomplete image information at the boundaries on the recognition results. According to formula (5), the number of corresponding columns of the image and the maximum brightness value are set, and the ratio is 0.8. The brightness rolling horizontal stripe screening threshold T_r is calculated and set, and the pixel accumulation value in the horizontal direction is further screened to obtain the filtered frequency domain feature image.

[0165] Furthermore, after obtaining the above-mentioned frequency domain feature image, the gradient value of the frequency domain feature image is calculated row by row. When the template width m is set to 5, the product of the two segments ΔS_avg is calculated. In some cases, the product is negative, so it is determined that the current image has image flickering.

[0166] In addition, the exposure time can also be updated according to a certain regular exposure path, specifically: the exposure time is updated from 8.3ms, 10ms, 16.6ms, 20ms, 33.3ms... The current camera frame rate is 25 frames. When the exposure time is adjusted to 10ms, the actual power frequency is 50HZ, and the image flicker detection result shows that there is no screen flicker. The detection result is consistent with the actual environment. However, due to the limited camera exposure time, the image is overexposed. Therefore, in order to eliminate the problem of image flicker and overexposure, the camera adjusts the image parameters based on the pre-calibrated brightness difference between different ambient brightness and target brightness and the mapping relationship of the linkage strength of image parameters (ISP parameters (brightness, contrast, gamma curve)). In addition, the basic value of the image parameter linkage is the initial image parameter of the normal camera in the stage without image flicker, thereby achieving the purpose of adaptive optimization of the image blur effect.

[0167] It should be noted that the present application does not directly count the pixels in the horizontal direction, but rather highlights the edge features of the brightness rolling stripes by performing a pre-inversion operation on the image containing brightness information, and uses a two-dimensional Gabor transform in combination with the cumulative distribution of brightness in the horizontal direction and the gradient change features. Moreover, the two-dimensional Gabor transform is insensitive to changes in illumination, can tolerate a certain degree of image rotation and deformation, and has good robustness. Compared with the prior art method of adjusting the image flicker phenomenon by fitting a curve, the frequency feature information of the brightness rolling stripes can be more accurately screened out. At the same time, by changing the exposure time, the image flicker phenomenon is eliminated from the camera end, which will not affect the color effect of the pixel value at the corresponding position of the brightness rolling stripes, thereby avoiding unnatural color transitions. In addition, combined with different ambient brightness, after eliminating the image flicker phenomenon, the image effect can be adaptively optimized to improve the camera picture effect.

[0168] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0169] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0170] According to another aspect of the embodiment of the present application, there is also provided an image processing device for implementing the above-mentioned image processing method. Figure 13 As shown, the device includes:

[0171] An acquisition module 1302 is configured to acquire a first image acquired by an image acquisition device in an i-th time frame, wherein the first image represents an image acquired according to a first exposure time, and i is a positive integer;

[0172] An execution module 1304 is configured to perform image flicker recognition on the first image. If image flicker occurs in the first image, the first exposure time is updated to a second exposure time, and a second image captured by the image capture device in the (i+j)th time frame is obtained, wherein the second exposure time is longer than the first exposure time. The occurrence of image flicker in the first image indicates that, during a process of calculating gradient values ​​row by row in a first frequency domain feature image corresponding to the first image, gradient values ​​corresponding to any two adjacent rows satisfy a preset condition. The second image represents an image captured according to the second exposure time, and j is a positive integer less than or equal to i.

[0173] The processing module 1306 is used to perform image flicker recognition on the second image. When the second image does not experience image flicker, the first target image acquisition parameter is determined based on the first ambient brightness of the second image and a predetermined target brightness, and the image acquisition device is set according to the first target image acquisition parameter. The fact that the second image does not experience image flicker indicates that, during the process of calculating the gradient values ​​row by row of the second frequency domain feature image corresponding to the second image, the gradient values ​​corresponding to any two adjacent rows do not meet a preset condition. The target brightness indicates the ambient brightness of the image captured by the image acquisition device without the image flicker.

[0174] As an optional solution, the device is used to obtain a first image captured by an image acquisition device in the i-th time frame in the following manner, including: obtaining an initial image captured by the image acquisition device in the i-th time frame; performing a chroma removal operation on the initial image to obtain a brightness information image; performing a negation operation on the brightness value of each pixel in the brightness information image to determine the first image, wherein the brightness value of each pixel in the first image is the difference between the brightness value of each pixel in the brightness information image and a preset pixel brightness value.

[0175] As an optional solution, the device is used to identify image flicker on the first image in the following manner: when image flicker occurs in the first image, the first exposure time is updated to the second exposure time, and the second image captured by the image acquisition device in the i+jth time frame is obtained, including: converting the pixel value of each pixel point in the first image from the spatial domain to the frequency domain to obtain a first frequency domain feature image, wherein the first frequency domain feature image represents an image containing horizontal stripe frequency characteristics; determining the pixel cumulative value corresponding to each row of the first frequency domain feature image row by row along the horizontal direction, using the pixel cumulative value to determine m corresponding gradient values ​​in the first frequency domain feature image, and determining the gradient average value based on the m gradient values, and determining the gradient average value based on the gradient The average value is used to determine whether image flickering occurs in the first image, where m is a positive integer and the first frequency domain feature image includes m+1 rows of pixels. If image flickering occurs in the first image, the first exposure time is updated to the second exposure time, and the second image captured by the image acquisition device at the i+jth time frame is obtained. The second target image acquisition parameters are determined based on the second ambient brightness of the first image and a predetermined second target brightness, and the image acquisition device is set according to the second target image acquisition parameters, wherein the second ambient brightness and the second target brightness both correspond to the first exposure time. If image flickering does not occur in the first image, the image acquisition device captures the second image according to the first exposure time.

[0176] As an optional solution, the device is used to convert the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain to obtain a first frequency domain feature image in the following manner, including: converting the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain to obtain an intermediate frequency domain feature image; performing a filtering operation on the intermediate frequency domain feature image to obtain a first frequency domain feature image.

[0177] As an optional solution, the device is used to convert the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain to obtain a first frequency domain feature image in the following manner, including: converting the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain based on the two-dimensional Gabor transform to obtain the first frequency domain feature image; or converting the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain based on the Fourier transform to obtain the first frequency domain feature image.

[0178] As an optional solution, the device is used to convert the pixel values ​​of each pixel point in the first image from the spatial domain to the frequency domain based on the two-dimensional Gabor transform in the following manner to obtain a first frequency domain feature image, including: obtaining the pixel value of each pixel point in the first image; performing a two-dimensional Gabor transform on the pixel value of each pixel point in the first image based on a target window function, adding amplitude information and phase information to each pixel point in the first image, wherein the target window function is used to determine the transformation range of the Gabor filter in the two-dimensional Gabor transform on the first image; and determining the first frequency domain feature image based on each pixel point in the first image to which the amplitude information and phase information are added.

[0179] As an optional solution, the device is used to determine the cumulative value of pixels corresponding to each row of the first frequency domain feature image row by row along the horizontal direction in the following manner, use the pixel cumulative value to determine m corresponding gradient values ​​in the first frequency domain feature image, and determine n gradient averages based on the m gradient values, and determine whether the first image has image flickering based on the n gradient averages, including: adding the pixel values ​​of each row to the first pixel of each row in sequence along the horizontal direction to obtain m+1 pixel cumulative values; determining m gradient values ​​based on the pixel cumulative values ​​corresponding to each two adjacent rows; determining the gradient average based on the m gradient values, wherein one gradient average in the gradient average is determined by n adjacent gradient values, n is a positive integer, n≤m; and determining whether the first image has image flickering based on whether the product of any two gradient averages in the gradient average is greater than a second preset threshold.

[0180] As an optional solution, the device is used to perform image flicker recognition on the second image in the following manner: when no image flicker occurs in the second image, first target image acquisition parameters are determined based on the first ambient brightness of the second image and a predetermined target brightness, and the image acquisition device is set according to the first target image acquisition parameters, including: when no image flicker occurs in the second image, the first ambient brightness is determined; the target brightness is determined from a predetermined target brightness set according to the second exposure time; the target brightness difference is determined according to the first ambient brightness and the target brightness; based on a predetermined mapping relationship set, the first target image acquisition parameters are determined from a set of target image acquisition parameters according to the target brightness difference, wherein the mapping relationship set includes a set of target image acquisition parameters, a set of brightness differences, and a mapping relationship between a set of target image acquisition parameters and a set of brightness differences, and the set of brightness differences includes the target brightness difference; and the image acquisition device is set according to the first target image acquisition parameters.

[0181] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0182] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0183] According to one aspect of the present application, a computer program product is provided. The computer program product includes a computer program.

[0184] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0185] Figure 14 The block diagram schematically shows a computer system structure of an electronic device used to implement an embodiment of the present application.

[0186] It should be noted that Figure 14 The computer system 1400 of the electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present application.

[0187] like Figure 14 As shown, the computer system 1400 includes a central processing unit 1401 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1402 (ROM) or the program loaded from the storage part 1408 into the random access memory 1403 (RAM). Various programs and data required for system operation are also stored in the random access memory 1403. The central processing unit 1401, the read-only memory 1402 and the random access memory 1403 are connected to each other via a bus 1404. An input / output interface 1405 (i.e., an I / O interface) is also connected to the bus 1404.

[0188] The following components are connected to the input / output interface 1405: an input section 1406 including a keyboard, a mouse, and the like; an output section 1407 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 1408 including a hard disk; and a communication section 1409 including a network interface card such as a local area network card or a modem. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the input / output interface 1405 as needed. Removable media 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 1410 as needed, so that computer programs read therefrom can be installed into the storage section 1408 as needed.

[0189] In particular, according to an embodiment of the present application, the processes described in the various method flow charts can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the methods shown in the flow charts. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1409 and / or installed from a removable medium 1411. When the computer program is executed by the central processing unit 1401, the various functions defined in the system of the present application are performed.

[0190] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1409 and / or installed from the removable medium 1411. When the computer program is executed by the central processing unit 1401, various functions provided by the embodiments of the present application are performed.

[0191] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned image processing method is also provided. The electronic device may be Figure 1 The terminal device or server shown in FIG. This embodiment is described by taking the electronic device as a terminal device as an example. Figure 15 As shown, the electronic device includes a memory 1502 and a processor 1504. The memory 1502 stores a computer program, and the processor 1504 is configured to execute the steps in any of the above method embodiments through the computer program.

[0192] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0193] Optionally, in this embodiment, the above-mentioned processor can be configured to execute the methods in each embodiment of the present application through a computer program.

[0194] Alternatively, those skilled in the art will appreciate that Figure 15 The structure shown is for illustration only. Figure 15 It does not limit the structure of the above electronic device. For example, the electronic device may also include Figure 15 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 15 Different configurations shown.

[0195] Among them, the memory 1502 can be used to store software programs and modules, such as the program instructions / modules corresponding to the image processing method and device in the embodiment of the present application. The processor 1504 executes various functional applications and data processing by running the software programs and modules stored in the memory 1502, that is, realizes the above-mentioned image processing method. The memory 1502 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1502 may further include a memory remotely located relative to the processor 1504, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1502 can be used to store information such as the first image and the second image, but is not limited to it. As an example, if Figure 15 As shown, the memory 1502 may include, but is not limited to, the acquisition module 1302, execution module 1304, and processing module 1306 in the image processing apparatus. In addition, it may also include, but is not limited to, other module units in the image processing apparatus, which will not be repeated in this example.

[0196] Optionally, the transmission device 1506 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one embodiment, the transmission device 1506 includes a network interface controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In one embodiment, the transmission device 1506 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0197] In addition, the electronic device further includes: a display 1508 for displaying the first image and the second image; and a connection bus 1510 for connecting various module components in the electronic device.

[0198] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting multiple nodes via network communication. The nodes may form a peer-to-peer network, and any computing device, such as a server, terminal, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.

[0199] According to one aspect of the present application, a computer-readable storage medium is provided, and a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the image processing method provided in various optional implementations of the above-mentioned image processing aspects.

[0200] Optionally, in this embodiment, the above-mentioned computer-readable storage medium can be configured to store data for executing the methods in various embodiments of the present application.

[0201] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0202] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0203] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing one or more electronic devices to execute all or part of the steps of the method described in each embodiment of the present application.

[0204] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0205] In the several embodiments provided in this application, it should be understood that the disclosed applications can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0206] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0207] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0208] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for processing an image, characterized in that: include: Acquire a first image captured by an image acquisition device in an i-th time frame, wherein the first image represents an image captured according to a first exposure time, and i is a positive integer; performing image flicker recognition on the first image, and if image flicker occurs in the first image, updating the first exposure time to a second exposure time, and acquiring a second image captured by the image capture device at an i+j-th time frame, wherein the second exposure time is longer than the first exposure time; the occurrence of image flicker in the first image indicates that, during a process of calculating gradient values ​​row by row in a first frequency domain feature image corresponding to the first image, gradient values ​​corresponding to any two adjacent rows satisfy a preset condition; the second image represents an image captured according to the second exposure time, and j is a positive integer less than or equal to i; The image flicker identification is performed on the second image. When the image flicker phenomenon does not occur in the second image, first target image acquisition parameters are determined based on the first ambient brightness of the second image and a predetermined target brightness, and the image acquisition device is set according to the first target image acquisition parameters. The fact that the image flicker phenomenon does not occur in the second image indicates that, during the process of calculating the gradient values ​​row by row for the second frequency domain feature image corresponding to the second image, the gradient values ​​corresponding to any two adjacent rows do not satisfy the preset condition. The target brightness indicates the ambient brightness of the image captured by the image acquisition device without the image flicker phenomenon.

2. The method according to claim 1, characterized in that The acquiring of the first image acquired by the image acquisition device in the i-th time frame includes: Acquire an initial image captured by the image acquisition device in the i-th time frame; Performing a chroma removal operation on the initial image to obtain a brightness information image; Perform an inversion operation on the brightness value of each pixel in the brightness information image to determine the first image, wherein the brightness value of each pixel in the first image is the difference between the brightness value of each pixel in the brightness information image and the preset pixel brightness value.

3. The method according to claim 1, characterized in that The performing image flicker recognition on the first image, and updating the first exposure time to a second exposure time when image flicker occurs in the first image, and acquiring a second image captured by the image acquisition device at the (i+j)th time frame, includes: Converting the pixel value of each pixel point in the first image from the spatial domain to the frequency domain to obtain the first frequency domain feature image, wherein the first frequency domain feature image represents an image containing horizontal stripe frequency features; Determining, row by row, along a horizontal direction, cumulative values ​​of pixels corresponding to each row of the first frequency domain feature image, using the cumulative values ​​of the pixels to determine m corresponding gradient values ​​in the first frequency domain feature image, determining a gradient average based on the m gradient values, and determining whether image flicker occurs in the first image based on the gradient average, where m is a positive integer and the first frequency domain feature image includes m+1 rows of pixels; In a case where image flicker occurs in the first image, the first exposure time is updated to a second exposure time, a second image captured by the image acquisition device in the (i+j)th time frame is acquired, and second target image acquisition parameters are determined based on a second ambient brightness of the first image and a predetermined second target brightness, and the image acquisition device is set according to the second target image acquisition parameters, wherein the second ambient brightness and the second target brightness both correspond to the first exposure time; In a case where the image flicker phenomenon does not occur in the first image, the image acquisition device acquires the second image according to the first exposure time.

4. The method according to claim 3, characterized in that The step of converting the pixel value of each pixel point in the first image from the spatial domain to the frequency domain to obtain the first frequency domain feature image includes: Converting the pixel value of each pixel in the first image from the spatial domain to the frequency domain to obtain an intermediate frequency domain feature image; A screening operation is performed on the intermediate frequency domain feature image to obtain the first frequency domain feature image.

5. The method according to claim 3, wherein The step of converting the pixel value of each pixel point in the first image from the spatial domain to the frequency domain to obtain the first frequency domain feature image includes: Converting the pixel value of each pixel point in the first image from the spatial domain to the frequency domain based on a two-dimensional Gabor transform to obtain the first frequency domain feature image; or The pixel value of each pixel point in the first image is converted from the spatial domain to the frequency domain based on Fourier transform to obtain the first frequency domain feature image.

6. The method according to claim 5, characterized in that The step of converting the pixel value of each pixel point in the first image from the spatial domain to the frequency domain based on the two-dimensional Gabor transform to obtain the first frequency domain feature image includes: Obtaining a pixel value of each pixel in the first image; performing the two-dimensional Gabor transform on the pixel values ​​of each pixel point in the first image based on a target window function, adding amplitude information and phase information to each pixel point in the first image, wherein the target window function is used to determine the transformation range of the Gabor filter in the two-dimensional Gabor transform on the first image; The first frequency domain feature image is determined according to each pixel point in the first image to which the amplitude information and the phase information are added.

7. The method according to claim 3, characterized in that Determining pixel cumulative values ​​corresponding to each row of the first frequency domain feature image row by row along the horizontal direction, determining m corresponding gradient values ​​in the first frequency domain feature image using the pixel cumulative values, determining a gradient average based on the m gradient values, and determining whether image flicker occurs in the first image based on the gradient average, where m is a positive integer and the first frequency domain feature image includes m+1 rows of pixels, including: Accumulate the pixel values ​​of each row in the horizontal direction to the first pixel in each row to obtain m+1 pixel cumulative values; Determine the m gradient values ​​based on the pixel cumulative values ​​corresponding to every two adjacent rows; Determining the gradient average based on the m gradient values, wherein one of the gradient averages is determined by n adjacent gradient values, where n is a positive integer and n≤m; Whether image flickering occurs in the first image is determined according to whether the product of any two gradient average values ​​among the gradient average values ​​is greater than a second preset threshold.

8. The method according to claim 1, characterized in that The performing the image flicker recognition on the second image, determining a first target image acquisition parameter based on a first ambient brightness of the second image and a predetermined target brightness when the image flicker phenomenon does not occur in the second image, and setting the image acquisition device according to the first target image acquisition parameter, includes: determining the first ambient brightness when the second image does not have the image flicker phenomenon; determining a target brightness difference according to the first ambient brightness and the target brightness; determining the first target image acquisition parameter from a set of target image acquisition parameters according to the target brightness difference based on a predetermined mapping relationship set, wherein the mapping relationship set includes the set of target image acquisition parameters, a set of brightness differences, and a mapping relationship between the set of target image acquisition parameters and the set of brightness differences, and the set of brightness differences includes the target brightness difference; The image acquisition device is set according to the first target image acquisition parameters.

9. An image processing device, characterized in that: include: an acquisition module, configured to acquire a first image acquired by an image acquisition device in an i-th time frame, wherein the first image represents an image acquired according to a first exposure time, and i is a positive integer; an execution module, configured to perform image flicker recognition on the first image, and if image flicker occurs in the first image, update the first exposure time to a second exposure time, and obtain a second image captured by the image capture device in an i+j-th time frame, wherein the second exposure time is longer than the first exposure time. The occurrence of the image flicker in the first image indicates that, during a process of calculating gradient values ​​row by row in a first frequency domain feature image corresponding to the first image, gradient values ​​corresponding to any two adjacent rows satisfy a preset condition. The second image represents an image captured according to the second exposure time, and j is a positive integer less than or equal to i. a processing module for performing image flicker identification on the second image, and determining first target image acquisition parameters based on a first ambient brightness of the second image and a predetermined target brightness when the second image does not experience the image flicker phenomenon, and setting the image acquisition device according to the first target image acquisition parameters, wherein the fact that the second image does not experience the image flicker phenomenon indicates that, during a process of calculating gradient values ​​row by row for a second frequency domain feature image corresponding to the second image, gradient values ​​corresponding to any two adjacent rows do not satisfy the preset condition, and the target brightness indicates the ambient brightness of the image captured by the image acquisition device without the image flicker phenomenon.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein the computer program can be executed by an electronic device to perform the method according to any one of claims 1 to 8.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

12. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 8 through the computer program.

Citation Information

Patent Citations

  • Image processing method and device

    CN114422656A

  • Method of flicker reduction

    US20190058823A1