Video flicker determination method, device, equipment and storage medium
By performing one-dimensional Fourier transformation on the currently detected image and its adjacent multi-frame images in the video, we determine whether there is flicker in the video, which solves the problems of flicker miss detection and false detection in the existing technology, and improves the discrimination of flicker in the video. Accuracy and robustness.
Patent Information
- Application Number
- CN202111463264.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-12-02
AI Technical Summary
When determining whether there is flicker in the video, there are problems of missed detection and false detection, which affects the video playback quality.
By acquiring the currently detected image in the video to be detected and its adjacent at least N frame target images, one-dimensional Fourier transform is performed to obtain the spectrum map. If the mean of the spectrum amplitude is greater than the threshold, it is determined that the currently detected image is a flickering image.
This method can effectively avoid missed and misdetection problems of video flicker, and improves the robustness and accuracy of video flicker judgment.
Smart Images

Figure CN114202519B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, device, equipment and storage medium for determining video flicker. Background Art
[0002] In the process of the camera acquiring video, due to the interference of external physical environment such as the instability of the camera itself, the movement of the shooting angle and the change of ambient light, the video acquired by the camera may show a drastic change in brightness at a single point, locally or overall, which will cause the video acquired by the camera to flicker obviously when played, affecting the quality of the played video.
[0003] To solve the above problem, the current method is to obtain two adjacent frames of images in the video and use the frame difference method to determine whether the corresponding images have flicker. However, this method has the problem of flicker missed detection and / or flicker false detection, which affects the quality of the played video. Summary of the invention
[0004] The present application provides a video flicker determination method, apparatus, device and storage medium to solve the problems of missed detection and false detection when determining whether a video has flicker in the prior art.
[0005] In a first aspect, the present application provides a video flicker determination method, comprising:
[0006] Get the current detection image in the video to be detected;
[0007] Obtain a target image that is adjacent to the current detection image and is at least N frames long, where N is a positive integer greater than 2.
[0008] Perform one-dimensional Fourier transform on the brightness information of the current detection image and N frames of target images to obtain the corresponding spectrum diagram, where the horizontal axis of the spectrum diagram is the frequency and the vertical axis is the spectrum amplitude corresponding to the frequency;
[0009] If the mean value of the spectrum amplitude is greater than the threshold, it is determined that the current detected image is a flickering image.
[0010] Optionally, a one-dimensional Fourier transform is performed on the brightness information of the current detection image and the N frames of target images to obtain a corresponding spectrum diagram, including:
[0011] Determine the frequency according to the number of target images;
[0012] According to the brightness information and frequency of the current detection image and N frames of target images, the preset one-dimensional Fourier transform formula is used to determine the spectrum amplitude corresponding to each frequency;
[0013] Based on the frequency and spectrum amplitude, the spectrum diagram is determined.
[0014] Optionally, the target image is at least N frames of images adjacent to and before the current detection image, and the preset one-dimensional Fourier transform formula is as follows:
[0015]
[0016] Among them, in the above formula is the spectrum amplitude corresponding to the frequency, h is 2π / (N+1), e is a natural constant, u j is the brightness information of the j-th target image among the multiple target images, j is 1, 2, 3, ..., N+1, and k is -(N+1) / 2+1, -(N+1) / 2+2, ..., (N+1) / 2.
[0017] Optionally, the target image is at least N frames of images played before the current detection image, and the preset one-dimensional Fourier transform formula is as follows:
[0018]
[0019] Among them, in the above formula is the spectrum amplitude corresponding to the frequency, h is 2π / (N+1), e is a natural constant, u j is the brightness information of the j-th target image among multiple target images, j is 1, 2, 3, ..., N+1, and k is -N, -N+1, -N+2, ..., 0.
[0020] Optionally, obtaining target images that are adjacent to at least N frames of the current detection image includes:
[0021] According to the current detection image, N frames of images played before the current detection image are selected in the video to be detected to determine the target image.
[0022] Optionally, obtaining target images that are adjacent to at least N frames of the current detection image includes:
[0023] According to the current detection image, select N1 frame images played before the current detection image and N2 frame images played after the current detection image in the video to be detected to determine the target image, N1 and N2 are both positive integers, and N2+N2=N.
[0024] Optionally, the video flicker determination method further includes:
[0025] Before obtaining the corresponding spectrum diagram, the grayscale information of the preset areas in the current detection image and the target image is determined, and the positions of the preset areas in the corresponding target image are the same;
[0026] Determine brightness information of a preset area according to the grayscale information;
[0027] For the preset area, a one-dimensional Fourier transform is performed on the brightness information of the current detection image and N frames of target images to obtain a corresponding spectrum diagram to determine whether there is a flickering phenomenon in the preset area.
[0028] In a second aspect, the present application provides a video flicker discrimination device, comprising:
[0029] A first acquisition module is used to acquire a current detection image in the video to be detected;
[0030] A second acquisition module is used to acquire a target image that is adjacent to at least N frames of the current detection image, where N is a positive integer greater than 2;
[0031] The transformation module is used to perform a one-dimensional Fourier transform on the brightness information of the current detection image and the N frames of target images to obtain a corresponding spectrum diagram, where the horizontal axis of the spectrum diagram is the frequency and the vertical axis is the spectrum amplitude corresponding to the frequency;
[0032] The determination module is used to determine that the current detected image is a flickering image if the mean value of the spectrum amplitude is greater than a threshold.
[0033] Optionally, the transformation module is specifically used to determine the frequency according to the number of target images; determine the spectrum amplitude corresponding to each frequency using a preset one-dimensional Fourier transform formula according to the brightness information and frequency of the current detection image and N frames of target images; and determine the spectrum diagram according to the frequency and spectrum amplitude.
[0034] Optionally, the target image is at least N frames of images adjacent to and before the current detection image, and the preset one-dimensional Fourier transform formula is as follows:
[0035]
[0036] Among them, in the above formula is the spectrum amplitude corresponding to the frequency, h is 2π / (N+1), e is a natural constant, u j is the brightness information of the j-th target image among the multiple target images, j is 1, 2, 3, ..., N+1, and k is -(N+1) / 2+1, -(N+1) / 2+2, ..., (N+1) / 2.
[0037] Optionally, the target image is at least N frames of images played before the current detection image, and the preset one-dimensional Fourier transform formula is as follows:
[0038]
[0039] Among them, in the above formula is the spectrum amplitude corresponding to the frequency, h is 2π / (N+1), e is a natural constant, u jis the brightness information of the j-th target image among multiple target images, j is 1, 2, 3, ..., N+1, and k is -N, -N+1, -N+2, ..., 0.
[0040] Optionally, the second acquisition module is specifically configured to select N frames of images played before the current detection image in the video to be detected according to the current detection image, and determine the target image.
[0041] Optionally, the second acquisition module is specifically used to select N1 frame images played before the current detection image and N2 frame images played after the current detection image in the video to be detected to determine the target image, N1 and N2 are both positive integers, and N1+N2=N.
[0042] Optionally, the video flicker determination device further comprises:
[0043] A grayscale determination module is used to determine the grayscale information of preset areas in the current detection image and the target image before obtaining the corresponding spectrum diagram, and the positions of the preset areas in the target image to which they belong are the same;
[0044] A brightness determination module, used to determine brightness information of a preset area according to grayscale information;
[0045] The execution module is used to perform a one-dimensional Fourier transform on the brightness information of the current detection image and N frames of target images for a preset area to obtain a corresponding spectrum diagram to determine whether there is a flickering phenomenon in the preset area.
[0046] In a third aspect, the present application provides an electronic device, including:
[0047] at least one processor; and
[0048] a memory communicatively connected to at least one processor; wherein,
[0049] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the electronic device to execute any video flicker determination method in the first aspect of the present application.
[0050] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the video flicker determination methods in the first aspect of the present application.
[0051] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any one of the video flicker determination methods in the first aspect of the present application.
[0052] The present application provides a method, device, equipment and storage medium for determining video flicker, and the method for determining video flicker includes: obtaining a current detection image in a video to be detected; obtaining a target image adjacent to at least N frames adjacent to the current detection image, where N is a positive integer greater than 2; performing a one-dimensional Fourier transform on the brightness information of the current detection image and the N frames of the target image to obtain a corresponding spectrum diagram, wherein the horizontal coordinate of the spectrum diagram is the frequency, and the vertical coordinate is the spectrum amplitude corresponding to the frequency; if the mean of the spectrum amplitude is greater than a threshold value, the current detection image is determined to be a flickering image. The present application can use Fourier transform to map brightness information to the frequency domain, effectively solving the differences in the images of the videos to be detected under different camera scenes. Moreover, the spectrum amplitude determined by the spectrum diagram obtained by using multiple images can simultaneously capture the flicker phenomenon of a single image and the gradual flicker phenomenon of multiple images, avoiding the problem of missed detection and / or false detection of video flicker, and improving the robustness and accuracy of video flicker discrimination. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the description of the prior art. Obviously, the drawings described below are some of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0054] Figure 1 A schematic diagram of a scenario of a method for determining video flicker provided in this application;
[0055] Figure 2 A flowchart of a video flicker determination method provided by the present application;
[0056] Figure 3 A flowchart of another video flicker determination method provided by the present application;
[0057] Figure 4 A schematic diagram of a preset area of each frame image provided by this application;
[0058] Figure 5 A schematic diagram of the spectrum diagram provided for this application;
[0059] Figure 6 A schematic diagram of the structure of the video flicker discrimination device provided in this application;
[0060] Figure 7 A schematic diagram of the hardware structure of the electronic device provided in this application.
[0061] The above drawings have shown that the present application is clear, and a more detailed description will be given later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application for those skilled in the art by reference. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be described clearly and completely in conjunction with the drawings in this application. Obviously, what is described is a part of this application, not all of it. Based on this application, all other things obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0063] The terms "first", "second", "third", etc. in the specification and claims of this 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 terms used in this way can be interchanged where appropriate, so that the application described herein can be implemented in an order other than those illustrated or described herein.
[0064] In addition, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, product, or apparatus.
[0065] Before introducing the video flicker determination method provided in the present application, the application scenarios of the video flicker determination method are briefly introduced first.
[0066] For example, Figure 1 A schematic diagram of a scene of a method for determining video flicker provided in the present application, such as Figure 1 As shown, the scene includes a camera 11 and a display device 12. In a video monitoring system, for example, a security system, an intelligent traffic monitoring system, etc., the content captured by the camera 11 will be transmitted to the corresponding monitoring display device 12 for playback. However, the camera 11 is easily affected by the exposure time, the shooting angle and its own failure, and a flickering picture will be displayed on the display device 12. These flickering pictures seriously affect the visual effect and image quality of the video image. In addition, the flickering images captured by the camera 11 generally have a large bit rate, which is not conducive to the transmission and storage of the image, so it is necessary to determine the flickering images.
[0067] Among them, the following method is used to determine whether the image flickers between two adjacent frames of video images: first, the video image to be detected is obtained from the video to be detected, and the frame difference image between the video image to be detected and the previous frame of video image is binarized to obtain a binarized frame difference image; then, a scanning line algorithm is used to exclude areas that do not meet the preset size conditions from the binarized frame difference image to obtain a scanned image, and the regional density of each connected area in the scanned image is determined respectively, and the regional density represents the proportion of effective pixels in the connected area; finally, according to whether the regional density of each connected area is less than the preset density threshold, it is determined whether the video to be detected is a flickering video. It can be seen that the above method is mainly for the image of the previous frame to determine whether the current image flickers, which requires a large difference between the previous frame image and the current image. If the previous frame image is originally a flickering image, it is impossible to determine whether the current image is a flickering image based on the above method, and thus the above method has the problem of missed detection and / or false detection.
[0068] Based on the above application scenarios and problems, the present application provides a video flicker determination method, which can simultaneously capture the flicker phenomenon of a single image and the gradual flicker phenomenon of multiple images, avoiding the problem of missed detection and / or false detection of video flicker, and improving the robustness and accuracy of video flicker discrimination. The technical solution of the present application is described in detail below. The following specific ones can be combined with each other, and the same or similar concepts or processes may not be repeated in some cases.
[0069] Figure 2 This is a flow chart of a video flicker determination method provided in the present application. The video flicker determination method specifically comprises the following steps:
[0070] S201, obtaining a current detection image in a video to be detected.
[0071] The video to be detected refers to the video captured by the camera. The current detection image refers to any frame image in the video to be detected.
[0072] Specifically, when detecting flicker in the video to be detected, each frame of the video to be detected needs to be detected to determine the image with flicker. The present application can detect each frame of the video to be detected in sequence, and the image currently to be detected is the current detection image.
[0073] In addition, the flicker may appear in the form of a point area, a part or the whole. Point refers to the situation where one or more pixels flicker, the part refers to the situation where pixels in a region flicker, and the whole refers to the situation where the entire current detection image or most of the pixels in the current detection image flicker.
[0074] Furthermore, if the brightness of the current frame image is darker and the brightness of the next frame image is brighter, a flickering effect will be produced. Alternatively, in multiple frames of images, a flickering effect will also be produced if the brightness gradually brightens or dims.
[0075] In the present application, a current detection image is obtained, and it is determined whether the brightness of the current detection image has changed drastically relative to the previous frame image, or whether there is a gradual change in brightness in several frames where the current detection image is located.
[0076] S202, obtaining target images that are adjacent to the current detection image and are adjacent to at least N frames.
[0077] Wherein, N is a positive integer greater than 2. In addition, the target image is continuous with the current detection image in the video to be detected.
[0078] Exemplarily, the video to be detected includes M frames of images, and the images are numbered from 1 to M. If the number of the current detection image obtained is P, the target image can be P-1, P-2, P-3, P-4, P-5, .... The target image can also be ..., P-3, P-2, P-1, P+1, P+2, P+3, .... In the present application, it is preferred that the number of target images before the current detection image is the same as the number of target images after the current detection image.
[0079] In the present application, the brightness information of multiple frames of target images before and after the current detection image is utilized to provide more informative data for the frequency and spectrum amplitude of the spectrum diagram after Fourier transformation. Multi-frame image calculation can avoid false detection of flicker due to small grayscale jitter in a frame of image, and reduce false detection caused by differences in grayscale intensity of videos in different camera scenarios.
[0080] In addition, the present application may also determine the target image by other methods, which are not limited here.
[0081] S203 , performing one-dimensional Fourier transform on the brightness information of the current detection image and N frames of target images to obtain corresponding frequency spectrograms.
[0082] The horizontal axis of the spectrum diagram is the frequency, and the vertical axis is the spectrum amplitude corresponding to the frequency.
[0083] Specifically, the brightness information of the current detection image and the brightness information of the target image are subjected to a one-dimensional Fourier transform.
[0084] S204: If the mean value of the spectrum amplitude is greater than the threshold, determine that the current detected image is a flickering image.
[0085] The threshold value can be set according to actual needs. For example, if the user needs to filter out images with more severe flicker, the threshold value can be set larger. If the user needs to filter out images with slight flicker, the threshold value can be set smaller.
[0086] In addition, if the mean of the spectrum amplitude is less than or equal to the threshold, it is determined that the current detected image is not a flickering image. The present application can detect each frame of the video to be detected in the above manner, and then determine the image to be a flickering image.
[0087] Further, when the gradient brightness enhancement occurs in the current detection image and the target image, the mean of the spectrum amplitude obtained is greater than the threshold value, and the current detection image can be detected as a flickering image. Exemplarily, refer to Table 1, wherein the larger the grayscale value of the image, the brighter the image brightness. For the image in Table 1, the grayscale mean of the current image P is relatively high. If the video corresponding to Table 1 is played, from the target image P-2 to the current image P, there will be a detailed flickering phenomenon due to the change of the grayscale mean from 98 to 215. However, if only the current image P is compared with the previous frame target image P-1, since the grayscale mean changes very little, it is impossible to determine that the current image P is a flickering image. And through the method of the present application, it can be determined that the current image P is a flickering image.
[0088] Table 1
[0089]
[0090] In addition, the present application can be applied to the detection of video flicker in any scenario. The present application can simultaneously capture the flicker phenomenon of a single image and the gradual flicker phenomenon of multiple images, avoiding the problem of missed detection and / or false detection of video flicker, and improving the robustness and accuracy of video flicker discrimination.
[0091] Figure 3 This is another flowchart of a video flicker determination method provided by the present application. The video flicker determination method specifically includes the following steps:
[0092] S301, obtaining a current detection image in a video to be detected.
[0093] The specific implementation method of S301 refers to S201 and will not be repeated here.
[0094] S302, obtaining target images that are adjacent to the current detection image and are at least N frames in length.
[0095] Wherein, N is a positive integer greater than 2.
[0096] In some embodiments, obtaining a target image that is adjacent to at least N frames of the current detection image includes: selecting N frames of images played before the current detection image in the video to be detected based on the current detection image to determine the target image.
[0097] In other schemes, a target image that is adjacent to at least N frames of the current detection image is obtained, including: according to the current detection image, selecting N1 frame images played before the current detection image and N2 frame images played after the current detection image in the video to be detected to determine the target image, N1 and N2 are both positive integers, and N1+N2=N.
[0098] In the present application, the number of target images and the selection method can be determined according to actual conditions. Among them, only the images before the current detection image and adjacent to the current detection image can be selected as the target images. N1 images before the current detection image and adjacent to the current detection image and N2 images after the current detection image can also be used as target images.
[0099] S303, determining grayscale information of preset areas in the current detection image and the target image.
[0100] The positions of the preset regions in the target image to which they belong are the same. The preset region may be the entire target image or a portion of the target image. Figure 4 , including: a current detection image P, a target image P-1, a target image P-2, a target image P+1 and a target image P+2. The position of the preset area S in the current detection image and each target image is the same.
[0101] The specific method for determining the grayscale information includes: obtaining the RGB three-channel pixel values of the preset area; converting the RGB three-channel pixel values into corresponding grayscale values; and the grayscale information refers to the grayscale values corresponding to each pixel point in the preset area.
[0102] In the present application, the target image and the current detection image are divided into multiple areas. By obtaining one of the areas as a preset area and obtaining the grayscale information of the preset area, it is possible to subsequently determine whether the preset area of the current detection image stores a flicker phenomenon, thereby improving the accuracy of determining the flicker phenomenon.
[0103] S304: Determine brightness information of a preset area according to the grayscale information.
[0104] As described above, the grayscale information is the grayscale value of each pixel in the preset area. The brightness information is the average value of each grayscale value in the preset area. Therefore, the preset area of the current detection image has brightness information, and the preset area of each target image has corresponding brightness information.
[0105] S305: Determine the frequency according to the number of target images.
[0106] In one solution, if the target image is at least N frames of images before and after the current detection image, the frequency k is -(N+1) / 2+1, -(N+1) / 2+2, ..., (N+1) / 2. For example, if N is 8, k is -3.5, -2.5, -1.5, -0.5, 0.5, 1.5, 2.5, 3.5, 4.5.
[0107] In another solution, if the target image is at least N frames played before the current detection image, the frequency k is -N, -N+1, -N+2, ..., 0. For example, if N is 8, k is -8, -7, -6, -5, -4, -3, -2, -1, 0.
[0108] In the present application, the frequency may also be determined in other ways, which are not limited here.
[0109] S306, according to the brightness information and frequency of the current detection image and the N frames of target images, a preset one-dimensional Fourier transform formula is used to determine the spectrum amplitude corresponding to each frequency.
[0110] In one solution, the target image is at least N frames of images before and after the current detection image, and the preset one-dimensional Fourier transform formula is as follows:
[0111]
[0112] Among them, in the above formula is the spectrum amplitude corresponding to the frequency, h is 2π / (N+1), e is a natural constant, u j is the brightness information of the j-th target image among the multiple target images, j is 1, 2, 3, ..., N+1, and k is -(N+1) / 2+1, -(N+1) / 2+2, ..., (N+1) / 2.
[0113] For example, when N is 8, the spectrum amplitude corresponding to each frequency k is Refer to Table 2:
[0114] Table 2
[0115]
[0116] In another solution, the target image is at least N frames of images played before the current detection image, and the preset one-dimensional Fourier transform formula is as follows:
[0117]
[0118] Among them, in the above formula is the spectrum amplitude corresponding to the frequency, h is 2π / (N+1), e is a natural constant, u j is the brightness information of the j-th target image among multiple target images, j is 1, 2, 3, ..., N+1, and k is -N, -N+1, -N+2, ..., 0.
[0119] For example, when N is 8, the spectrum amplitude corresponding to each frequency k is Refer to Table 3:
[0120] Table 3
[0121]
[0122] S307, determining a spectrum diagram according to the frequency and the spectrum amplitude.
[0123] Among them, frequency k is used as the horizontal axis, and the spectrum amplitude For example, refer to Figure 5 , which is a spectrum diagram obtained by one-dimensional Fourier transform based on the brightness information of each image in this application.
[0124] S308: If the mean value of the spectrum amplitude is greater than the threshold, it is determined that the current detected image is a flickering image.
[0125] Specifically, when the brightness information corresponds to the brightness information of a preset area, what is determined here is whether there is a flickering phenomenon in the preset area in the current detection image.
[0126] The threshold value can be set according to actual needs. For example, if the user needs to filter out images with more severe flicker, the threshold value can be set larger. If the user needs to filter out images with slight flicker, the threshold value can be set smaller.
[0127] In this application, the larger the mean value of the spectrum amplitude is, the higher the flicker intensity is. For example, the mean value of the spectrum amplitude in Table 2 is As shown in Table 3, the mean of the spectrum amplitude is
[0128] Furthermore, the mean of the spectral amplitude is adopted, which is different from the conventional pixel value frame difference. The spectral amplitude determined by the spectrum diagram obtained by the brightness information of multiple frames of images can capture both single-frame flicker and multi-frame gradual flicker, reduce the flicker omission of images, and improve the detection rate and accuracy of flicker images.
[0129] The present application provides a method, device, equipment and storage medium for determining video flicker, and the method for determining video flicker includes: obtaining a current detection image in a video to be detected; obtaining a target image adjacent to at least N frames adjacent to the current detection image, where N is a positive integer greater than 2; performing a one-dimensional Fourier transform on the brightness information of the current detection image and the N frames of the target image to obtain a corresponding spectrum diagram, wherein the horizontal coordinate of the spectrum diagram is the frequency, and the vertical coordinate is the spectrum amplitude corresponding to the frequency; if the mean of the spectrum amplitude is greater than a threshold value, the current detection image is determined to be a flickering image. The present application can use Fourier transform to map brightness information to the frequency domain, effectively solving the differences in the images of the videos to be detected under different camera scenes. Moreover, the spectrum amplitude determined by the spectrum diagram obtained by using multiple images can simultaneously capture the flicker phenomenon of a single image and the gradual flicker phenomenon of multiple images, avoiding the problem of missed detection and / or false detection of video flicker, and improving the robustness and accuracy of video flicker discrimination.
[0130] Figure 6 FIG. 6 is a structural block diagram of a video flicker discrimination device 60 provided in the present application. Figure 6 As shown, the video flicker identification device 60 provided by the present application includes: a first acquisition module 61, a second acquisition module 62, a transformation module 63 and a determination module 64. Among them:
[0131] A first acquisition module 61 is used to acquire a current detection image in the video to be detected;
[0132] A second acquisition module 62 is used to acquire a target image that is adjacent to at least N frames of the current detection image, where N is a positive integer greater than 2;
[0133] The transformation module 63 is used to perform a one-dimensional Fourier transform on the brightness information of the current detection image and the N frames of target images to obtain a corresponding spectrum diagram, where the abscissa of the spectrum diagram is the frequency and the ordinate is the spectrum amplitude corresponding to the frequency;
[0134] The determination module 64 is configured to determine that the current detected image is a flickering image if the mean value of the spectrum amplitude is greater than a threshold value.
[0135] Optionally, the transformation module 63 is specifically used to determine the frequency according to the number of target images; determine the spectrum amplitude corresponding to each frequency using a preset one-dimensional Fourier transform formula according to the brightness information and frequency of the current detection image and N frames of target images; and determine the spectrum diagram according to the frequency and spectrum amplitude.
[0136] Optionally, the target image is at least N frames of images adjacent to and before the current detection image, and the preset one-dimensional Fourier transform formula is as follows:
[0137]
[0138] Among them, in the above formula is the spectrum amplitude corresponding to the frequency, h is 2π / (N+1), e is a natural constant, u j is the brightness information of the j-th target image among the multiple target images, j is 1, 2, 3, ..., N+1, and k is -(N+1) / 2+1, -(N+1) / 2+2, ..., (N+1) / 2.
[0139] Optionally, the target image is at least N frames of images played before the current detection image, and the preset one-dimensional Fourier transform formula is as follows:
[0140]
[0141] Among them, in the above formula is the spectrum amplitude corresponding to the frequency, h is 2π / (N+1), e is a natural constant, u j is the brightness information of the j-th target image among multiple target images, j is 1, 2, 3, ..., N+1, and k is -N, -N+1, -N+2, ..., 0.
[0142] Optionally, the second acquisition module 62 is specifically configured to select N frames of images played before the current detection image in the video to be detected according to the current detection image, and determine the target image.
[0143] Optionally, the second acquisition module 62 is specifically used to select N1 frame images played before the current detection image and N2 frame images played after the current detection image in the video to be detected to determine the target image, N1 and N2 are both positive integers, and N1+N2=N.
[0144] Optionally, the video flicker determination device 60 further includes:
[0145] A grayscale determination module (not shown) is used to determine the grayscale information of preset areas in the current detection image and the target image before obtaining the corresponding spectrum diagram, and the positions of the preset areas in the target image to which they belong are the same;
[0146] A brightness determination module (not shown), used to determine brightness information of a preset area according to grayscale information;
[0147] The execution module (not shown) is used to perform a one-dimensional Fourier transform on the brightness information of the current detection image and N frames of target images for a preset area to obtain a corresponding spectrum diagram to determine whether there is a flicker phenomenon in the preset area.
[0148] The video flicker discrimination device provided in this application is used to perform the above Figure 2 and Figure 3 The technical solutions in the corresponding methods have similar implementation principles and technical effects, which will not be repeated here.
[0149] Figure 7 This is a schematic diagram of the hardware structure of the electronic device provided in this application. Figure 7 As shown, the electronic device 60 of the present application may include: at least one processor 71 ( Figure 7 Only one processor is shown); and a memory 72 in communication with at least one processor. The memory 72 stores instructions that can be executed by at least one processor 71, and the instructions are executed by at least one processor 71 so that the electronic device 70 can execute the technical solution in any of the aforementioned methods.
[0150] Optionally, the memory 72 can be independent or integrated with the processor 71.
[0151] When the memory 72 is a device independent of the processor 71 , the electronic device 70 further includes a bus 73 for connecting the memory 72 and the processor 71 .
[0152] The electronic device provided in the present application can execute the technical solution of any of the aforementioned methods, and its implementation principles and technical effects are similar, which will not be repeated here.
[0153] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the technical solution in any of the aforementioned methods.
[0154] The present application provides a computer program product, including a computer program, which implements the technical solution in any of the aforementioned methods when executed by a processor.
[0155] The present application also provides a chip, including: a processing module and a communication interface, and the processing module can execute the technical solution in the aforementioned method.
[0156] Furthermore, the chip also includes a storage module (such as a memory), the storage module is used to store instructions, the processing module is used to execute the instructions stored in the storage module, and the execution of the instructions stored in the storage module enables the processing module to execute the technical solution in the aforementioned method.
[0157] It should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0158] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0159] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0160] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0161] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device.
[0162] Finally, it should be noted that the above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above, ordinary technicians in this field should understand that they can still modify the above-mentioned technical solutions, or replace some or all of the technical features therein with equivalents. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present application.
Claims
1. A method for determining video flicker, characterized in that: include: Get the current detection image in the video to be detected; Acquire a target image that is adjacent to at least N frames of the current detection image, where N is a positive integer greater than 2; Obtaining brightness information of a preset area in the current detection image and brightness information of the preset area in N frames of the target image, wherein the preset area has the same position in the current detection image and each frame of the target image; Performing a one-dimensional Fourier transform on the brightness information of the preset area in the current detection image and the brightness information of the preset area in the N frames of the target image to obtain a corresponding spectrum diagram, wherein the abscissa of the spectrum diagram is the frequency and the ordinate is the spectrum amplitude corresponding to the frequency, and the current detection image and each frame of the target image correspond to one frequency respectively; Obtaining the mean value of the spectrum amplitude corresponding to each frequency in the spectrum graph; If the mean value of the spectrum amplitude is greater than a threshold, it is determined that the current detected image is a flickering image, and that the current detected image has a flickering phenomenon in the preset area; The one-dimensional Fourier transform is performed on the brightness information of the current detection image and the N frames of the target image to obtain a corresponding spectrum diagram, including: Determining the frequency according to the number of the target images; According to the brightness information of the current detection image and the N frames of the target image and the frequency, a preset one-dimensional Fourier transform formula is used to determine the spectrum amplitude corresponding to each of the frequencies; The spectrum diagram is determined based on the frequency and the spectrum amplitude.
2. The video flicker determination method according to claim 1, characterized in that: The target image is at least N frames of images before and after the current detection image, and the preset one-dimensional Fourier transform formula is as follows: Among them, in the above formula is the spectrum amplitude corresponding to the frequency, is 2π / (N+1), is a natural constant, For multiple target images The brightness information of the target image, is 1, 2, 3, ..., N+1, It is -(N+1) / 2+1, -(N+1) / 2+2,…, (N+1) / 2.
3. The video flicker determination method according to claim 1, characterized in that: The target image is at least N frames of images played before the current detection image, and the preset one-dimensional Fourier transform formula is as follows: Among them, in the above formula is the spectrum amplitude corresponding to the frequency, is 2π / (N+1), is a natural constant, For multiple target images The brightness information of the target image, is 1, 2, 3, ..., N+1, and k is -N, -N+1, -N+2..., 0.
4. The video flicker determination method according to any one of claims 1 to 3, characterized in that: The step of acquiring a target image that is adjacent to at least N frames of the current detection image comprises: According to the current detection image, N frames of images played before the current detection image are selected in the video to be detected to determine the target image.
5. The video flicker determination method according to any one of claims 1 to 3, characterized in that: The step of acquiring a target image that is adjacent to at least N frames of the current detection image comprises: According to the current detection image, N1 frame images played before the current detection image and N2 frame images played after the current detection image are selected in the video to be detected to determine the target image, wherein N1 and N2 are both positive integers, and N1+N2=N.
6. The video flicker determination method according to any one of claims 1 to 3, characterized in that: Also includes: Before obtaining the corresponding spectrum diagram, determining the grayscale information of the preset areas in the current detection image and the target image, wherein the positions of the preset areas in the target image to which they belong are the same; Determining brightness information of the preset area according to the grayscale information; For the preset area, the step of performing one-dimensional Fourier transform on the brightness information of the current detection image and N frames of the target image to obtain a corresponding spectrum diagram is performed to determine whether there is a flickering phenomenon in the preset area.
7. A video flicker identification device, characterized in that: include: A first acquisition module is used to acquire a current detection image in the video to be detected; A second acquisition module is used to acquire a target image that is adjacent to at least N frames of the current detection image, where N is a positive integer greater than 2; A third acquisition module is used to acquire brightness information of a preset area in the current detection image and brightness information of the preset area in N frames of the target image, wherein the preset area has the same position in the current detection image and each frame of the target image; A transformation module is used to perform a one-dimensional Fourier transform on the brightness information of the preset area in the current detection image and the brightness information of the preset area in N frames of the target image to obtain a corresponding spectrum diagram, wherein the abscissa of the spectrum diagram is the frequency and the ordinate is the spectrum amplitude corresponding to the frequency, and the current detection image and each frame of the target image correspond to one frequency respectively; A fourth acquisition module, used to obtain the mean value of the spectrum amplitude corresponding to each frequency in the spectrum diagram; A determination module, configured to determine that the current detected image is a flickering image and that the current detected image has a flickering phenomenon in the preset area if the mean value of the spectrum amplitude is greater than a threshold value; The transformation module is specifically used to: determine the frequency according to the number of the target images; determine the spectrum amplitude corresponding to each frequency using a preset one-dimensional Fourier transform formula according to the brightness information of the current detection image and N frames of the target images and the frequency; determine the spectrum diagram according to the frequency and the spectrum amplitude.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the electronic device to perform the video flicker determination method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the video flicker determination method according to any one of claims 1 to 6 is implemented.