Image processing method and device, storage medium and electronic equipment

By identifying and adjusting the exposure time and parameters of the image acquisition device, the problem of unnatural image flickering and color transition in the CMOS sensor camera is solved, and the image quality is improved.

CN119136061AActive Publication Date: 2024-12-13ZHEJIANG DAHUA TECH CO LTD +1
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, images collected by CMOS sensor cameras in the shooting environment are prone to light and dark brightness rolling horizontal lines, resulting in image flickering, and the color transition of the image display is unnatural, which cannot be effectively solved.

Method used

By acquiring images acquired by the image acquisition device at different time frames, identifying the image flickering phenomenon, and updating the exposure time and adjusting the acquisition parameters according to the recognition results, ensuring that the frequency domain characteristics of the image meet preset conditions, thereby improving image quality.

Benefits of technology

It improves the accuracy of image flicker recognition, realizes more natural color transition and higher quality image acquisition, and solves the problem of unnatural color transition in image display.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119136061A_ABST
    Figure CN119136061A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method and device, a storage medium and electronic equipment. The method comprises the following steps: acquiring a first image acquired by image acquisition equipment at an ith time frame; performing image flicker recognition on the first image, updating the first exposure time to second exposure time under the condition that the image flicker phenomenon occurs in the first image, and acquiring a second image acquired by the image acquisition equipment in the (i + j) th time frame; and carrying out image flicker identification on the second image, determining a first target image acquisition parameter based on the first environment brightness of the second image and predetermined target brightness under the condition that the second image does not have an image flicker phenomenon, and setting the image acquisition equipment according to the first target image acquisition parameter. The technical problem that color transition of image display is not natural when the image flicker phenomenon is corrected in the prior art is solved.
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] In a shooting environment, a CMOS sensor camera often has rolling horizontal stripes of light and dark brightness in the images it captures, which is also known as image flickering. Therefore, in the related art, a sine curve is mainly used to perform pixel correction on the brightness of each row of pixels in each frame of image data. Since the correction coefficient for pixel correction is often based on the image data of the current frame without referring to the historical image data, there is a technical problem in the related art that the color transition of the image display is unnatural.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. 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 of unnatural color transition of image display when correcting image flicker in the related art.

[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 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 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 in the process of calculating gradient values ​​row by row for a first frequency domain feature image corresponding to the first image, the 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 recognition 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 in 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, 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, including: an acquisition module, used 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, used to perform image flicker recognition on the first image, and in the case where image flicker occurs in the first image, the first exposure time is updated to a second exposure time, and a second image acquired 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 the image flicker occurs in the first image, indicating that, in the process of calculating the gradient values ​​row by row of the first frequency domain feature image corresponding to the first image, the gradient values ​​corresponding to any two adjacent rows satisfy a predetermined value. Assume that the second image represents the image acquired 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 recognition on the second image, and 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, wherein the fact that the image flicker phenomenon does not occur in the second image indicates that in 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 satisfy the preset condition, and the target brightness represents the ambient brightness of the image acquired 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 acquired by the image acquisition device in the i+jth time frame is acquired, 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 a gradient average value based on the m gradient values, and determining the gradient average value based on the gradient average value. whether the first image has image flickering, m is a positive integer, and the first frequency domain feature image includes m+1 rows of pixels; if the first image has image flickering, the first exposure time is updated to the second exposure time, and the second image acquired by the 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 first image and the 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 the first image has not image flickering, the image acquisition device acquires the second image according to the first exposure time.

[0009] Optionally, the device is used to convert 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 in the following manner, including: converting the pixel value 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 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 in the following manner, including: 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; or converting the pixel value 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 value 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 value of each pixel point in the first image; performing the two-dimensional Gabor transform on the pixel value 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 according to 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 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 average values ​​based on the m gradient values, and determine whether image flickering has occurred in the first image based on the n gradient average values, 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 every two adjacent rows; determining the gradient average value based on the m gradient values, wherein one gradient average value among the gradient average values ​​is determined by n adjacent gradient values, n is a positive integer, n≤m; determining whether image flickering has occurred in the first image based on whether the product of any two gradient average values ​​among the gradient average values ​​is greater than a second preset threshold.

[0013] Optionally, the device is used to perform the 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 a target brightness difference based on the first ambient brightness and the target brightness; based on a predetermined set of mapping relationships, 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; and 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, wherein the computer program is configured to execute the above-mentioned image processing method when running.

[0015] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above image processing method.

[0016] According to another aspect of the embodiments of the present application, there is further provided an electronic device, 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 acquired by an image acquisition device at an i-th time frame is acquired, wherein the first image represents an image acquired at 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 acquired 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 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, and the second image represents an image acquired at 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 an 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 acquired 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, thereby solving the technical problem of unnatural color transition of image display when correcting image flicker 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] Fig. 9 is a schematic diagram of another optional image processing method according to an embodiment of the present application;

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

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

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

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

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

[0033] Fig.15 It is a schematic diagram of the structure 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 solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present 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 sequence. 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 an order 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 is described below in conjunction with 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 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 an application 107 installed on the terminal device. The application can be a video application, an instant messaging application, a browser application, an educational application, a 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 and a wireless network, wherein the wired network includes, for example, a local area network, a metropolitan area network, and a wide area network; the wireless network includes, for example, Bluetooth, WIFI, and other networks that implement wireless communication; the terminal device 103 may be a terminal configured with an application program, 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] Combination 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 respectively, 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] Optionally, as an optional implementation, as Figure 2 As shown, the image processing method includes:

[0041] S202, acquiring 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;

[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 an image corresponding to any time frame captured by an image acquisition device at a 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, 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 the i+jth time frame, wherein the second exposure time is longer than the first exposure time, and the image flicker occurs in the first image, indicating that in the process of calculating the gradient values ​​of the first frequency domain feature image corresponding to the first image row by row, the gradient values ​​corresponding to any two adjacent rows meet a preset condition, and the second image represents the image acquired 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 image flicker recognition is used to identify whether the first image has a screen flicker problem, the second exposure time is different from the first exposure time, the 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 gradient value calculation may be implemented but is not limited to by template walking.

[0046] For example, Figure 3 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, obtaining the current frame image I (the first image mentioned above) of the camera, considering the characteristics of the image flicker phenomenon, the brightness of the picture changes, so the influence of the color component is eliminated, and the image brightness information is extracted for processing. The specific steps are:

[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, combine each pixel value to calculate the corresponding brightness value. If the image format type has brightness information (for example: YUV, YCrCb, etc.), no conversion is required, and the image containing only brightness information can be directly obtained, 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 flickering phenomenon is a black stripe, in order to highlight the texture feature in the image, it is necessary to perform a luminance 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, each pixel of the first image is inverted (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 in the form of brightness rolling at a certain frequency, the brightness information image I′ obtained in S1 is y Convert to 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 actually considers the Fourier transform to perform integration processing on the entire time domain, that is, the time domain signal is averaged on the entire time axis, which is feasible for stable image information. However, in the actual camera image, 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.

[0054] That is, the brightness information image I is transformed into 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 may include but is not limited to Gaussian function. The specific transformation formula is:

[0055]

[0056] The real number 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 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), the value is [-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, and the value range is (0, 1].

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

[0061] Count the pixel accumulation values ​​in the horizontal direction, and accumulate the brightness values ​​of each pixel in each row to obtain 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 result; 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 perform a further screening and obtain the screening 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 The gradient value is calculated row by row, that is, the gradient value of the first frequency domain feature image is calculated row by row. In order to reduce the influence of the residual noise frequency information (that is, to reduce the influence of the local minimum extreme point when the gradient value changes), the template walking method can be used for statistical analysis. Specifically:

[0065] Statistical average of m gradient values ​​and ΔS 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. avg =(A+B) / 2, then the previous segment ΔS′ avg = 0 (for the initial gradient, there is no previous ΔS′ avg , the value can be preset to = 0);

[0070] Then loop through each row:

[0071] The difference between the pixel accumulation value of the fourth row and the pixel accumulation 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 screen flickering phenomenon;

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

[0076] S320, end.

[0077] In an exemplary embodiment, Figure 4 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 of image acquisition is adjusted, or only the exposure time of the next frame of image acquisition 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 of image acquisition is adjusted, such as Figure 4 As shown:

[0078] S402, start;

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

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

[0081] According to the light source frequency characteristics, 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 second exposure time can be adjusted to 10ms.

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

[0083] The image flickering 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 over-brightness of the picture, thereby improving the quality of image display.

[0085] S410, end.

[0086] S206, performing image flicker recognition on the second image, and when the second image does not have image flicker, determining first target image acquisition parameters 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 parameters, wherein the second image does not have image flicker 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 satisfy a preset condition, and the target brightness means the ambient brightness of the image acquired by the image acquisition device without the image flicker.

[0087] Optionally, in an embodiment of the present application, the first ambient brightness refers to the image brightness when the second image is captured, the target brightness refers to the image brightness without screen flickering under the current light source environment, and the 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 flickering in a high-brightness environment and the gain has reached the minimum value, when each frame recognizes the flicker 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 pictures caused by eliminating the flicker phenomenon, the present application adopts a method of linking image parameters according to different environmental differences to optimize image quality until there is no flicker in the image and the brightness is displayed naturally with soft color transitions.

[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, acquiring an image captured by a camera (the above-mentioned image acquisition device), and performing image flicker recognition on the image, specifically:

[0092] And through the RGB to YUV formula, Figure 6 is a schematic diagram of another optional image processing method according to an embodiment of the present application, wherein an image containing only brightness information is 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, in which the inverted image is as follows: Figure 7 As shown; perform a two-dimensional Gabor transform on the inverted image to obtain 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 is a schematic diagram of another optional image processing method according to an embodiment of the present application, wherein 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 corresponding columns of 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 values ​​in the horizontal direction are further filtered to obtain the filtered frequency domain feature image, Fig. 9 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: Fig. 9 As shown, Fig.10 is a schematic diagram of another optional image processing method according to an embodiment of the present application, and the corresponding pixel cumulative distribution diagram in the horizontal direction is as follows Fig.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 Fig.10 It can be seen that there is a situation 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..., 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 is that there is no screen flicker, and the detection result is consistent with the actual environment, but at this time, due to the limited exposure time of the camera, the image is overexposed. Fig.11 is a schematic diagram of another optional image processing method according to an embodiment of the present application, such as Fig.11 As shown;

[0097] S510, adaptively adjusting 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 flickering, and adaptive optimization is performed for the effect of image blur. Fig.12 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 Fig.12 shown.

[0099] S512, end.

[0100] Through the 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 values ​​of a first frequency domain feature image corresponding to the first image row by row, the gradient values ​​corresponding to any two adjacent rows satisfy 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 acquired by the image acquisition device without the image flicker phenomenon. By adjusting the exposure time and the acquisition parameters, the purpose of improving the accuracy of flicker recognition and improving the image quality is achieved, thereby achieving the technical effect of more natural color transition and higher quality image acquisition, thereby solving the technical problem of low accuracy in identifying image flicker in the related technology, resulting in unnatural color transition of image display.

[0101] As an optional scheme, the above-mentioned acquisition of the first image acquired by the image acquisition device in the i-th time frame includes: acquiring the initial image acquired 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 a 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 an image acquisition device without performing any preprocessing operations, and the above-mentioned chroma removal operation refers to converting the initial image from an RGB color space to a 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, and the U and V components are removed, retaining only the Y component, 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 pixel point (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 redefining the obtained value as the brightness value of each pixel point.

[0104] In an exemplary embodiment, the above inversion operation can 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 acquired by the above-mentioned image acquisition device in the i+j-th 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 first frequency domain feature image includes m+1 rows of pixels; in the case that the first image has image flickering, 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, and the second target image acquisition parameters are determined based on the second ambient brightness of the first image and the 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 the case that the first image has not image flickering, the image acquisition device captures the second image according to the 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 contains frequency feature information, for example, 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, the above-mentioned second target brightness refers to the brightness of the target image corresponding to the first exposure time, and there is no image flickering in the target image, and 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, and the exposure time is 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 a negative number, it is considered that image flickering occurs in the first image;

[0113] Furthermore, if the first image has an image flickering phenomenon:

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

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

[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] The above process is repeated to continue acquiring images in subsequent time frames, and image flicker recognition and exposure time update are performed.

[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 scheme, the above-mentioned 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 includes: converting the pixel value 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 an 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 brightness 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 value of each pixel point in the above-mentioned first image is converted from the spatial domain to the frequency domain to obtain an intermediate frequency domain feature image; a screening 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 scheme, the above-mentioned 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 includes: converting the pixel value 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 value 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 scheme, the above-mentioned two-dimensional Gabor transform is based on 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, 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 may represent the horizontal stripe frequency characteristics, that is, the λ, θ, φ, σ, γ of f(x, y; λ, θ, φ, σ, γ) corresponding to each pixel 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 by two-dimensional Gabor transform and Fourier transform, so as 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 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 in a specific frequency and direction.

[0133] S4, constructing a first frequency domain feature image according to 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 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, thereby achieving in-depth analysis and understanding of the first image and providing strong support for subsequent image flicker recognition.

[0135] As an optional scheme, the above-mentioned method of determining the pixel cumulative values ​​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: accumulating 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 pixel cumulative values ​​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; 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 the 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 of 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. The first gradient value is the gradient value of the first row and the second row, which is 10; the second gradient value is the gradient value of the second row and the third row, which is -20. If n=2, the average of these two gradient values ​​can be calculated, recorded as the first gradient average value, which is -5.

[0138] Similarly, the third gradient value is determined to be the gradient value of the third row and the fourth row, which is 10; the fourth gradient value is the gradient value of the fourth row and the fifth row, 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 is a large brightness jump change in the horizontal lines of the image. If so, it indicates that there is flicker in the image, thereby ensuring the accuracy of image flicker recognition and effectively improving the reliability and credibility of image flicker recognition.

[0141] As an optional scheme, 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 differences; 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 environment brightness and the value of the above-mentioned target brightness. For example, the first environment brightness refers to the image brightness of the second image (obtained by averaging the brightness values ​​of all pixels in the second image), and 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] The target image acquisition parameter A corresponds to a brightness difference range of 0-100 lux; the target image acquisition parameter B corresponds to a brightness difference range of 101-200 lux; the target image acquisition parameter C corresponds to a brightness difference range of 201-300 lux. At this time, the target brightness difference is 200 lux, which falls within the brightness difference range (101-200 lux) of the 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 the target image acquisition parameter B, for example, the image contrast, brightness, and saturation of the second image are all increased by 1 unit value.

[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] Exemplarily, the image processing method proposed in the present 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 the present 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 flickering, there are brightness changes in the picture. Therefore, excluding 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 horizontal 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 screen 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 image flicker frequency characteristics. The conventional method is to perform Fourier transform on the image to obtain the frequency domain image for analysis. This patent considers that when Fourier transform is performed, the entire time domain is actually integrated, that is, the time domain signal is averaged on 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, Fourier transform cannot accurately analyze and identify the frequency information of brightness rolling stripes. Therefore, this patent uses 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 Gabor transform in this patent is Gaussian function, and the specific transformation formula is:

[0151]

[0152] The real part of 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, and its value is [-180°, 180°]; σ is the bandwidth, that is, the standard deviation of the Gaussian function; and γ is the aspect ratio of the space, and its value range is (0, 1).

[0157] S3, combining the direction of the brightness flickering rolling stripes, and performing Gabor transformation according to Step 2, we can get the corresponding image containing the frequency characteristics of the stripes. 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 image in the horizontal direction, and reduce the interference of incomplete image information at the boundary on the recognition result; in addition, consider the inverted image I′ y The feature of medium brightness rolling stripes is an obvious bright band, so the brightness rolling stripe screening threshold T is set. r The pixel accumulation values ​​in the horizontal direction are 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 (i.e., reduce the influence of local small 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 a negative number, it is considered that there are brightness rolling stripes in the 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 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, change the exposure time in 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 in a fixed step size manner (or a regular step size change manner) 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 identification steps. When the exposure time is adjusted to a certain value, that is, the image flicker identification 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 ambient brightness and target brightness, a linkage 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 non-linear 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 parameters of the normal camera in the 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 an RGB to YUV conversion formula. Next, 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 transformation to obtain frequency feature information in the horizontal direction, wherein in the Gabor transformation, λ 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 ratio is taken as 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 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 is that there is no screen flickering phenomenon, and the detection result is consistent with the actual environment. However, at this time, due to the limited exposure time of the camera, the image is overexposed. Therefore, in order to eliminate the problem of image flickering and overexposure, the camera combines the brightness difference between different ambient brightness and target brightness calibrated in advance and the mapping relationship of the linkage strength of image parameters (ISP parameters (brightness, contrast, gamma curve)), adjusts the image parameters, and 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 horizontal stripes by pre-inverting the image containing brightness information, and uses a two-dimensional Gabor transform combined with the cumulative distribution of brightness in the horizontal direction and the gradient change characteristics. 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 horizontal 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 horizontal stripes, thereby avoiding unnatural color transition. 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 need to 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 the present application is not limited by the described order of actions, because according to the present 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 the present application.

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

[0171] An acquisition module 1302 is used 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] The execution module 1304 is used to perform image flicker recognition on the first image. When the image flicker phenomenon occurs in the first image, the first exposure time is updated to the second exposure time, and a second image acquired by the image acquisition device at the i+jth time frame is acquired, wherein the second exposure time is longer than the first exposure time. The image flicker phenomenon occurs in the first image, indicating that in the process of calculating the gradient values ​​of the first frequency domain feature image corresponding to the first image row by row, the gradient values ​​corresponding to any two adjacent rows meet a preset condition. The second image represents the image acquired 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 have 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 have image flicker indicates 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 a preset condition, and the target brightness indicates the ambient brightness of the image acquired 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 a 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 a second image acquired by the image acquisition device at the i+jth time frame is acquired, 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, 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 acquired by the 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 first image and the 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 acquires the second image according to the first exposure time.

[0176] As an optional solution, the device is used to convert 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 in the following manner, including: converting the pixel value 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 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 in the following manner, including: 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; or converting the pixel value 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 value 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 every 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; 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 scheme, the device is used to identify image flicker on the second image in the following manner: when the second image does not experience image flicker, 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 second image does not experience image flicker, determine the first ambient brightness; determine the target brightness from a predetermined target brightness set according to the second exposure time; determine the target brightness difference according to 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 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; set the image acquisition device 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 with 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 device 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-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0185] Fig.14 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.

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

[0187] like Fig.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 to 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 through a bus 1404. An input / output interface 1405 (Input / Output interface, i.e., 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, etc.; an output section 1407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a LAN card, a modem, etc. 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. A removable medium 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1410 as needed so that a computer program read therefrom is installed into the storage section 1408 as needed.

[0189] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. 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 processor 1401, various functions defined in the system of the present application are executed.

[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 processor 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 the figure. This embodiment is described by taking the electronic device as a terminal device as an example. Fig.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, a person skilled in the art may understand that: Fig.15 The structure shown is for illustration only. Fig.15 The structure of the electronic device is not limited. Fig.15 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.15 Different configurations are 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 embodiments 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, realizing 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 arranged 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 specifically, but not limited to, used to store information such as the first image and the second image. As an example, such as Fig.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 device. In addition, it may also include, but is not limited to, other module units in the image processing device, 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 above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 1506 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, 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 the multiple nodes through network communication. The nodes may form a peer-to-peer network, and any form of 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 hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0202] The serial numbers of the above-mentioned 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 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, which is stored in a storage medium and includes several instructions for one or more electronic devices to execute all or part of the steps of the methods 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 emphasis. 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 the present application, it should be understood that the disclosed application 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. There may be other division methods in actual implementation. For example, 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 separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0207] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of 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 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; Performing image flicker recognition on the first image, and in the case that the first image has image flicker, updating the first exposure time to a second exposure time, 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 image flicker occurring in the first image indicates that, in 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, and the second image indicates an image acquired according to the second exposure time, and j is a positive integer less than or equal to i; The image flicker recognition 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, 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 of 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, and the target brightness indicates the ambient brightness of the image acquired by the image acquisition device without the image flicker phenomenon.

2. The method according to claim 1, characterized in that The step of acquiring a first image acquired by an image acquisition device in an i-th time frame comprises: Acquire an initial image acquired 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 a 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 acquired by the image acquisition device at an i+jth time frame, comprises: Convert 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; Determine the pixel cumulative values ​​corresponding to each row of the first frequency domain feature image row by row along the horizontal direction, use the pixel cumulative values ​​to determine m corresponding gradient values ​​in the first frequency domain feature image, and determine a gradient average value based on the m gradient values, and determine whether the first image has an image flicker phenomenon based on the gradient average value, where m is a positive integer, and the first frequency domain feature image includes m+1 rows of pixel points; In the case where the first image has an image flicker phenomenon, the first exposure time is updated to a second exposure time, a second image acquired by the image acquisition device at the i+jth time frame is acquired, 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; When 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: Convert 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 4, 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: Convert 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; or Based on Fourier transform, the pixel value of each pixel point in the first image is converted from the spatial domain to the frequency domain 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; Based on the target window function, the two-dimensional Gabor transform is respectively performed on the pixel value of each pixel point in the first image, and amplitude information and phase information are added 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 The step of determining pixel cumulative values ​​corresponding to each row of the first frequency domain feature image row by row along the horizontal direction, using the pixel cumulative values ​​to determine m corresponding gradient values ​​in the first frequency domain feature image, and determining n gradient average values ​​based on the m gradient values, and determining whether the first image has image flickering based on the n gradient average values, includes: The pixel values ​​of each row are accumulated in the horizontal direction to the first pixel of each row to obtain m+1 pixel accumulated values; Determine the m gradient values ​​based on the pixel cumulative values ​​corresponding to every two adjacent rows; Determine the gradient average value based on the m gradient values, wherein one gradient average value among the gradient average values ​​is determined by n adjacent gradient values, where n is a positive integer, and n≤m; Whether the first image has image flickering 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: In a case where the image flickering phenomenon does not occur in the second image, determining the first environment brightness; Determine a target brightness difference according to the first ambient brightness and the target brightness; Based on a predetermined mapping relationship set, determining the first target image acquisition parameter 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; 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 in the case where the image flicker phenomenon occurs in the first image, update the first exposure time to a second exposure time, and obtain 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 phenomenon in the first image indicates that in the process of calculating the gradient values ​​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 indicates an image acquired according to the second exposure time, and j is a positive integer less than or equal to i; a processing module, configured to perform the image flicker recognition on 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 when the image flicker phenomenon does not occur in the second image, and set the image acquisition device according to the first target image acquisition 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 of 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, and the target brightness indicates the ambient brightness of the image acquired by the image acquisition device without the image flicker phenomenon occurring.

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 described in 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 described in 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

  • Picture flicker processing method and device of camera, equipment and storage medium

    CN110445952A

  • Image processing method and device

    CN114422656A

  • Shooting method and electronic equipment

    CN116320771A

  • Exposure recovery method and device for eliminating image flicker and storage medium

    CN117082353A

  • Image processing method, electronic equipment and storage medium

    CN117915019A