Video image stripe interference detection method and device

By scaling and quantifying the video image, combined with the straight line extraction algorithm and gradient direction projection variance calculation, the problem of low stripe interference detection detection rate in the existing technology is solved, and the accuracy and robustness of the detection are improved.

CN113592801BActive Publication Date: 2024-08-30ZHEJIANG DAHUA TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110838394.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-23
Publication Date
2024-08-30
Estimated Expiration
2041-07-23

AI Technical Summary

Technical Problem

The existing technology has a low detection rate and poor robustness in stripe interference detection in video images, making it difficult to apply to complex scenes. Moreover, the algorithm is highly dependent on set parameters, resulting in weak detection generalization capabilities.

Method used

By scaling and quantifying the video image, calculate the projection variance in different directions, determine the pixel parallel line angle information, count the number of straight lines, combine the projection variance and the number of straight lines, evaluate the stripe interference detection results of the video image, and use efficient straight lines Extraction algorithm and gradient direction projection variance calculation to reduce false detection rate.

Benefits of technology

It improves the detection rate of stripe interference, has the ability to detect the direction of stripes, significantly reduces the false detection rate, and enhances the robustness and generalization ability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113592801B
    Figure CN113592801B
Patent Text Reader

Abstract

The present invention discloses a method and device for detecting stripe interference of video images. The detection method comprises: scaling a video image to obtain a scaled image, then quantizing the scaled image, and respectively determining the projection variance of the quantized image in different directions, then determining pixel parallel line angle information based on the quantized image, counting the number of straight lines in the video image based on the pixel parallel line angle information, and finally determining the stripe interference detection result of the video image based on the projection variance and the number of straight lines. The present invention solves the technical problem of low detection rate when detecting stripe interference of video images in the related art.
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 a device for detecting stripe interference of a video image. Background Art

[0002] With the large-scale rise of smart and safe city construction, a large amount of video surveillance data has been accumulated, and the amount of data is still increasing every day. At present, since video surveillance systems often have the characteristics of large control range and long working time, surveillance videos are easily affected by stripe interference. 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 interference detection for monitoring systems is particularly important.

[0003] In the related technology, since only the information of the Fourier spectrum is used and too much reliance is placed on the periodic characteristics of stripe interference, the detection rate of video stripe detection in real scenes will be low and the robustness will be poor. In addition, since the algorithm is highly dependent on the set parameters, the generalization ability of video stripe detection is weak and it is 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 embodiment of the present invention provides a method and device for detecting stripe interference of a video image, so as to at least solve the technical problem of low detection rate when detecting stripe interference of a video image in the related art.

[0006] According to one aspect of an embodiment of the present invention, a method for detecting stripe interference in a video image is provided, comprising: scaling a video image to obtain a scaled image; quantizing the scaled image and respectively determining the projection variances of the quantized image in different directions; determining pixel parallel line angle information based on the quantized image; counting the number of straight lines in the video image based on the pixel parallel line angle information; and determining a stripe interference detection result of the video image based on the projection variance and the number of straight lines.

[0007] Optionally, the step of scaling the video image to obtain the scaled image includes: extracting a video image from the surveillance video; filtering the video image using a preset Gaussian kernel to obtain a filtered video image; and downsampling the filtered video image according to a preset scaling factor to obtain the scaled image.

[0008] Optionally, the steps of quantizing the scaled image and respectively determining the projection variances of the quantized image in different directions include: quantizing the scaled image using a preset quantization formula; respectively calculating a first gradient map of the quantized image in a first direction and a second gradient map in a second direction; 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.

[0009] Optionally, based on the quantized image, the step of determining pixel parallel line angle information includes: applying a custom mask layer to the quantized image to obtain a mask image; respectively calculating a first gradient of the mask image in a first direction and a second gradient of the mask image in a second direction; and calculating the parallel line angle of each pixel in the mask image based on the first gradient in the first direction and the second gradient in the second direction to obtain pixel parallel line angle information.

[0010] Optionally, the step of counting the number of straight lines in the video image based on the pixel parallel line angle information includes: counting straight line candidate areas based on the pixel parallel line angle information, wherein the straight line candidate area is an area in the mask image where the parallel line angle difference between each two adjacent straight lines is less than a first preset threshold; outlining a minimum detection frame for the straight line candidate area; calculating the main direction of the minimum detection frame of the straight line candidate area, and counting the number of straight line points in the straight line candidate area, wherein the main direction of the minimum detection frame is the angle of a straight line connecting the midpoints of two short sides of the straight line candidate area, and the straight line point is a pixel point in the straight line candidate area where the parallel line angle of pixels and the main direction angle are less than a second preset threshold; based on the number of straight line points, counting the number of straight lines in the video image, wherein the straight line is an area straight line outlined for the straight line candidate area where the number of straight line points is greater than a third preset threshold.

[0011] Optionally, before scaling the video image to obtain a scaled image, the stripe interference detection method also includes: establishing a video blank image that is the same size as the video image, wherein the video blank image is used to save dynamic change information of each pixel in the surveillance video; confirming the total number of image frames processed in a preset surveillance video; based on the dynamic change information and the total number of image frames, determining whether the pixel is a flickering point, and recording the number of flickering points.

[0012] Optionally, the step of determining the stripe interference detection result of the video image based on the projection variance and the number of straight lines includes: determining the variance weight, the number of straight lines weight and the number of flickering points weight corresponding to each type of stripe interference; determining the stripe interference detection result of the video image based on the projection variance and the corresponding variance weight, the number of straight lines and the corresponding number of straight lines weight, the number of flickering points and the corresponding number of straight flickering points weight, wherein the stripe interference detection result is used to evaluate the degree of interference of the stripe noise appearing in the video image on the surveillance video.

[0013] Optionally, after determining the stripe interference detection result of the video image, the stripe interference detection method further comprises: using a preset straight line feature library to filter non-stripe straight lines in the stripe interference detection result.

[0014] According to another aspect of an embodiment of the present invention, a stripe interference detection device for a video image is provided, comprising: a scaling unit, for scaling a video image to obtain a scaled image; a first determination unit, for quantizing the scaled image and respectively determining the projection variances of the quantized image in different directions; a second determination unit, for determining pixel parallel line angle information based on the quantized image; a statistical unit, for counting the number of straight lines in the video image based on the pixel parallel line angle information; and a third determination unit, for determining a stripe interference detection result of the video image based on the projection variance and the number of straight lines.

[0015] Optionally, the scaling unit includes: a first extraction module, used to extract a video image from the surveillance video; a first filtering module, used to filter the video image using a preset Gaussian kernel to obtain a filtered video image; and a first downsampling module, used to downsample the filtered video image according to a preset scaling factor to obtain the scaled image.

[0016] Optionally, the first determination unit includes: a first quantization module, used to quantize the scaled image 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; for the first gradient map and the second gradient map, 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, 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.

[0017] Optionally, the second determination unit includes: a first acquisition module, used to use a custom mask layer to act on the quantized image to obtain a mask image; a third calculation module, used to respectively calculate the first gradient of the mask image in the first direction and the second gradient in the second direction; a fourth calculation module, used to calculate the parallel line angle of each pixel in the mask image based on the first gradient in the first direction and the second gradient in the second direction, so as to obtain pixel parallel line angle information.

[0018] Optionally, the statistical unit includes: a first statistical module, used to count the straight line candidate area based on the pixel parallel line angle information, wherein the straight line candidate area is an area in which the parallel line angle difference between each two adjacent straight lines in the mask image is less than a first preset threshold; a first delineation module, used to delineate the minimum detection frame of the straight line candidate area; a second statistical module, used to calculate the main direction of the minimum detection frame of the straight line candidate area, and count the number of straight line points in the straight line candidate area, wherein the main direction of the minimum detection frame is the angle of the straight line connecting the midpoints of the two short sides of the straight line candidate area, and the straight line point is a pixel point in the straight line candidate area where the parallel line angle of the pixel and the main direction angle are less than a second preset threshold; a third statistical module, used to count the number of straight lines in the video image based on the number of straight line points, wherein the straight line is a regional straight line delineated for the straight line candidate area where the number of straight line points is greater than the third preset threshold.

[0019] Optionally, the stripe interference detection device also includes: a first establishment module, used to establish a video blank image with the same size as the video image before scaling the video image to obtain the scaled image, wherein the video blank image is used to save the dynamic change information of each pixel in the surveillance video; a first confirmation module, used to confirm the total number of image frames processed in the preset surveillance video; a first recording module, used to determine whether the pixel is a flickering point based on the dynamic change information and the total number of image frames, and record the number of flickering points.

[0020] Optionally, the third determination unit includes: a first determination module, used to determine the variance weight, straight line number weight and flicker point number weight corresponding to each type of stripe interference; a second determination module, used to determine the stripe interference detection result of the video image based on the projection variance and the corresponding variance weight, the straight line number and the corresponding straight line number weight, the flicker point number and the corresponding straight flicker point number weight, wherein the stripe interference detection result is used to evaluate the interference degree of the stripe noise appearing in the video image to the surveillance video.

[0021] Optionally, the stripe interference detection device further comprises: after determining the stripe interference detection result of the video image, a first filtering module is used to filter non-stripe straight lines in the stripe interference detection result by using a preset straight line feature library.

[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 interference detection method for a video image as described in any one of the above items.

[0023] In an embodiment of the present invention, a video image is scaled to obtain a scaled image, and then the scaled image is quantized, and the projection variance of the quantized image in different directions is determined respectively. Then, based on the quantized image, the pixel parallel line angle information is determined, and based on the pixel parallel line angle information, the number of straight lines in the video image is counted, and finally, based on the projection variance and the number of straight lines, the stripe interference detection result of the video image is determined. In this embodiment, an efficient straight line extraction algorithm is used to quickly obtain the number of straight lines in the video image, thereby improving the detection rate of stripe interference. At the same time, the compressed video image is quantized, and the projection variance of the quantized image in different directions is calculated respectively, so that the detection algorithm has the ability to detect the direction of the stripes, and can significantly reduce the false detection rate of the stripe interference, thereby solving the technical problem of low detection rate when detecting stripe interference in video images in the related art. 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 stripe interference of a video image according to an embodiment of the present invention;

[0026] Figure 2is a schematic diagram of an optional custom mask according to an embodiment of the present invention;

[0027] Figure 3 is a schematic diagram of straight line quantity detection according to an embodiment of the present invention;

[0028] Figure 4 is a flow chart of another optional method for detecting stripe interference of a video image according to an embodiment of the present invention;

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

[0030] 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.

[0031] 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.

[0032] 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:

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

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

[0035] The embodiments of the present invention can be applied to the stripe interference detection of various video images, for example, various surveillance 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.)).

[0036] In surveillance videos, the most notable feature of stripe interference is the presence of obvious long or short straight lines in the picture. Therefore, the method of detecting straight lines can be used to detect the degree of stripe interference in surveillance videos. However, due to the complexity of real natural scenes and the interference of image foreground, the existing surveillance video stripe interference has the following disadvantages: (1) There are many types of stripe interference (for example, flocculent stripes, horizontal or vertical wavy stripes, corrugated stripes, etc.); (2) Normal and lossless surveillance videos often have a large number of straight line features, which are easy to misreport stripes (for example, high-rise buildings, zebra crossings, etc.); (3) Complex image textures will also greatly affect the detection of stripe interference in surveillance videos.

[0037] In this embodiment, the number of straight line detections in a single image is used to evaluate the degree of stripe interference, and a series of post-processing operations are combined to reduce false alarms, wherein the single image includes but is not limited to: a grayscale image, a gradient image, or a frame difference image, etc., and the selection can be made according to the specific situation.

[0038] According to an embodiment of the present invention, an embodiment of a method for detecting stripe interference 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.

[0039] Embodiment 1

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

[0041] Step S102, scaling the video image to obtain a scaled image.

[0042] Step S104: quantize the scaled image and determine the projection variances of the quantized image in different directions.

[0043] Step S106, determining pixel parallel line angle information based on the quantized image.

[0044] Step S108, counting the number of straight lines in the video image based on the pixel parallel line angle information.

[0045] Step S110, determining a stripe interference detection result of the video image based on the projection variance and the number of lines.

[0046] Through the above steps, the video image can be scaled to obtain a scaled image, and then the scaled image can be quantized, and the projection variance of the quantized image in different directions can be determined respectively. Then, based on the quantized image, the pixel parallel line angle information can be determined, and based on the pixel parallel line angle information, the number of straight lines in the video image can be counted, and finally, based on the projection variance and the number of straight lines, the stripe interference detection result of the video image can be determined. In this embodiment, an efficient straight line extraction algorithm is used to quickly obtain the number of straight lines in the video image, thereby improving the detection rate of stripe interference. At the same time, the compressed video image is quantized, and the projection variance of the quantized image in different directions is calculated respectively, so that the detection algorithm has the ability to detect the direction of the stripes, and can significantly reduce the false detection rate of the stripe interference, thereby solving the technical problem of low detection rate when detecting stripe interference in video images in the related art.

[0047] 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 number of straight line detections in the video image is used to evaluate the degree of stripe interference, and a series of post-processing operations are combined to reduce false alarms. In this embodiment, in order to solve the influence of the step effect of discrete digital images on straight line detection, the video image is downsampled, and then the gradient direction and intensity are statistically calculated pixel by pixel. After the gradient information of each pixel is obtained, a unit vector perpendicular to the gradient direction is assigned to each pixel, and this unit vector is recorded as a parallel line, and straight line segment detection is performed based on this.

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

[0049] Step S102, scaling the video image to obtain a scaled image.

[0050] In the embodiment of the present invention, the types of video images include but are not limited to: grayscale images, gradient images, or frame difference images.

[0051] Optionally, the step of scaling the video image to obtain a scaled image includes: extracting a video image from the surveillance video; filtering the video image using a preset Gaussian kernel to obtain a filtered video image; and downsampling the filtered video image according to a preset scaling factor to obtain a scaled image.

[0052] In the embodiment of the present invention, due to the discrete sampling characteristics of the digital image, a staircase effect will appear at the edge of the straight line of the digital image, which will cause a line segment to be divided into multiple short line segments or part of the straight line cannot be detected. Therefore, in this embodiment, Gaussian downsampling is used to scale the image, and the variance is The video image is filtered by a preset Gaussian kernel and then downsampled, where Γ represents the original variance and λ represents the scaling factor (i.e., the preset scaling factor). In order to balance image aliasing and image blur, in this embodiment, Γ can be set to 0.6 and λ can be set to 0.8. After the video image is downsampled, a scaled image is obtained.

[0053] Optionally, before scaling the video image to obtain the scaled image, the stripe interference detection method also includes: establishing a video blank image that is the same size as the video image, wherein the video blank image is used to save dynamic change information of each pixel in the surveillance video; confirming the total number of image frames processed in the preset surveillance video; based on the dynamic change information and the total number of image frames, determining whether the pixel is a flickering point, and recording the number of flickering points.

[0054] In the embodiment of the present invention, for video stripe interference detection, due to the introduction of frame difference information, considering that some flocculent stripes have obvious pixel flickering, an empty image S(x, y) with the same size as the video image can be first established to save the dynamic change information of each pixel in the preset monitoring video, and at the same time track and save the total number of frames T currently processed, and use formula (1) to obtain the number of changes of each pixel.

[0055]

[0056] 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.

[0057] Step S104: quantize the scaled image and determine the projection variances of the quantized image in different directions.

[0058] 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.

[0059] Optionally, the steps of quantizing the scaled image and determining the projection variances of the quantized image in different directions include: quantizing the scaled image 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.

[0060] In the embodiment of the present invention, in order to quickly calculate the gradient information of the pixel and filter the area with smaller gradient value to relieve the calculation pressure, the preset quantization formula (2) can be used to perform quantization processing on the scaled image.

[0061]

[0062] 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.

[0063] Step S106, determining pixel parallel line angle information based on the quantized image.

[0064] In an embodiment of the present invention, the parallel lines of each pixel are obtained by assigning a unit vector perpendicular to the gradient direction to each pixel after obtaining the gradient information of each pixel. This unit vector is the parallel lines of the pixel, and the parallel lines can be used as a basis for straight line detection.

[0065] Optionally, the step of determining pixel parallel line angle information based on the quantized image includes: applying a custom mask layer to the quantized image to obtain a mask image; respectively calculating a first gradient of the mask image in a first direction and a second gradient in a second direction; and calculating the parallel line angle of each pixel in the mask image based on the first gradient in the first direction and the second gradient in the second direction to obtain pixel parallel line angle information.

[0066] In the embodiment of the present invention, a custom mask is used to act on the quantized image to calculate the image gradient, wherein the custom mask can be set as Figure 2 The 2×2 mask shown in the figure, where I(i,j) represents the grayscale value at the pixel (i,j), I(i+1,j) represents the grayscale value at the pixel (i+1,j), I(i,j+1) represents the grayscale value at the pixel (i,j+1), and I(i+1,j+1) represents the grayscale value at the pixel (i+1,j+1). The image gradient is calculated using formula (3).

[0067]

[0068]

[0069] in, are the gradients of the image in the x and y directions respectively. Then, the parallel line angle of each pixel is calculated using formula (4) to obtain the pixel parallel line angle information.

[0070]

[0071] Step S108, counting the number of straight lines in the video image based on the pixel parallel line angle information.

[0072] In the embodiment of the present invention, an efficient statistical straight line algorithm is adopted to fully utilize the shape characteristics of fringe interference and improve the detection rate.

[0073] Optionally, the step of counting the number of straight lines in the video image based on the pixel parallel line angle information includes: counting the straight line candidate area based on the pixel parallel line angle information, wherein the straight line candidate area is an area in the mask image where the parallel line angle difference between each two adjacent straight lines is less than a first preset threshold; outlining the minimum detection frame of the straight line candidate area; calculating the main direction of the minimum detection frame of the straight line candidate area, and counting the number of straight line points in the straight line candidate area, wherein the main direction of the minimum detection frame is the angle of the straight line connecting the midpoints of the two short sides of the straight line candidate area, and the straight line point is a pixel point in the straight line candidate area where the parallel line angle of the pixels and the main direction angle are less than a second preset threshold; based on the number of straight line points, counting the number of straight lines in the video image, wherein the straight line is a regional straight line outlined for the straight line candidate area where the number of straight line points is greater than a third preset threshold.

[0074] In the embodiment of the present invention, pixel parallel line angle information is used to count straight line candidate areas, where the straight line candidate areas are adjacent areas with similar parallel line directions (i.e., the parallel line angle difference is less than a first preset threshold), and the parameter κ is used to control the parallel line angle difference in the same candidate area, such as Figure 3 As shown, Figure 3The left figure (a) in the figure is the distribution of parallel lines of each pixel of the video image, where the short line segment represents a unit vector, which corresponds one-to-one to the quantized image pixel. The two areas in the right figure (b) (i.e., detection frame 1 and detection frame 2, which are drawn using the difference in parallel line angles) are the extracted straight line candidate areas (i.e., the minimum detection frame that outlines the straight line candidate area, where the detection frame can be a polygonal frame such as a rectangle, trapezoid, or arrow). Then, the main direction of the minimum detection frame of the straight line candidate area is calculated, that is, the angle of the straight line formed by connecting the midpoints of the two short sides of the straight line candidate area, and the points in the candidate area where the angle between the parallel line and the main direction is less than 2κ (i.e., the second preset threshold) are recorded as straight line points, and their number is counted, and the straight line candidate area where the number of straight line points is greater than the selected threshold (i.e., the third preset threshold) is recorded as a straight line, that is, the number of straight lines is increased by one.

[0075] Step S110, determining a stripe interference detection result of the video image based on the projection variance and the number of lines.

[0076] An optional step of determining a stripe interference detection result of a video image based on projection variance and the number of straight lines, comprising: determining a variance weight, a straight line number weight, and a flicker point number weight corresponding to each stripe interference type; determining a stripe interference detection result of the video image based on projection variance and the corresponding variance weight, the number of straight lines and the corresponding straight line number weight, the number of flicker points, and the corresponding straight flicker point number weight, wherein the stripe interference detection result is used to evaluate the degree of interference of the stripe noise appearing in the video image on the surveillance video.

[0077] In an embodiment of the present invention, the stripe interference type may be a flocculent stripe interference type, the typical characteristics of which are that many short and thin straight lines are detected, and a large number of flickering points are detected. For different types of stripe interference, the degree of video stripes is jointly evaluated based on the detection results of the projection variance, the number of straight lines and the number of flickering points, and a detailed evaluation is performed using different weighted combinations of the projection variance, the number of straight lines and the number of flickering points.

[0078] Alternatively, after determining the stripe interference detection result of the video image, the stripe interference detection method further includes: using a preset straight line feature library to filter non-stripe straight lines in the stripe interference detection result.

[0079] In an embodiment of the present invention, the preset straight line feature library includes but is not limited to: features of object bodies such as buildings, zebra crossings, and woods. Since these regular objects can appear in surveillance videos, but the line extraction features of these regular objects have straight line features, they are easily mistaken for striped noise. Therefore, non-striped straight lines in the preset straight line feature library can be selectively filtered to reduce false alarms.

[0080] The stripe interference detection method for video images proposed in the embodiment of the present invention adopts an efficient straight line extraction algorithm, which can make full use of the shape characteristics of the stripe interference and improve the detection rate. At the same time, the pixel-level statistical characteristics are used to evaluate the flicker degree of the pixel, so that the algorithm can have the ability to detect the degree of dynamic change of the video. Moreover, through the gradient direction projection variance calculation formula, the algorithm has the ability to detect the direction of the stripes, and can significantly reduce the false detection rate of video stripes.

[0081] Embodiment 2

[0082] In the embodiment of the present invention, the number of straight line detections in the video image is used to evaluate the degree of stripe interference, and a series of post-processing operations are combined to reduce false alarms, wherein the video image can be a grayscale image, a gradient image, or a frame difference image, etc., and the selection can be selected according to the specific situation. In this embodiment, in order to solve the influence of the step effect of the discrete digital image on the straight line detection, the video image is Gaussian downsampled, and then the gradient direction and intensity are statistically calculated pixel by pixel. After the gradient information of each pixel is obtained, a unit vector perpendicular to the gradient direction is assigned to each pixel, and this unit vector is recorded as a parallel line, and the straight line segment detection is performed based on this.

[0083] Figure 4 FIG. 4 is a flow chart of another optional method for detecting stripe interference of a video image according to an embodiment of the present invention. Figure 4 As shown, first, since noise will have a great impact on the subsequent straight line detection, the input single image can be subjected to noise detection, and then the single image can be Gaussian downsampled, and then the image can be quantized. Then, on the one hand, parallel lines are calculated pixel by pixel, and the number of straight line segments is counted, that is, the gradient information of the pixel is used to detect the straight line area. It should be noted that due to the sampling characteristics of digital images, what is detected here is not a real straight line segment, but an area that may contain line segment-like features. On the other hand, the gradient projection variance is calculated for the quantized image, and finally the number of detected straight lines and the gradient projection variance in different directions are combined to comprehensively evaluate the type and degree of stripe interference. The specific steps are as follows:

[0084] Step 1: Gaussian downsampling. Due to the discrete sampling characteristics of digital images, there will be a staircase effect at the edge of the straight line of the digital image, which will cause a line segment to be divided into multiple short line segments or some straight lines cannot be detected. Therefore, it is necessary to use Gaussian downsampling to scale the image. The scaling factor selected here can be 80%. The specific process is to use the variance The image is filtered by a Gaussian kernel and then downsampled. In order to balance image aliasing and image blur, Γ is taken as 0.6 and λ is taken as 0.8.

[0085] Step 2: Image quantization. In order to quickly calculate the gradient information of pixels and filter out areas with smaller gradient values ​​to relieve the calculation pressure, the image is quantized using the following formula:

[0086]

[0087] Step 3: Calculate the image gradient. Figure 2 The 2×2 mask shown is applied to the quantized image to calculate the gradient. The image gradient is calculated using the following formula:

[0088]

[0089]

[0090] The gradients of the image in the x and y directions are calculated respectively, and the parallel line angles of each pixel are calculated as:

[0091]

[0092] Step 4: Line detection. Using the pixel parallel line angle information obtained in step 3, we count the line candidate areas, i.e., the adjacent areas with similar parallel line directions, and use the parameter κ to control the difference in parallel line angles in the same candidate area, such as Figure 3 As shown, the main direction of the minimum circumscribed rectangle of the straight line candidate area is calculated, that is, the angle of the straight line connecting the midpoints of the two short sides of the rectangle, and the points in the candidate area whose angles between the parallel lines and the main direction are less than 2κ are recorded as straight line points, and their number is counted, and the straight line candidate area whose number of straight line points is greater than the selected threshold is recorded as a straight line, that is, the number of straight lines is increased by one.

[0093] Step 5: Calculate the projection variance in the gradient direction. Calculate the gradient map in the x and y directions for the quantized image, and then calculate the projection variance in different directions and record it as Among them, v x , v y Used to determine the direction and intensity of stripes.

[0094] Step 6: Pixel-level statistical features. For video stripe interference detection, due to the introduction of frame difference information, considering that some flocculent stripes have obvious pixel flickering. First, create an empty image S(x,y) of the same size as the input 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,

[0095]

[0096] Among them, F(x,y) and F(x,y) are the current frame and the previous frame image respectively. In this algorithm, The pixels with a value greater than 0.6 are recorded as flickering points, and their number is recorded as K.

[0097] Step 7: Stripe detection. Jointly evaluate the video stripe degree based on the detection results of steps 4, 5, and 6. For different types of stripe interference, use different weighted combinations of projection variance, number of lines, and number of flickering points to perform detailed evaluation.

[0098] Step 8: Post-processing of video stripe detection. False alarms caused by certain special situations, such as buildings, zebra crossings, woods, etc., are selectively filtered out.

[0099] The fringe interference detection algorithm proposed in the embodiment of the present invention has the following beneficial effects:

[0100] (1) The efficient straight line extraction algorithm can fully utilize the shape characteristics of fringe interference and improve the detection rate;

[0101] (2) Utilize 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;

[0102] (3) By calculating the variance of the gradient direction projection, the algorithm is able to detect the direction of the stripes and reduce the false detection rate.

[0103] Embodiment 3

[0104] 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.

[0105] Figure 5 is a schematic diagram of a stripe interference detection device for a video image according to an embodiment of the present invention. Figure 5 As shown, the detection device may include: a scaling unit 50, a first determining unit 52, a second determining unit 54, a statistical unit 56, and a third determining unit 58, wherein:

[0106] The scaling unit 50 is used to scale the video image to obtain a scaled image;

[0107] A first determining unit 53 is used to perform quantization processing on the scaled image and respectively determine the projection variance of the quantized image in different directions;

[0108] A second determining unit 54 is used to determine pixel parallel line angle information based on the quantized image;

[0109] A counting unit 56, used for counting the number of straight lines in the video image based on the pixel parallel line angle information;

[0110] The third determination unit 58 is used to determine the stripe interference detection result of the video image based on the projection variance and the number of lines.

[0111] The above-mentioned stripe interference detection device can perform scaling processing on the video image through the scaling unit 50 to obtain a scaled image, and then perform quantization processing on the scaled image, and respectively determine the projection variance of the quantized image in different directions through the first determination unit 52, and then determine the pixel parallel line angle information based on the quantized image through the second determination unit 54, and count the number of straight lines in the video image based on the pixel parallel line angle information through the statistical unit 56, and finally determine the stripe interference detection result of the video image through the third determination unit 58 based on the projection variance and the number of straight lines. In this embodiment, an efficient straight line extraction algorithm is used to quickly obtain the number of straight lines in the video image, thereby improving the detection rate of stripe interference, and at the same time, the compressed video image is quantized, and the projection variance of the quantized image in different directions is respectively calculated, so that the detection algorithm has the ability to detect the direction of the stripes, and can significantly reduce the false detection rate of the stripe interference, thereby solving the technical problem of low detection rate when detecting stripe interference in video images in the related art.

[0112] Optionally, the scaling unit includes: a first extraction module, used to extract a video image from the surveillance video; a first filtering module, used to filter the video image using a preset Gaussian kernel to obtain a filtered video image; and a first downsampling module, used to downsample the filtered video image according to a preset scaling factor to obtain a scaled image.

[0113] Optionally, the first determination unit includes: a first quantization module, used to perform quantization processing on the scaled image 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; for the first gradient map and the second gradient map, 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, 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.

[0114] Optionally, the second determination unit includes: a first acquisition module, used to use a custom mask layer to act on the quantized image to obtain a mask image; a third calculation module, used to respectively calculate the first gradient of the mask image in the first direction and the second gradient in the second direction; a fourth calculation module, used to calculate the parallel line angle of each pixel in the mask image based on the first gradient in the first direction and the second gradient in the second direction, to obtain pixel parallel line angle information.

[0115] Optionally, the statistical unit includes: a first statistical module, used to count the straight line candidate area based on pixel parallel line angle information, wherein the straight line candidate area is an area in the mask image where the parallel line angle difference between each two adjacent straight lines is less than a first preset threshold; a first delineation module, used to delineate the minimum detection frame of the straight line candidate area; a second statistical module, used to calculate the main direction of the minimum detection frame of the straight line candidate area, and count the number of straight line points in the straight line candidate area, wherein the main direction of the minimum detection frame is the angle of the straight line connecting the midpoints of the two short sides of the straight line candidate area, and the straight line point is a pixel point in the straight line candidate area where the parallel line angle of the pixel and the main direction angle are less than a second preset threshold; a third statistical module, used to count the number of straight lines in the video image based on the number of straight line points, wherein the straight line is a regional straight line delineated for the straight line candidate area where the number of straight line points is greater than the third preset threshold.

[0116] Optionally, the stripe interference detection device also includes: a first establishment module, used to establish a video blank image with the same size as the video image before scaling the video image to obtain the scaled image, wherein the video blank image is used to save the dynamic change information of each pixel in the monitoring video; a first confirmation module, used to confirm the total number of image frames processed in the preset monitoring video; a first recording module, used to determine whether the pixel is a flickering point based on the dynamic change information and the total number of image frames, and record the number of flickering points.

[0117] Optionally, the third determination unit includes: a first determination module, used to determine the variance weight, straight line number weight and flicker point number weight corresponding to each type of stripe interference; a second determination module, used to determine the stripe interference detection result of the video image based on the projection variance and the corresponding variance weight, the number of straight lines and the corresponding straight line number weight, the number of flicker points and the corresponding straight flicker point number weight, wherein the stripe interference detection result is used to evaluate the interference degree of the stripe noise appearing in the video image to the surveillance video.

[0118] Optionally, the stripe interference detection device further includes: after determining the stripe interference detection result of the video image, a first filtering module is used to filter non-stripe straight lines in the stripe interference detection result by using a preset straight line feature library.

[0119] The above-mentioned stripe interference detection device may also include a processor and a memory. The above-mentioned scaling unit 50, the first determination unit 52, the second determination unit 54, the statistical unit 56, the third determination unit 58, 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.

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

[0121] 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.

[0122] 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: scaling a video image to obtain a scaled image, then quantizing the scaled image, and determining the projection variance of the quantized image in different directions, then determining pixel parallel line angle information based on the quantized image, counting the number of straight lines in the video image based on the pixel parallel line angle information, and finally determining the stripe interference detection result of the video image based on the projection variance and the number of straight lines.

[0123] 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, a stripe interference detection method for a video image of any one of the above-mentioned items of the device where the computer-readable storage medium is located is controlled.

[0124] 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.

[0125] 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.

[0126] 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.

[0127] 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.

[0128] 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.

[0129] 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.

[0130] 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 stripe interference in a video image, characterized in that: include: Performing scaling processing on the video image to obtain a scaled image; Quantizing the scaled image, and determining projection variances of the quantized image in different directions respectively; Based on the quantized image, determining pixel parallel line angle information; Based on the pixel parallel line angle information, counting the number of straight lines in the video image; Determining a stripe interference detection result of the video image based on the projection variance and the number of straight lines; The step of determining the pixel parallel line angle information based on the quantized image comprises: applying a custom mask layer to the quantized image to obtain a mask image; respectively calculating a first gradient of the mask image in a first direction and a second gradient of the mask image in a second direction; and calculating the parallel line angle of each pixel in the mask image based on the first gradient of the first direction and the second gradient of the second direction to obtain the pixel parallel line angle information; The step of counting the number of straight lines in the video image based on the pixel parallel line angle information comprises: counting straight line candidate areas based on the pixel parallel line angle information, wherein the straight line candidate area is an area in the mask image where the difference in parallel line angle between each two adjacent straight lines is less than a first preset threshold; outlining a minimum detection frame for the straight line candidate area; calculating the main direction of the minimum detection frame for the straight line candidate area, and counting the number of straight line points in the straight line candidate area, wherein the main direction of the minimum detection frame is the angle of a straight line formed by connecting the midpoints of two short sides of the straight line candidate area, and the straight line point is a pixel point in the straight line candidate area where the parallel line angle of pixels and the main direction angle are less than a second preset threshold; counting the number of straight lines in the video image based on the number of straight line points, wherein the straight line is a regional straight line outlined for the straight line candidate area where the number of straight line points is greater than a third preset threshold.

2. The fringe interference detection method according to claim 1, characterized in that: The step of scaling the video image to obtain the scaled image includes: Extracting a video image from the surveillance video; Performing a filtering operation on the video image using a preset Gaussian kernel to obtain a filtered video image; The filtered video image is downsampled according to a preset scaling factor to obtain the scaled image.

3. The fringe interference detection method according to claim 1, characterized in that: The step of quantizing the scaled image and determining the projection variance of the quantized image in different directions respectively comprises: Using a preset quantization formula to quantize the scaled image; respectively calculating a first gradient map of the quantized image in a first direction and a second gradient map in a second direction; For the first gradient map and the second gradient map, a first gradient projection variance corresponding to a first direction and a second gradient projection variance corresponding to a second direction are calculated, wherein the first gradient projection variance and the second gradient projection variance are used to determine a stripe direction and a stripe intensity on a video image.

4. The fringe interference detection method according to claim 1, characterized in that: Before scaling the video image to obtain the scaled image, the stripe interference detection method further includes: Establishing a video empty map of the same size as the video image, wherein the video empty map is used to store dynamic change information of each pixel in the surveillance video; Confirm the total number of image frames processed in the preset surveillance video; Based on the dynamic change information and the total number of frames of the image, determine whether the pixel point is a flickering point, and record the number of the flickering points.

5. The fringe interference detection method according to claim 4, characterized in that: The step of determining the stripe interference detection result of the video image based on the projection variance and the number of straight lines comprises: Determine the variance weight, the straight line number weight and the flicker point number weight corresponding to each fringe interference type; Based on the projection variance and the corresponding variance weight, the number of straight lines and the corresponding weight of the number of straight lines, the number of flickering points and the corresponding weight of the number of straight flickering points, the stripe interference detection result of the video image is determined, wherein the stripe interference detection result is used to evaluate the interference degree of the stripe noise appearing in the video image to the surveillance video.

6. The fringe interference detection method according to any one of claims 1 to 5, characterized in that: After determining the stripe interference detection result of the video image, the stripe interference detection method further includes: A preset straight line feature library is used to filter non-stripe straight lines in the stripe interference detection result.

7. A device for detecting fringe interference of a video image, characterized in that: include: A scaling unit, used for scaling the video image to obtain a scaled image; A first determining unit, configured to perform quantization processing on the scaled image and respectively determine the projection variances of the quantized image in different directions; A second determining unit, configured to determine pixel parallel line angle information based on the quantized image; A counting unit, configured to count the number of straight lines in the video image based on the pixel parallel line angle information; A third determination unit, configured to determine a stripe interference detection result of the video image based on the projection variance and the number of straight lines; The second determination unit implements the step of determining the angle information of the parallel lines of pixels based on the quantized image by: applying a custom mask layer to the quantized image to obtain a mask image; respectively calculating a first gradient of the mask image in a first direction and a second gradient in a second direction; Calculating the parallel line angle of each pixel in the mask image based on the first gradient in the first direction and the second gradient in the second direction to obtain pixel parallel line angle information; The statistical unit implements the step of counting the number of straight lines in the video image based on the pixel parallel line angle information in the following manner: based on the pixel parallel line angle information, counting straight line candidate areas, wherein the straight line candidate area is an area in the mask image where the difference in parallel line angle between each two adjacent straight lines is less than a first preset threshold; outlining the minimum detection frame of the straight line candidate area; calculating the main direction of the minimum detection frame of the straight line candidate area, and counting the number of straight line points in the straight line candidate area, wherein the main direction of the minimum detection frame is the angle of a straight line connecting the midpoints of the two short sides of the straight line candidate area, and the straight line point is a pixel point in the straight line candidate area where the parallel line angle of the pixels and the main direction angle are less than a second preset threshold; based on the number of straight line points, counting the number of straight lines in the video image, wherein the straight line is a regional straight line outlined for the straight line candidate area where the number of straight line points is greater than a third preset threshold.

8. 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 interference detection method for video images according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Imaging apparatus and flicker detection method

    CN101622859A

  • A monitoring video stripe rapid detection method

    CN109712107A

  • Video stripe detection method and device, storage medium and electronic device

    CN112752093A