Video image stripe detection method and device, and computer readable storage medium

By compressing and quantizing the video texture map, combined with spectrum analysis and projection variance, the problems of poor robustness and low efficiency of video image stripe detection in the prior art are solved, and more efficient and accurate stripe detection is achieved.

CN113569713BActive Publication Date: 2025-02-14ZHEJIANG DAHUA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202110839815.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-23
Publication Date
2025-02-14
Estimated Expiration
2041-07-23

AI Technical Summary

Technical Problem

In the prior art, video image stripe detection is poor and has low efficiency, making it difficult to effectively deal with stripe interference in complex scenarios.

Method used

By compressing the video texture map, the mask image is obtained, and its continuous smooth area is quantized and spectrum analysis is performed to count the abnormal highlights, and the fringe detection results are determined based on projection variance.

Benefits of technology

It improves the robustness and efficiency of stripe detection of video images, and can more accurately detect stripe interference in video images, and is suitable for complex scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113569713B_ABST
    Figure CN113569713B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for detecting stripes in video images, and a computer-readable storage medium. The detection method includes: compressing a video texture map to obtain a mask image, wherein the video texture map is an image obtained after preprocessing the video image; quantizing the continuous smooth area in the mask image, and determining the projection variance of the quantized image in different directions; counting abnormal bright spots in the image spectrum of the continuous smooth area, wherein the abnormal bright spots are bright spots below a preset frequency; and determining the stripe detection result of the video image based on the projection variance and the abnormal bright spots. The present invention solves the technical problems of poor robustness and low efficiency of stripe detection in video images in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video image processing, and in particular to a method and device for detecting stripes in a video image, and a computer-readable storage medium. Background Art

[0002] With the promotion of smart city construction across the country, each large city will generate a large amount of video surveillance data every day. However, in actual use, video surveillance systems often have a large control range and long working hours, so surveillance videos are easily interfered by stripes. At the same time, the types of stripe interference vary greatly (for example, common ones are horizontal stripes, column stripes, oblique stripes, thick stripes, thin stripes, and periodic stripes), and their causes are often different (for example, power frequency interference, internal voltage imbalance, current imbalance, transmission, image sensor deviation, system noise or vibration, etc.). In actual use, stripe interference not only reduces the interpretability of the video, but also easily causes unpredictable failures. Therefore, stripe detection for monitoring systems is particularly important.

[0003] Related technology one is used for rapid detection of surveillance video stripes. Its design point is to use the abnormal bright spots in the Fourier spectrum of the image to detect periodic stripes. Since it only uses the information of the Fourier spectrum and relies too much on the periodic characteristics of stripe interference, it will lead to low detection rate and poor robustness of video stripe detection in real scenes. Related technology two is for digital holographic interference stripe detection. Its design point is to use hough transform to detect blurred lines and combine Fourier transform to identify the overall characteristics of the same periodic stripes. Since its algorithm is highly dependent on the set parameters, it will lead to weak generalization ability of video stripe detection and difficult to apply to complex scenes.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for detecting stripes in a video image, and a computer-readable storage medium, so as to at least solve the technical problems of poor robustness and low efficiency of stripe detection in video images in the related art.

[0006] According to one aspect of an embodiment of the present invention, a method for detecting stripes in a video image is provided, comprising: compressing a video texture map to obtain a mask image, wherein the video texture map is an image obtained after preprocessing the video image; quantizing a continuous smooth area in the mask image, and respectively determining the projection variance of the quantized image in different directions; counting abnormal bright spots in an image spectrum of the continuous smooth area, wherein the abnormal bright spots are bright spots below a preset frequency; and determining a stripe detection result of the video image based on the projection variance and the abnormal bright spots.

[0007] Optionally, the step of compressing the video texture image to obtain the mask image includes: using a first filter to perform binary compression on the video texture image to obtain a video compression image; and characterizing the video compression image as a mask image for extracting the continuous smooth area.

[0008] Optionally, the step of counting abnormal bright spots in the image spectrum of the continuous smooth area, wherein the abnormal bright spots are bright spots below a preset frequency, comprises: converting the continuous smooth area into the frequency domain to obtain a converted image spectrum diagram, wherein the image spectrum diagram presents abnormal bright spots at central symmetrical points; using a second filter to enhance the brightness intensity values ​​at the abnormal bright spots in the image spectrum diagram; and binarizing the brightness intensity values ​​at multiple abnormal bright spots to determine the abnormal bright spots in the image spectrum of the continuous smooth area.

[0009] Optionally, the step of performing quantization processing on the continuous smooth area in the mask image and respectively determining the projection variance of the quantized image in different directions includes: performing quantization processing on the continuous smooth area using a preset quantization formula; respectively calculating a first gradient map in the first direction and a second gradient map in the second direction of the quantized image; and calculating a first gradient projection variance corresponding to the first direction and a second gradient projection variance corresponding to the second direction for the first gradient map and the second gradient map, wherein the first gradient projection variance and the second gradient projection variance are used to determine the stripe direction and stripe intensity on the video image.

[0010] Optionally, before compressing the video texture image to obtain the mask image, the stripe detection method also includes: converting the video image into a grayscale image, denoising the grayscale image using Gaussian filtering to obtain a denoised grayscale image; calculating the gradient direction and gradient intensity of the denoised grayscale image; and performing non-maximum suppression processing on the denoised grayscale image based on the gradient direction and gradient intensity to obtain the video texture image.

[0011] Optionally, before compressing the video texture image to obtain the mask image, the stripe detection method further includes: extracting the chromaticity component of the video image to obtain a chromaticity component map; and determining an image spectrum map based on the chromaticity component map.

[0012] Optionally, after respectively determining the projection variances of the quantized image in different directions, the stripe detection method further includes: establishing a video blank image that is consistent with the size of the mask image, wherein the video blank image is used to save dynamic change information of each pixel in a preset surveillance video; confirming the total number of image frames processed in the preset surveillance video; and determining whether the pixel is a flickering point based on the dynamic change information and the total number of image frames.

[0013] Optionally, the step of determining the stripe detection result of the video image based on the projection variance and the abnormal bright spot includes: calculating the abnormal bright spot rate of the continuous smooth area based on the abnormal bright spots in the image spectrum of the continuous smooth area; determining the continuous smooth sub-area whose abnormal bright spot rate is greater than a first preset threshold as a stripe candidate area; screening the stripe candidate area based on the projection variance in different directions to obtain a target stripe area; determining the stripe direction in the target stripe area; determining the area in the target stripe area where the number of flickering points is greater than a second preset threshold as a fast stripe area; and determining the stripe detection result of stripe detection on the video image based on the fast stripe area and the target stripe area.

[0014] According to another aspect of an embodiment of the present invention, a stripe detection device for a video image is provided, comprising: a compression unit, configured to compress a video texture map to obtain a mask image, wherein the video texture map is an image obtained after preprocessing the video image; a calculation unit, configured to quantize a continuous smooth region in the mask image, and respectively determine the projection variance of the quantized image in different directions; a statistical unit, configured to count abnormal bright spots in an image spectrum of the continuous smooth region, wherein the abnormal bright spots are bright spots below a preset frequency; and a determination unit, configured to determine a stripe detection result of the video image based on the projection variance and the abnormal bright spots.

[0015] Optionally, the compression unit includes: a first compression module, used to use a first filter to perform binary compression on the video texture map to obtain a video compression image; a first extraction module, used to characterize the video compression image as a mask image for extracting the continuous smooth area.

[0016] Optionally, the statistical unit includes: a first conversion module, used to convert the continuous smooth area into the frequency domain to obtain a converted image spectrum, wherein the image spectrum presents abnormal bright spots at central symmetrical points; a first enhancement module, used to enhance the brightness intensity values ​​at the abnormal bright spots in the image spectrum using a second filter; and a first determination module, used to binarize the brightness intensity values ​​at multiple abnormal bright spots to determine the abnormal bright spots in the image spectrum of the continuous smooth area.

[0017] Optionally, the calculation unit includes: a first quantization module, used to perform quantization processing on the continuous smooth area using a preset quantization formula; a first calculation module, used to respectively calculate a first gradient map in the first direction and a second gradient map in the second direction of the quantized image; a second calculation module, used to calculate a first gradient projection variance corresponding to the first direction and a second gradient projection variance corresponding to the second direction for the first gradient map and the second gradient map, wherein the first gradient projection variance and the second gradient projection variance are used to determine the stripe direction and stripe intensity on the video image.

[0018] Optionally, the stripe detection device also includes: a first denoising module, which is used to convert the video image into a grayscale image before compressing the video texture image to obtain a mask image, and to denoise the grayscale image using Gaussian filtering to obtain a denoised grayscale image; a third calculation module, which is used to calculate the gradient direction and gradient strength of the denoised grayscale image; and a first processing module, which is used to perform non-maximum suppression processing on the denoised grayscale image based on the gradient direction and gradient strength to obtain the video texture image.

[0019] Optionally, the stripe detection device also includes: a second extraction module, used to extract the chrominance component of the video image to obtain a chrominance component map before compressing the video texture map to obtain the mask image; a second determination module, used to determine the image spectrum map based on the chrominance component map.

[0020] Optionally, the stripe detection device also includes: a first establishment module, used to establish a video blank image with the same size as the mask image after respectively determining the projection variance of the quantized image in different directions, wherein the video blank image is used to save the dynamic change information of each pixel in the preset monitoring video; a third determination module, used to confirm the total number of image frames processed in the preset monitoring video; and a fourth determination module, used to determine whether the pixel is a flickering point based on the dynamic change information and the total number of image frames.

[0021] Optionally, the determination unit includes: a fourth calculation module, used to calculate the abnormal bright spot rate of the continuous smooth area based on the abnormal bright spots in the image spectrum of the continuous smooth area; a fifth determination module, used to determine the continuous smooth sub-area whose abnormal bright spot rate is greater than a first preset threshold as a stripe candidate area; a first screening module, used to screen the stripe candidate area based on projection variances in different directions to obtain a target stripe area; a sixth determination module, used to determine the stripe direction in the target stripe area; a first recording module, used to determine the area in the target stripe area where the number of flickering points is greater than a second preset threshold as a fast stripe area; and a seventh determination module, used to determine the stripe detection result of stripe detection on the video image based on the fast stripe area and the target stripe area.

[0022] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located controls the stripe detection method for a video image described in any one of the above items.

[0023] In an embodiment of the present invention, a video texture image is compressed to obtain a mask image, wherein the video texture image is an image obtained after preprocessing the video image, and then the continuous smooth area in the mask image is quantized, and the projection variance of the quantized image in different directions is determined respectively, and then the abnormal bright spots in the image spectrum of the continuous smooth area are counted, and finally the stripe detection result of the video image is determined based on the projection variance and the abnormal bright spots. In this embodiment, compressing the video texture image can eliminate the influence of pixel fluctuation on the robustness and computational efficiency of the algorithm. At the same time, in order to improve the stripe detection efficiency, the video image is quantized, and the stripe detection result in the video image is determined by the projection variance after quantization and the abnormal bright spots in the image spectrum, thereby solving the technical problems of poor robustness and low efficiency of stripe detection of video images in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0025] Figure 1 is a flow chart of an optional method for detecting stripes in a video image according to an embodiment of the present invention;

[0026] Figure 2 is a flow chart of another optional stripe detection method for a video image according to an embodiment of the present invention;

[0027] Figure 3 is a schematic diagram of a stripe detection device for a video image according to an embodiment of the present invention. DETAILED DESCRIPTION

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

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] To facilitate those skilled in the art to understand the present invention, some terms or nouns involved in the embodiments of the present invention are explained below:

[0031] Two-Dimensional Discrete Fourier Transform is a digital transformation method, which is generally used to convert images from the spatial domain to the frequency domain.

[0032] Discrete Fourier Transform (DFT) is the most basic method of signal analysis.

[0033] Canny texture detection can significantly reduce the data size of the image while retaining the original image properties.

[0034] The embodiment of the present invention can be applied to the stripe detection of various video images, for example, various monitoring video images (including but not limited to: videos shot by various fixed camera devices (for example, cameras connected to fill lights, home entrance cameras, building entrance cameras, etc.), videos shot by various mobile camera devices (for example, mobile terminals-mobile phones, tablets, IPADs, etc.). This embodiment makes full use of the typical characteristics of periodicity of stripe interference, and combines spatial domain and frequency domain analysis to minimize the influence of various factors on stripe detection. In this embodiment, the chrominance component of the video image can be extracted first, and its spectrum image can be obtained by discrete Fourier transform, and an algorithm is designed to detect abnormal bright spots in the spectrum image to determine whether there is stripe noise / interference. In addition, this embodiment can also establish a global filtering model through the texture features of the video image, which can effectively alleviate the influence of complex textures in the video image on stripe detection. After extracting the smooth area, the gradient projection variance of the local area in different directions can be calculated in blocks to determine the direction of the stripes. Finally, the stripe interference degree of the video image is comprehensively evaluated through the detection results of the two stages.

[0035] According to an embodiment of the present invention, an embodiment of a method for detecting stripes in a video image is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0036] Embodiment 1

[0037] Figure 1 is a flow chart of an optional stripe detection method for a video image according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0038] Step S102, compressing the video texture image to obtain a mask image, wherein the video texture image is an image obtained after preprocessing the video image.

[0039] Step S104, quantizing the continuous smooth area in the mask image, and determining the projection variance of the quantized image in different directions.

[0040] Step S106 , counting abnormal bright spots in the image spectrum of the continuous smooth area, wherein the abnormal bright spots are bright spots with a frequency lower than a preset frequency.

[0041] Step S108, determining the stripe detection result of the video image based on the projection variance and the abnormal bright spot.

[0042] Through the above steps, the video texture map can be compressed to obtain a mask image, wherein the video texture map is an image obtained after preprocessing the video image, and then the continuous smooth area in the mask image is quantized, and the projection variance of the quantized image in different directions is determined respectively, and then the abnormal bright spots in the image spectrum of the continuous smooth area are counted, and finally the stripe detection result of the video image is determined based on the projection variance and the abnormal bright spots. In this embodiment, compressing the video texture map can eliminate the influence of pixel fluctuation on the robustness and computational efficiency of the algorithm. At the same time, in order to improve the stripe detection efficiency, the video image is quantized, and the stripe detection result in the video image is determined by the projection variance after quantization and the abnormal bright spots in the image spectrum, thereby solving the technical problems of poor robustness and low efficiency of stripe detection of video images in the related art.

[0043] In this embodiment, for the surveillance video collected by the camera (for example, road traffic surveillance video, shopping mall entrance surveillance video, building entrance surveillance video, etc.), the video frame images corresponding to multiple time points are parsed, which are referred to as video images for short. The input image of the video streak detection in this embodiment is each frame of the video image. After receiving the video image, on the one hand, texture detection is performed on the input video image, and then the continuous smooth area of ​​the image is extracted to eliminate the interference of the image detail texture on the streak detection, and the gradient projection variance is calculated in the smooth area to determine the direction of the streak. On the other hand, the chromaticity component of the input video image is extracted to calculate the image spectrum, design a suitable abnormal bright spot detection algorithm, and statistically analyze the distribution law of abnormal bright spots in the spectrum image. Finally, the results of the two are combined to comprehensively evaluate the streak interference.

[0044] The embodiment of the present invention is described in detail below in conjunction with each step.

[0045] Step S102, compressing the video texture image to obtain a mask image, wherein the video texture image is an image obtained after preprocessing the video image.

[0046] In an embodiment of the present invention, after performing canny texture detection and dilation operations on a video image, a canny texture map and a canny dilation map can be obtained. If the texture degree of the video image is large (that is, the texture of the video image is complex), indicating that it has rich text, the canny texture map is selected as the video texture map for compression processing, otherwise the canny dilation map is selected as the video texture map for compression processing.

[0047] Optionally, the step of compressing the video texture image to obtain a mask image includes: using a first filter to perform binary compression on the video texture image to obtain a video compression image; and characterizing the video compression image as a mask image for extracting a continuous smooth area.

[0048] Since the real texture in the video texture map has a great influence on the stripe detection, the detection is performed in the smooth area as much as possible. In an embodiment of the present invention, in order to obtain a suitable smooth area, it is considered to compress the video texture map to eliminate the influence of pixel fluctuations on the robustness of the algorithm and the computational efficiency. In this embodiment, a filter (i.e., the first filter mentioned above, for example, a 5×5 filter) is designed to perform binary compression on the video texture map. When extracting the mask image, the design method is as follows: if a certain number of blocks (for example, 8 blocks and above) in the 5×5 block have a pixel grayscale value greater than a preset value (for example, 230), then this area is set to 1, otherwise it is set to 0, and the obtained video compressed image is used as the mask image for extracting the smooth area.

[0049] Optionally, before compressing the video texture image to obtain the mask image, the stripe detection method also includes: converting the video image into a grayscale image, denoising the grayscale image using Gaussian filtering to obtain a denoised grayscale image; calculating the gradient direction and gradient intensity of the denoised grayscale image; and performing non-maximum suppression processing on the denoised grayscale image based on the gradient direction and gradient intensity to obtain a video texture image.

[0050] In the embodiment of the present invention, the video image is converted into a grayscale image and preliminarily denoised using Gaussian filtering, and then the gradient direction and gradient intensity of the denoised grayscale image are calculated using formula (1) and formula (2) respectively.

[0051]

[0052]

[0053] Among them, G is the gradient strength, θ is the gradient direction, and g x , g y They are the x and y direction gradients respectively. Then the non-maximum suppression method is used to combine the gradient direction and gradient intensity to obtain the canny texture map. Finally, the dilation operation is used to obtain the canny dilation map.

[0054] In the embodiment of the present invention, the continuous smooth area is extracted by using the obtained mask image as a mask for extracting the smooth area.

[0055] Step S104, quantizing the continuous smooth area in the mask image, and determining the projection variance of the quantized image in different directions.

[0056] In the embodiment of the present invention, the algorithm can be accelerated by quantizing the image. At the same time, by adding a gradient direction projection variance calculation module, the algorithm has the ability to detect the direction of stripes and can reduce false detection to a certain extent.

[0057] Optionally, the steps of quantizing the continuous smooth area in the mask image and determining the projection variances of the quantized image in different directions include: quantizing the continuous smooth area using a preset quantization formula; respectively calculating a first gradient map in a first direction and a second gradient map in a second direction of the quantized image; and calculating a first gradient projection variance corresponding to the first direction and a second gradient projection variance corresponding to the second direction for the first gradient map and the second gradient map, wherein the first gradient projection variance and the second gradient projection variance are used to determine the direction and intensity of stripes on the video image.

[0058] In the embodiment of the present invention, the continuous smooth area can be quantized using formula (3).

[0059]

[0060] Among them, I(x,y) represents the pixel point, I max Indicates the maximum pixel value, I min Represents the minimum pixel value. Then, the gradient maps in the x direction (e.g., the east-west direction of the coordinate axis) and the y direction (e.g., the north-south direction of the coordinate axis) are calculated for the quantized image (i.e., the first gradient map in the first direction and the second gradient map in the second direction). Then, the projection variances in the x and y directions (i.e., the first gradient projection variance in the first direction and the second gradient projection variance corresponding to the second direction) are calculated for the two gradient maps, and recorded. Among them, the subscript of var represents the projection variance in different directions, the superscript represents the gradient in different directions, and v x , v y Used to determine the direction and intensity of stripes.

[0061] Step S106 , counting abnormal bright spots in the image spectrum of the continuous smooth area, wherein the abnormal bright spots are bright spots with a frequency lower than a preset frequency.

[0062] In the embodiment of the present invention, a statistical method of abnormal bright spots in the frequency domain is used to analyze stripe interference, and its periodic characteristics can be used to the maximum extent, while alleviating the influence of noise and background on the detection algorithm.

[0063] Optionally, the step of counting abnormal bright spots in the image spectrum of the continuous smooth region, wherein the abnormal bright spots are bright spots below a preset frequency, comprises: converting the continuous smooth region into the frequency domain to obtain a converted image spectrum graph, wherein the image spectrum graph presents abnormal bright spots at central symmetrical points; using a second filter to enhance the brightness intensity values ​​at the abnormal bright spots in the image spectrum graph; and binarizing the brightness intensity values ​​at multiple abnormal bright spots to determine the abnormal bright spots in the image spectrum of the continuous smooth region.

[0064] In an embodiment of the present invention, a two-dimensional discrete Fourier transform is used to transform a continuous smooth area into a frequency domain. Due to the periodic characteristics of some stripes, a centrally symmetrical abnormal bright spot will appear in the discrete Fourier transform spectrum. According to the characteristics of the Fourier spectrum image, the entire spectrum image can be divided into a central area and an outer area based on preset weights. Since there are obvious abnormal bright spots in the central area, only the abnormal bright spots in the outer area are considered. Then, a filter (i.e., the second filter mentioned above, such as a 3×3 filter) is designed to enhance the intensity value of the abnormal bright spot and perform binarization, i.e., the value greater than the preset threshold is an abnormal bright spot.

[0065] Step S108, determining the stripe detection result of the video image based on the projection variance and the abnormal bright spot.

[0066] Optionally, before compressing the video texture image to obtain the mask image, the stripe detection method further includes: extracting the chromaticity component of the video image to obtain a chromaticity component map; and determining the image spectrum map based on the chromaticity component map.

[0067] In an embodiment of the present invention, the chrominance component of the video image can be extracted, and then an image spectrum diagram can be obtained based on the chrominance component. Then, a suitable abnormal bright spot detection algorithm is established to statistically analyze the distribution law of abnormal bright spots in the spectrum diagram.

[0068] Alternatively, after respectively determining the projection variances of the quantized image in different directions, the stripe detection method further includes: establishing a video blank image that is the same size as the mask image, wherein the video blank image is used to store dynamic change information of each pixel in a preset surveillance video; confirming the total number of image frames processed in the preset surveillance video; and determining whether a pixel is a flickering point based on the dynamic change information and the total number of image frames.

[0069] In the embodiment of the present invention, firstly, an empty image S(x, y) having the same size as the mask image is established to store the dynamic change information of each pixel in the preset monitoring video, and at the same time, the total number of frames T currently processed is tracked and stored, and the number of transformations of each pixel is obtained using formula (4).

[0070]

[0071] Among them, F(x,y) and F(x,y) represent the compressed binary images of the current frame and the previous frame respectively. In this algorithm, the calculation The pixel points whose values ​​are greater than a preset value (for example, 0.6) are recorded as flashing points, and their number is recorded.

[0072] Optionally, the step of determining the stripe detection result of the video image based on the projection variance and the abnormal bright spots includes: calculating the abnormal bright spot rate of the continuous smooth area based on the abnormal bright spots in the image spectrum of the continuous smooth area; determining the continuous smooth sub-area whose abnormal bright spot rate is greater than a first preset threshold as a stripe candidate area; screening the stripe candidate areas based on the projection variances in different directions to obtain a target stripe area; determining the stripe direction in the target stripe area; determining an area in the target stripe area where the number of flickering points is greater than a second preset threshold as a fast stripe area; and determining the stripe detection result of stripe detection on the video image based on the fast stripe area and the target stripe area.

[0073] In the embodiment of the present invention, the video stripe degree is jointly evaluated based on the detection results of the projection variance, abnormal bright spots and flickering points. The area where the abnormal bright spot rate is greater than the set threshold is set as the stripe candidate area, and other areas that do not meet the conditions are discarded. Then, the area where the projection variance in the stripe candidate area is greater than the set threshold (for example, 3) is recorded as the stripe area, and its direction is recorded. Then, the area where the number of flickering points in the stripe area is greater than the threshold is recorded as the fast stripe area. Finally, the stripe detection result of the video can be updated to obtain a comprehensive video stripe evaluation.

[0074] The stripe detection method for video images proposed in the embodiment of the present invention uses binary compression features as the basic features of the stripe detection algorithm, so that the algorithm has strong robustness. At the same time, the statistical features at the pixel level are used to evaluate the flicker degree of the pixel, so that the algorithm has the ability to detect the degree of dynamic change of the video. By analyzing the stripe interference in the frequency domain, its periodic characteristics can be maximized, while the influence of noise and background on the algorithm can be alleviated. Moreover, by calculating the gradient direction projection variance, the algorithm has the ability to detect the direction of the stripes and can reduce false detections.

[0075] Embodiment 2

[0076] In the embodiment of the present invention, the typical periodic characteristics of stripe interference are fully utilized, and the spatial domain and frequency domain analysis are combined to minimize the influence of various factors on stripe detection. First, the chrominance component of the video frame image is extracted, and its spectrum image is obtained by discrete Fourier transform, and an algorithm is designed to detect abnormal points in the spectrum image to determine whether stripe interference exists. Then, a global filtering model is established through the texture features of the picture to alleviate the influence of the complex texture of the image on stripe detection as much as possible. After obtaining a smooth stripe estimation area, the gradient projection variance of the local area in the x and y directions is calculated in blocks to determine the direction of the stripes. Then, the stripe interference degree and pattern of the image are comprehensively evaluated through the detection results of the two stages.

[0077] Figure 2FIG. 4 is a flow chart of another optional stripe detection method for a video image according to an embodiment of the present invention. Figure 2 As shown, first, the input of the video stripe detection is the current frame image. On the one hand, texture detection is performed on the current frame image to obtain the canny map and the canny expansion map. Based on the texture degree of the current frame image, one of the canny map and the canny expansion map is selected as the canny texture map. The canny texture map is used to extract the smooth area of ​​the image to eliminate the interference of the image detail texture on the stripe detection. The gradient projection variance is calculated in the smooth area to determine the stripe direction. On the other hand, the chromaticity component of the current frame image is extracted to calculate the DFT spectrum image, and a suitable abnormal bright spot detection algorithm is designed to detect abnormal bright spots, and the distribution law of abnormal bright spots in the spectrum image is statistically analyzed. Finally, the results of the two are combined to comprehensively evaluate the stripes. The specific steps are as follows:

[0078] Step 1: Perform canny texture detection and dilation operations on the current frame image. First, convert the current frame image into a grayscale image and use Gaussian filtering for preliminary denoising. Then calculate the gradient direction and intensity of the current image using the following formula:

[0079]

[0080] Where G is the gradient strength; θ is the gradient direction; g x , g y are the x- and y-direction gradients respectively; then the non-maximum suppression method is used to obtain the canny map in combination with the gradient direction, and finally the dilation operation is used to obtain the canny dilation map.

[0081] Step 2: Select the appropriate basic features. Based on the texture degree, select the canny map or the canny expansion map. A large texture degree means that the image texture is complex and has rich text, so you can choose the canny map as the basic feature (i.e., the canny texture map), otherwise choose the canny expansion map.

[0082] Step 3: Extract smooth areas. Since the real texture of the image has a great influence on stripe detection, detection should be performed in smooth areas as much as possible. In order to obtain a suitable smooth area, the canny texture map can be compressed to eliminate the influence of pixel fluctuations on the robustness of the algorithm and computational efficiency. In order to preliminarily fill the foreground area, the canny texture map is first reduced, and then a 5×5 filter is designed to compress the canny texture map into a binary value. The design method is that if there are 8 or more pixel grayscale values ​​greater than 230 in the 5×5 block, this area is set to 1, otherwise it is set to 0. The image obtained at this time is used as a mask to extract the smooth area.

[0083] Step 4: Count the abnormal bright spots in the DFT spectrum of the smooth area. After extracting the continuous smooth area using the mask obtained in step 3, use the two-dimensional discrete Fourier transform to transform it into the frequency domain:

[0084]

[0085] Among them, f(x,y) represents the grayscale distribution function with x and y as variables in the spatial domain, F(u,v) represents the frequency distribution function with u and v as variables in the frequency domain, and i represents the imaginary part (i.e., i 2 =-1). Due to the periodic characteristics of some stripes, there will be centrally symmetrical abnormal bright spots in the DFT spectrum. According to the characteristics of the Fourier spectrum image, the entire spectrum image is first divided into the central area and the outer area based on the weight ω, and then a 3×3 filter is designed to enhance the intensity value of the abnormal bright spot, and then binarize it. The value greater than the threshold is an abnormal bright spot, and finally the abnormal bright spot rate Ψ is calculated.

[0086] Step 5: Calculate the variance of the gradient direction projection. After extracting the smooth area using the mask obtained in step 3, quantize this area according to the following formula:

[0087]

[0088] Then, the gradient maps in the x and y directions are calculated for the quantized image, and then the projection variance in the x and y directions is calculated for the two gradient maps, and recorded Here v x , v y Used to determine the direction and intensity of stripes.

[0089] Step 6: Pixel-level statistical features. First, create an empty image S(x,y) of the same size as the compressed canny texture image to save the dynamic change information of each pixel in a video. At the same time, track and save the total number of frames T processed so far, and use the following formula to calculate the number of transformations of each pixel:

[0090]

[0091] Among them, F(x,y) and F(x,y) are the compressed binary images of the current frame and the previous frame respectively. The pixels with a value greater than 0.6 are recorded as flickering points, and their number is recorded as K.

[0092] Step 7: Stripe detection. Based on the detection results of steps 4, 5, and 6, the degree of video stripes is jointly evaluated. For the result of step 4, the area with abnormal bright spot rate greater than the set threshold is set as the stripe candidate area, and other areas that do not meet the conditions are discarded; for the result of step 5, the v in the stripe candidate area is xor v y The area with a value greater than the set threshold (for example, 3) is recorded as a stripe area, and its direction is recorded; for the result in step six, the area with a number of flashing points greater than the threshold in the stripe area is recorded as a fast stripe area. At this point, a comprehensive evaluation of the stripe situation of the video is obtained.

[0093] Step 8: Post-processing of video stripe detection: Selectively filter out false alarms caused by certain special circumstances.

[0094] The stripe detection algorithm proposed in the embodiment of the present invention has the following beneficial effects:

[0095] (1) Using canny texture binary compression features as basic features makes the algorithm more robust;

[0096] (2) Use pixel-level statistical features to evaluate the degree of pixel flicker, so that the algorithm has the ability to detect the degree of dynamic changes in the video;

[0097] (3) Analyzing fringe interference in the frequency domain can maximize its periodic characteristics while alleviating the impact of noise and background on the detection algorithm;

[0098] (4) By calculating the variance of the gradient direction projection, the algorithm is able to detect the direction of the stripes and reduce false detections.

[0099] Embodiment 3

[0100] A stripe detection device for a video image provided in this embodiment includes a plurality of implementation units, each of which corresponds to each implementation step in the above-mentioned first embodiment.

[0101] Figure 3 is a schematic diagram of a stripe detection device for a video image according to an embodiment of the present invention. Figure 3 As shown, the detection device may include: a compression unit 30, a calculation unit 32, a statistical unit 34, and a determination unit 36, wherein:

[0102] A compression unit 30, configured to compress the video texture image to obtain a mask image, wherein the video texture image is an image obtained by preprocessing the video image;

[0103] A calculation unit 32, used for quantizing the continuous smooth area in the mask image, and determining the projection variance of the quantized image in different directions respectively;

[0104] A statistical unit 34, used for counting abnormal bright spots in the image spectrum of the continuous smooth area, wherein the abnormal bright spots are bright spots with a frequency lower than a preset frequency;

[0105] The determination unit 36 ​​is used to determine the stripe detection result of the video image based on the projection variance and the abnormal bright spot.

[0106] The above-mentioned stripe detection device can compress the video texture map through the compression unit 30 to obtain a mask image, wherein the video texture map is an image obtained after preprocessing the video image, and then the continuous smooth area in the mask image is quantized by the calculation unit 32, and the projection variance of the quantized image in different directions is determined respectively, and then the abnormal bright spots in the image spectrum of the continuous smooth area are counted by the statistical unit 34, wherein the abnormal bright spots are bright spots below the preset frequency, and finally the stripe detection result of the video image is determined by the determination unit 36 ​​based on the projection variance and the abnormal bright spots. In this embodiment, compressing the video texture map can eliminate the influence of pixel fluctuation on the robustness and calculation efficiency of the algorithm. At the same time, in order to improve the stripe detection efficiency, the video image is quantized, and the stripe detection result in the video image is determined by the projection variance after quantization and the abnormal bright spots in the statistical image spectrum, thereby solving the technical problems of poor robustness and low efficiency of stripe detection of video images in the related art.

[0107] Optionally, the compression unit includes: a first compression module, used to use a first filter to perform binary compression on the video texture map to obtain a video compressed image; and a first extraction module, used to characterize the video compressed image as a mask image for extracting a continuous smooth area.

[0108] Optionally, the statistical unit includes: a first conversion module, used to convert the continuous smooth area into the frequency domain to obtain a converted image spectrum, wherein the image spectrum presents abnormal bright spots at central symmetrical points; a first enhancement module, used to enhance the brightness intensity values ​​at the abnormal bright spots in the image spectrum using a second filter; and a first determination module, used to binarize the brightness intensity values ​​at multiple abnormal bright spots to determine the abnormal bright spots in the image spectrum of the continuous smooth area.

[0109] Optionally, the calculation unit includes: a first quantization module, used to perform quantization processing on the continuous smooth area using a preset quantization formula; a first calculation module, used to respectively calculate the first gradient map in the first direction and the second gradient map in the second direction of the quantized image; a second calculation module, used to calculate the first gradient projection variance corresponding to the first direction and the second gradient projection variance corresponding to the second direction for the first gradient map and the second gradient map, wherein the first gradient projection variance and the second gradient projection variance are used to determine the stripe direction and stripe intensity on the video image.

[0110] Optionally, the stripe detection device also includes: a first denoising module, which is used to convert the video image into a grayscale image before compressing the video texture image to obtain a mask image, and use Gaussian filtering to denoise the grayscale image to obtain a denoised grayscale image; a third calculation module, which is used to calculate the gradient direction and gradient strength of the denoised grayscale image; and a first processing module, which is used to perform non-maximum suppression processing on the denoised grayscale image based on the gradient direction and gradient strength to obtain a video texture image.

[0111] Optionally, the stripe detection device also includes: a second extraction module, used to extract the chromaticity component of the video image to obtain a chromaticity component map before compressing the video texture map to obtain the mask image; a second determination module, used to determine the image spectrum map based on the chromaticity component map.

[0112] Optionally, the stripe detection device also includes: a first establishment module, used to establish a video blank image with the same size as the mask image after respectively determining the projection variance of the quantized image in different directions, wherein the video blank image is used to save the dynamic change information of each pixel in the preset monitoring video; a third determination module, used to confirm the total number of image frames processed in the preset monitoring video; and a fourth determination module, used to determine whether the pixel is a flickering point based on the dynamic change information and the total number of image frames.

[0113] Optionally, the determination unit includes: a fourth calculation module, used to calculate the abnormal bright spot rate of the continuous smooth area based on the abnormal bright spots in the image spectrum of the continuous smooth area; a fifth determination module, used to determine the continuous smooth sub-area whose abnormal bright spot rate is greater than a first preset threshold as a stripe candidate area; a first screening module, used to screen the stripe candidate area based on the projection variance in different directions to obtain a target stripe area; a sixth determination module, used to determine the stripe direction in the target stripe area; a first recording module, used to determine the area in the target stripe area where the number of flashing points is greater than a second preset threshold as a fast stripe area; and a seventh determination module, used to determine the stripe detection result of stripe detection on the video image based on the fast stripe area and the target stripe area.

[0114] The above-mentioned stripe detection device may also include a processor and a memory. The above-mentioned compression unit 30, calculation unit 32, statistical unit 34, determination unit 36, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0115] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the stripe detection result of the video image is determined by adjusting the kernel parameters.

[0116] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.

[0117] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: compressing a video texture image to obtain a mask image; quantizing a continuous smooth area in the mask image, and determining the projection variance of the quantized image in different directions; counting abnormal bright spots in the image spectrum of the continuous smooth area, wherein the abnormal bright spots are bright spots below a preset frequency; and determining the stripe detection result of the video image based on the projection variance and the abnormal bright spots.

[0118] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is executed, the stripe detection method of the video image of any one of the above-mentioned devices where the computer-readable storage medium is located is controlled.

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

[0120] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0121] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be 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.

[0122] 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 units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0123] In addition, each functional unit in each embodiment of the present invention 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.

[0124] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

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

Claims

1. A method for detecting stripes in a video image, characterized in that: include: Compressing the video texture image to obtain a mask image, wherein the video texture image is an image obtained by preprocessing the video image; Quantizing the continuous smooth area in the mask image using a preset quantization formula, and determining a first gradient map in a first direction and a second gradient map in a second direction of the quantized image respectively, and calculating a first gradient projection variance corresponding to the first direction and a second gradient projection variance corresponding to the second direction for the first gradient map and the second gradient map, wherein the first gradient projection variance and the second gradient projection variance are used to determine the stripe direction and stripe intensity on the video image; Counting abnormal bright spots in the image spectrum of the continuous smooth area, wherein the abnormal bright spots are bright spots with a frequency lower than a preset frequency; Determine a stripe detection result of the video image based on the projection variance and the abnormal bright spot; Wherein, determining the stripe detection result of the video image based on the projection variance and the abnormal bright spot includes: Establishing a video blank image of the same size as the mask image, wherein the video blank image is used to store dynamic change information of each pixel in a preset surveillance video; confirming the total number of image frames processed in the preset surveillance video; and determining whether the pixel is a flickering point based on the dynamic change information and the total number of image frames; Based on the abnormal bright spots in the image spectrum of the continuous smooth area, calculating the abnormal bright spot rate of the continuous smooth area, and determining the continuous smooth sub-area where the abnormal bright spot rate is greater than a first preset threshold as a stripe candidate area; Screening the stripe candidate areas based on projection variances in different directions to obtain a target stripe area, determining the stripe direction in the target stripe area, and determining an area in the target stripe area where the number of flashing points is greater than a second preset threshold as a fast stripe area; Based on the fast stripe area and the target stripe area, a stripe detection result of performing stripe detection on the video image is determined.

2. The stripe detection method according to claim 1, characterized in that: The step of compressing the video texture image to obtain a mask image includes: Using a first filter to perform binary compression on the video texture image to obtain a video compressed image; The video compression image is characterized as a mask image for extracting the continuous smooth region.

3. The stripe detection method according to claim 1, characterized in that: The step of counting abnormal bright spots in the image spectrum of the continuous smooth area comprises: Converting the continuous smooth region into the frequency domain to obtain a converted image spectrum, wherein the image spectrum presents an abnormal bright spot at a central symmetrical point; Using a second filter to enhance the brightness intensity value of the abnormal bright spot in the image spectrum graph; The brightness intensity values ​​at the plurality of abnormal bright spots are binarized to determine the abnormal bright spots in the image spectrum of the continuous smooth region.

4. The stripe detection method according to claim 1, characterized in that: Before compressing the video texture image to obtain the mask image, the stripe detection method further includes: Convert the video image into a grayscale image, and denoise the grayscale image using Gaussian filtering to obtain a denoised grayscale image; Calculating the gradient direction and gradient intensity of the denoised grayscale image; Based on the gradient direction and gradient intensity, non-maximum suppression processing is performed on the denoised grayscale image to obtain the video texture image.

5. The stripe detection method according to claim 1, characterized in that: Before compressing the video texture image to obtain the mask image, the stripe detection method further includes: Extracting the chrominance component of the video image to obtain a chrominance component map; Based on the chrominance component map, an image spectrogram is determined.

6. A stripe detection device for a video image, characterized in that: include: A compression unit, used for compressing the video texture image to obtain a mask image, wherein the video texture image is an image obtained by preprocessing the video image; a calculation unit, configured to perform quantization processing on the continuous smooth area in the mask image by using a preset quantization formula, and respectively determine a first gradient map in a first direction and a second gradient map in a second direction of the quantized image, and calculate a first gradient projection variance corresponding to the first direction and a second gradient projection variance corresponding to the second direction for the first gradient map and the second gradient map, wherein the first gradient projection variance and the second gradient projection variance are used to determine the stripe direction and stripe intensity on the video image; A statistical unit, used for counting abnormal bright spots in the image spectrum of the continuous smooth area, wherein the abnormal bright spots are bright spots with a frequency lower than a preset frequency; A determination unit, configured to determine a stripe detection result of the video image based on the projection variance and the abnormal bright spot; The device is also used to establish a video blank image of the same size as the mask image, wherein the video blank image is used to store dynamic change information of each pixel in a preset monitoring video; confirm the total number of image frames processed in the preset monitoring video; and determine whether the pixel is a flickering point based on the dynamic change information and the total number of image frames; Based on the abnormal bright spots in the image spectrum of the continuous smooth area, calculating the abnormal bright spot rate of the continuous smooth area, and determining the continuous smooth sub-area where the abnormal bright spot rate is greater than a first preset threshold as a stripe candidate area; Screening the stripe candidate areas based on projection variances in different directions to obtain a target stripe area, determining the stripe direction in the target stripe area, and determining an area in the target stripe area where the number of flashing points is greater than a second preset threshold as a fast stripe area; Based on the fast stripe area and the target stripe area, a stripe detection result of performing stripe detection on the video image is determined.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the stripe detection method for a video image according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Imaging apparatus and flicker detection method

    CN101622859A

  • A monitoring video stripe rapid detection method

    CN109712107A

  • Video quality detection method based on image processing, storage device and mobile terminal

    CN112291551A

  • Image processing system

    JP2016063529A