A video noise reduction method based on hybrid filtering

By using a hybrid filtering-based video noise reduction method, the weights of median and mean filters are dynamically adjusted by utilizing the set of pixel values ​​within a local window and weighted summation. This solves the technical problem of mixed noise in complex scenes, achieving efficient noise suppression and detail preservation, and improving the robustness and visual effect of image processing.

CN120219228BActive Publication Date: 2025-10-28INSPUR WORLDWIDE SERVICES LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510448786.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-10-28
Estimated Expiration
2045-04-10

AI Technical Summary

Technical Problem

Existing technologies face challenges in noise reduction of complex video scenes, including insufficient ability to suppress mixed noise and an imbalance between detail preservation and noise suppression.

Method used

A video noise reduction method based on hybrid filtering is adopted. By combining the set of pixel values ​​within a local window with pixel weights, the corrected median and corrected mean are obtained. By combining local variance and preset threshold, the weights of median and mean filtering are dynamically adjusted to achieve adaptive noise reduction for regions with different noise types.

Benefits of technology

It significantly improves noise suppression rate, preserves key image details, enhances the robustness and accuracy of image processing, reduces noise interference with results, and strengthens the visual consistency of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219228B_ABST
    Figure CN120219228B_ABST
Patent Text Reader

Abstract

This invention discloses a video noise reduction method based on hybrid filtering, comprising: obtaining a set of pixel values ​​for each pixel position within a selected local window based on frame-by-frame images in the video; obtaining a weighted set of pixel values ​​by weighting the set of pixel values ​​with pixel weights; obtaining corrected median pixel values ​​and corrected mean pixel values ​​by sorting the values ​​of the weighted set of pixel values; obtaining local variance based on the corrected median pixel values ​​and corrected mean pixel values; obtaining local weights by combining local variance with a preset threshold; and obtaining the noise-reduced pixel values ​​by combining the corrected median pixel values ​​and corrected mean pixel values. This invention uses weighted pixel set processing, combined with local variance and adaptive weights, to achieve a balance between noise suppression and detail preservation. Simultaneously, by dynamically adjusting the median and mean filtering weights, it effectively suppresses dust (Gaussian noise) and radio wave spikes (impulse noise) in construction site videos, significantly improving the noise suppression rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of video noise reduction technology, specifically relating to a video noise reduction method based on hybrid filtering. Background Technology

[0002] Video denoising technology is an important research direction in the field of image processing, especially in complex scenarios such as industrial monitoring, security surveillance, and construction sites, where video quality is severely affected by noise interference (such as Gaussian noise, salt-and-pepper noise, and electromagnetic interference), leading to the loss or misjudgment of critical information. Traditional denoising methods mainly rely on a single filter (such as mean filtering or median filtering), but these methods have significant limitations.

[0003] Mean filtering is effective at suppressing Gaussian noise, but it tends to blur image edges and texture details and is ineffective against impulse noise (such as salt and pepper noise). Median filtering can effectively remove impulse noise and preserve edges, but it is not effective at suppressing Gaussian noise and has high computational complexity under large windows, making it difficult to achieve real-time processing.

[0004] In recent years, adaptive hybrid filtering methods have gradually become a research hotspot, aiming to balance noise suppression and detail preservation by dynamically adjusting filtering strategies. For example, some methods determine the noise type based on local statistical characteristics (such as gradient and variance) and switch filtering modes accordingly.

[0005] However, traditional adaptive methods are mostly optimized for a single type of noise and have difficulty handling mixed noise in complex scenes (such as the simultaneous presence of sensor Gaussian noise and impulse noise caused by sudden radio wave interference in construction site videos). Patent CN114399447B discloses a mean filtering method and system, which can process local areas, but it has no ability to suppress impulse noise, resulting in salt-and-pepper noise still existing in the denoised image.

[0006] Moreover, existing methods rely too heavily on mean filtering in flat regions (low texture), leading to blurred edges. While median filtering preserves details in edge regions (high gradient), it fails to eliminate residual Gaussian noise. For example, in construction site videos, the jagged edges or motion blur of pile foundation outlines can result in the loss of key features due to excessive smoothing by mean filtering.

[0007] Existing technologies face core problems when dealing with video noise reduction in complex scenes, such as insufficient ability to suppress mixed noise and an imbalance between detail preservation and noise suppression. Summary of the Invention

[0008] This invention provides a video noise reduction method based on hybrid filtering to solve the problems of insufficient hybrid noise suppression capability and imbalance between detail preservation and noise suppression in existing technologies when processing video noise reduction in complex scenes.

[0009] The technical solution adopted in this invention is as follows:

[0010] A video noise reduction method based on hybrid filtering includes:

[0011] Based on frame-by-frame images in the video, a set of pixel values ​​for each pixel position within a selected local window is obtained.

[0012] Based on the set of pixel values, a weighted set of pixel values ​​is obtained by combining the pixel weights. By sorting the values ​​of the weighted set of pixel values, the corrected median pixel value and the corrected mean pixel value are obtained.

[0013] The local variance is obtained based on the corrected median pixel value and the corrected mean pixel value. The local weight is obtained by combining the local variance with the preset threshold. The denoised pixel value is obtained by combining the corrected median pixel value and the corrected mean pixel value.

[0014] The video noise reduction method based on hybrid filtering described in this invention also includes the following additional technical features:

[0015] The size of the local window, the pixel weight, and the preset threshold are specifically as follows:

[0016] The target image is obtained based on the video location;

[0017] Multiple sets of local window sizes, pixel weights, and preset thresholds are pre-defined to process at least one frame of the video to obtain a denoised image.

[0018] The size of the local window, the pixel weight, and the preset threshold are obtained based on the comprehensive cumulative variance between the denoised image and the target image.

[0019] The preset sizes of the local windows, the pixel weights, and the preset thresholds are specifically defined as follows:

[0020] The size of the local window is preset to 3×3 or 5×5;

[0021] The preset threshold is set according to the noise level of the processed video image;

[0022] The pixel weight is preset based on the distance between the pixel value and the center point of the local window. The smaller the distance, the larger the pixel weight. The pixel weight corresponding to the center point of the local window is greater than or equal to 0.2.

[0023] The combined cumulative variance between the denoised image and the target image is as follows:

[0024] When processing a frame of an image in a video, the cumulative variance between the denoised image and the target image is obtained, and the comprehensive cumulative variance is the cumulative variance.

[0025] When processing multiple frames of images in a video, multiple cumulative variances between the denoised images and the target image are obtained, and the comprehensive cumulative variance is obtained by summing / averaging.

[0026] By sorting the weighted pixel value set numerically, the corrected median pixel value and the corrected mean pixel value are obtained, specifically as follows:

[0027] After sorting the values ​​of the weighted pixel value set, the value corresponding to the median position is the corrected median pixel value;

[0028] The corrected mean pixel value is obtained by summing the values ​​in the weighted pixel value set.

[0029] The local variance is obtained based on the corrected median pixel value and the corrected mean pixel value, specifically as follows:

[0030] The squared difference is obtained based on the corrected median pixel value and the corrected mean pixel value;

[0031] The sum of squared differences corresponding to the local window is obtained by squared differences of multiple pixel values ​​within the local window, and then normalized by combining the size of the local window to obtain the local variance.

[0032] The local variance is combined with a preset threshold to obtain the local weights, specifically:

[0033]

[0034] Where (i, j) are the coordinates of the pixel, σ 2 (i,j) represents the local variance of the local window corresponding to the pixel position, T is the preset threshold, and α(i,j) is the local weight corresponding to the pixel position.

[0035] The local weights are combined with the corrected median pixel value and the corrected mean pixel value to obtain the denoised pixel value, specifically as follows:

[0036] The weighting coefficients for the corrected median pixel value and the corrected mean pixel value are determined using the local weights. The denoised pixel value is then obtained by weighting the corrected median pixel value and the corrected mean pixel value.

[0037] I out (i,j)=α(i,j)·I median (i,j)+(1-α(i,j))·I mean (i, j)

[0038] Among them, I mean (i, j) represents the corrected mean pixel value, I median (i,j) represents the corrected median pixel value, I out(i,j) represents the pixel value after noise reduction.

[0039] Video noise reduction methods based on hybrid filtering also include:

[0040] The pixels of each frame in the video are denoised to obtain the denoised pixel values;

[0041] After denoising each pixel of the frame-by-frame image in the video, the denoised video is obtained by combining multiple pixel values.

[0042] The present invention also provides an electronic device, comprising:

[0043] Memory, used to store computer instructions;

[0044] A processor is used to implement the hybrid filtering-based video noise reduction method when executing the computer instructions.

[0045] Due to the adoption of the above technical solution, the beneficial effects achieved by this invention are as follows:

[0046] 1. In this invention, local variance is obtained based on the corrected median pixel value and the corrected mean pixel value. Local weights are then obtained by combining these with a preset threshold. Finally, the denoised pixel values ​​are obtained by combining the corrected median pixel value and the corrected mean pixel value. Through these local weights, combined with corrected median and mean filtering, the weights of median and mean filtering are adjusted in regions dominated by impulse noise (such as salt-and-pepper noise) and Gaussian noise. In regions dominated by impulse noise (such as salt-and-pepper noise), median filtering is preferentially used to suppress outliers, while in regions dominated by Gaussian noise, mean filtering is preferentially used to smooth noise. This significantly reduces the superimposed effects of dust interference (Gaussian noise) and radio wave surges (impulse noise) in construction site videos, improving the noise suppression rate.

[0047] In addition, median filtering suppresses noise in edge regions while preserving gradient information, and mean filtering reduces Gaussian noise residue in flat regions, avoiding the loss of details caused by a single filtering mode in traditional methods.

[0048] 2. In this invention, a weighted pixel value set is obtained based on the pixel value set and pixel weights. The corrected median pixel value and the corrected mean pixel value are obtained by sorting the values ​​of the weighted pixel value set. By comprehensively processing pixels within a local window, rather than operating on individual pixel values, this method significantly improves the robustness and accuracy of image processing. First, in terms of noise suppression, the weighted calculation and sorting of the pixel value set within the local window effectively reduces the influence of isolated noise points. For example, in salt-and-pepper noise regions, outliers (such as abrupt highlights or dark spots) are weakened after weighted sorting, and the corrected median pixel value is closer to the true value. Simultaneously, the dynamic weight allocation allows the algorithm to handle both Gaussian noise and impulse noise, avoiding the limitations of a single filter in complex noise scenarios.

[0049] Secondly, in terms of detail preservation, pixel weight allocation is automatically adjusted based on neighborhood features (such as gradient information), thereby prioritizing the retention of pixel values ​​with higher gradients in edge regions and avoiding the blurring effect caused by mean filtering; correcting the median pixel value can better preserve edge sharpness while suppressing noise, while correcting the mean pixel value can reflect the overall trend of local areas and ensure the continuity of details in flat areas.

[0050] Furthermore, this processing method improves computational stability, reduces noise interference with the results, and by numerically sorting the weighted pixel value set, correcting the median and mean more accurately reflects the true distribution characteristics of local regions, avoiding biases introduced by noise. Ultimately, this method not only enhances the visual consistency of the image and avoids local inconsistencies (such as spots or jagged edges) caused by single-point processing, but also achieves a natural transition between noise reduction and smoothing, eliminating noise while preserving key details and improving the subjective visual quality of the image.

[0051] In summary, the method based on comprehensive processing of pixels within a local window has stronger noise suppression capabilities, higher detail preservation accuracy, and better computational stability. Attached Figure Description

[0052] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:

[0053] Figure 1 This is a flowchart illustrating the video noise reduction method based on hybrid filtering according to one embodiment of the present invention. Detailed Implementation

[0054] To more clearly illustrate the overall concept of the present invention, a detailed description will be provided below with reference to the accompanying drawings and examples.

[0055] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0056] like Figure 1 As shown, a video noise reduction method based on hybrid filtering includes:

[0057] S100: Based on the frame-by-frame images in the video, obtain the set of pixel values ​​for each pixel position within the selected local window.

[0058] The main purpose of this step is to extract the set of pixel values ​​for each pixel location within a selected local window from frame-by-frame images in the video. This step is fundamental to subsequent processing, providing data support for subsequent weighted calculations, sorting, and noise suppression by obtaining information about the pixel values ​​in the neighborhood.

[0059] A local window refers to a fixed-size region surrounding a target pixel, used to collect values ​​from neighboring pixels. Common window sizes include 3×3 and 5×5.

[0060] Understandably, this step processes each pixel position in the frame-by-frame image of the video. Each pixel position corresponds to a local window, and the pixel position is processed by combining all the pixel values ​​within the local window.

[0061] After processing all pixel positions of an image, the images are combined to obtain the denoised image corresponding to that frame. After processing all frames of a video, the denoised images are combined to obtain the denoised video. Pixel position refers to the number of pixels contained in the width and height of the image, usually expressed in the form of width × height, such as 1280×720 indicating that the image width is 1280 pixels and the height is 720 pixels.

[0062] First, video data needs to be collected on-site and then processed using the highest supported resolution (e.g., 1280×720).

[0063] For each frame of the image, iterate through each pixel position (i,j) and define a local window W. This local window is used to capture all relevant pixel values ​​around that pixel position.

[0064] Let the currently processed pixel position be (i,j), and its neighborhood window size be k×k (e.g., 3×3 or 5×5). The set of pixel values ​​within the window is:

[0065]

[0066] Where I(i,j) represents the pixel value at position (i,j) in the original image, and m and n are... Any integer between 0 and 1.

[0067] Specifically, a 3x3 or 5x5 window size is typically chosen. A window that is too large will result in a loss of detail, while a window that is too small may fail to effectively capture neighboring information. The choice of window size should be adjusted according to the specific application scenario to achieve the best noise reduction effect.

[0068] Furthermore, it is understandable that for pixel locations at edges in an image, if a portion of a local window extends beyond the image boundary, the extended portion needs to be appropriately processed (e.g., padded or ignored) to ensure the validity of all pixel values.

[0069] In one specific embodiment, a high-definition camera is used to capture real-time video streams of the construction site with a resolution of 1280×720.

[0070] For each frame of the image, we process each pixel individually. For example, in a certain frame, we focus on the pixel located at (100, 150).

[0071] Define a 3×3 local window, the set of pixel values ​​within this window is:

[0072] W={I(99,149),I(99,150),I(99,151),I(100,149),I(100,150),I(100,151),I(101,149),I(101,150),I(101,151)}

[0073] If the window extends beyond the image boundary, the following methods can be used: Filling: Fill the extended portion using mirror reflection, copying edge pixels, or constant values. Ignoring: Directly ignore the extended portion and only consider valid pixel values.

[0074] This step processes each frame of the video image pixel by pixel and defines an appropriate local window to obtain the set of pixel values ​​in the neighborhood, laying the foundation for subsequent weighted calculations and noise suppression. This process not only ensures the integrity and validity of the data but also provides the necessary input data for achieving efficient hybrid filtering.

[0075] S200: Based on the set of pixel values, a weighted set of pixel values ​​is obtained by combining the pixel weights. By sorting the values ​​of the weighted set of pixel values, the corrected median pixel value and the corrected mean pixel value are obtained.

[0076] The purpose of this step is to weight the pixel values ​​within the local window using pixel weights to obtain a weighted pixel value set. Then, by sorting the weighted pixel values, the corrected median pixel value and the corrected mean pixel value are calculated. This process effectively suppresses noise while preserving image details, making it particularly suitable for video denoising in complex noisy environments.

[0077] The weighted pixel value set refers to the set obtained by multiplying each pixel value within the local window by its corresponding weight.

[0078] Corrected median pixel value refers to taking the pixel value corresponding to the median position after sorting the weighted set of pixel values, which is used to process salt-and-pepper noise.

[0079] Corrected mean pixel value refers to calculating the weighted average of the weighted set of pixel values, which is used to deal with Gaussian noise.

[0080] In this step, a weight matrix W is defined for each pixel within the local window. The center pixel (i.e., the currently processed pixel position) has the highest weight, and a value greater than 0.2 is recommended. The weights of the remaining pixels decrease according to their distance from the center point.

[0081] Multiply each pixel value by its corresponding weight to obtain the weighted set of pixel values ​​W:

[0082] W={I(i+m,j+n)×w(i+m,j+n)|m,n∈[-k / 2,k / 2]}

[0083] Where w(i,j) is the weight of the center pixel, and a value greater than or equal to 0.2 is recommended; w(i+m,j+n) is the weight of the other pixels.

[0084] Sort the weighted pixel value set W, and take the pixel value corresponding to the median position as the corrected median pixel value I. median (i, j).

[0085] I median (i, j) = median (m,n)∈[-k / 2,k / 2] {I(i+m, j+n)×w(i+m, j+n)}

[0086] This step is suitable for processing salt and pepper noise and reducing radio wave interference.

[0087] Calculate the weighted average of the weighted pixel value set W to obtain the corrected mean pixel value I. mean (i, j).

[0088]

[0089] This step is suitable for handling Gaussian noise and reducing dust interference.

[0090] In this step, the center pixel should be given a high weight (e.g., 0.2) to ensure it dominates the weighting process. The weights of the remaining pixels decrease according to their distance from the center pixel, with closer pixels receiving a larger weight.

[0091] Weighted processing can effectively reduce the impact of noise on the final result. For example, in the salt-and-pepper noise region, outliers are significantly reduced; while in the Gaussian noise region, the weighted average can smooth the noise better.

[0092] In summary, this step, through weighted processing, corrects the median and mean pixel values ​​to more accurately reflect the true pixel values ​​of local areas, thereby effectively suppressing noise. For example, in salt-and-pepper noise regions, correcting the median pixel value can significantly reduce abrupt highlights or dark spots; in Gaussian noise regions, correcting the mean pixel value can smooth background noise.

[0093] Furthermore, correcting the median pixel value can preserve edge information while suppressing noise, avoiding the blurring effect caused by traditional mean filtering. Correcting the mean pixel value can reduce noise residue in flat areas, ensuring continuity of detail.

[0094] As a specific implementation, a 3×3 local window is defined for a pixel position (100, 150) in a certain frame. Assume that the weight of the center pixel is 0.2, and the weights of the surrounding pixels are 0.1, 0.15, etc., forming a weight matrix W.

[0095] Calculate the weighted set of pixel values ​​W:

[0096] W={I(99,149)×0.1,I(99,150)×0.15,I(99,151)×0.1,I(100,149)×0.15,I(100,1 50)×0.2,I(100,151)×0.15,I(101,149)×0.1,I(101,150)×0.15,I(101,151)×0.1}

[0097] Sort the weighted pixel value set W, and take the pixel value corresponding to the median position as the corrected median pixel value I. median (100, 150). For example, if the median after sorting is 128, then I median (100,150)=128.

[0098] Calculate the weighted average of the weighted pixel value set W to obtain the corrected mean pixel value I. mean (100, 150). For example, if the weighted average is 130, then I mean (100,150)=130.

[0099] This step involves defining appropriate pixel weights to weight the pixel values ​​within a local window, and then sorting them to obtain the corrected median and corrected mean pixel values. This process not only enhances noise suppression but also effectively preserves the image's edge and detail features, making it particularly suitable for video denoising in complex noisy environments. Through reasonable weight allocation and weighting, image quality and visual consistency can be significantly improved.

[0100] S300: Obtain the local variance based on the corrected median pixel value and the corrected mean pixel value, combine it with a preset threshold to obtain the local weight, and combine it with the corrected median pixel value and the corrected mean pixel value to obtain the denoised pixel value.

[0101] The purpose of this step is to achieve adaptive noise reduction for regions with different noise types by dynamically adjusting the weights of median and mean filtering. Specifically, local variance is used to quantify the noise intensity of the current region, distinguishing between Gaussian noise (low variance) and impulse noise (high variance). Based on the comparison between the local variance and a preset threshold, the weights of median and mean filtering are dynamically adjusted so that the algorithm prioritizes suppressing outliers in impulse noise regions (median-dominated) and smoothing noise in Gaussian noise regions (mean-dominated). By weighted combination and correcting the median and mean, the denoised pixel values ​​are output, balancing noise suppression and detail preservation.

[0102] Local variance is used to measure the dispersion of pixel values ​​within a local window. The larger the variance, the higher the noise intensity, especially impulse noise (such as salt and pepper noise).

[0103] A preset threshold is a critical value used to distinguish between Gaussian noise and impulse noise. Its value is preset according to the noise level and is usually determined through experiments or noise statistics.

[0104] Local weights are used to dynamically adjust the contributions of median and mean filtering, with values ​​ranging from [0,1]. Larger weights result in a higher contribution from median filtering, and vice versa.

[0105] For each pixel (i,j), based on the corrected median pixel value I median (i, j) and the corrected mean pixel value I mean (i, j), calculate the local variance σ 2 (i, j),

[0106]

[0107] Where k×k is the size of the local window. Local variance can effectively measure noise intensity; the larger the variance, the more significant the impulse noise (such as salt-and-pepper noise), and vice versa, Gaussian noise is dominant.

[0108] According to the preset threshold T and the local variance σ 2 (i, j), calculate the local weight α(i, j) through the weight function,

[0109]

[0110] It can be understood that when σ 2 >>T (impulse noise dominates), α≈1, and the weight biases towards the corrected median pixel value.

[0111] When σ 2 <<T (Gaussian noise dominates), α≈0, and the weight biases towards the corrected mean pixel value.

[0112] The weight function achieves smooth switching through a rational function form, avoiding the mutation problem of traditional binary thresholding and enhancing the robustness of the algorithm.

[0113] According to the weight α(i, j), linearly combine the corrected median and the corrected mean to obtain the denoised pixel value I out (i, j),

[0114] I out (i, j) = α(i, j)·I median (i, j) + (1 - α(i, j))·I mean (i, j)

[0115] Through dynamic weight allocation, the algorithm preferentially preserves details in the edge region (high impulse noise) and preferentially eliminates noise residues in the flat region (Gaussian noise), avoiding the defects of traditional single filtering.

[0116] It can be understood that by comparing the local variance with the threshold T, quickly judge the noise type of the current region:

[0117] The closer α(i, j) is to 1, the impulse noise dominates, that is, the median weight is high and the outliers are suppressed; the closer α(i, j) is to 0, the Gaussian noise dominates, that is, the mean weight is high and the noise is smoothed. The threshold T is preset according to the noise level and can be determined through experiments or noise estimation (such as dark area variance statistics) to ensure adaptability to different scenarios.

[0118] The weight function α(i, j) adopts a rational function form instead of hard threshold switching to ensure smooth weight change and avoid sudden changes in the filtering mode caused by instantaneous fluctuations of noise.

[0119] In a specific embodiment, assume that when processing a pixel point (200,300) in a construction site video, its local window is 3×3.

[0120] The corrected mean I mean = 120, the corrected median Imedian =125.

[0121] Calculate the squared difference of each pixel within the window and then average it:

[0122]

[0123] A variance of 25 indicates the presence of moderate noise.

[0124] Preset threshold T = 10,

[0125]

[0126] The weights were biased towards median filtering (71.4%), and since the variance was significantly higher than the threshold, it was speculated that there was impulse noise (such as radio interference).

[0127] According to the modified median I median =125 and corrected mean I mean =120, thus obtaining

[0128] I out = 0.714 × 125 + 0.286 × 120 ≈ 124.5

[0129] The output value is closer to the corrected median, effectively suppressing outliers (such as abruptly bright pixels) while preserving edge details.

[0130] This step compares the local variance with a threshold, allowing the algorithm to switch filtering modes in real time. For example, in construction site videos, mean filtering is mainly used in areas with dust interference (Gaussian noise) (low variance), while median filtering is mainly used in areas with radio wave surges (impulse noise) (high variance), significantly improving the noise suppression rate.

[0131] Furthermore, in edge regions (such as pile foundation outlines), the increased variance due to impulse noise leads to a bias towards median filtering, avoiding the blurring of edges caused by mean filtering. For example, this reduces the jaggedness of the pile driver's movement trajectory.

[0132] This step achieves adaptive suppression of mixed noise through local variance quantization of noise intensity, dynamic weight allocation, and hybrid filtering. In construction site video scenarios, this step significantly improves noise reduction (such as the joint suppression of dust and radio wave interference) while preserving key details (such as the clarity of pile foundation outlines).

[0133] In a preferred embodiment of the present invention, the size of the local window, the pixel weight, and the preset threshold are specifically as follows:

[0134] The target image is obtained based on the video location;

[0135] Multiple sets of local window sizes, pixel weights, and preset thresholds are pre-defined to process at least one frame of the video to obtain a denoised image.

[0136] The size of the local window, the pixel weight, and the preset threshold are obtained based on the comprehensive cumulative variance between the denoised image and the target image.

[0137] The purpose of this implementation is to dynamically select the optimal parameter combination by pre-setting multiple sets of parameters (local window size, pixel weight, preset threshold) and combining the cumulative variance of the target image and the denoised image. The parameters automatically adapt to different noise types in different scenarios (such as construction dust and radio interference), requiring no manual intervention, reducing reliance on complex hardware or manual parameter tuning, and adapting to low-computing-power devices (such as older cameras). Through the selection of parameter combinations, the quality of the denoised image is maximized (e.g., noise reduction and detail preservation).

[0138] Understandably, the cumulative variance is used as an indicator to measure the difference between the denoised image and the target image. The smaller the value, the closer the denoising effect is to the noise-free benchmark.

[0139] Based on the video's location (e.g., a specific area of ​​the construction site), select a clear, noise-free video clip as the target image. For example, in a pile foundation construction area, select a high-resolution image (e.g., 1280×720) free from dust interference and electromagnetic surges as a reference. The target image provides a benchmark for parameter optimization, ensuring that parameter selection always aims to approximate the real-world scenario.

[0140] As one embodiment of this implementation, multiple sets of the local window sizes, pixel weights, and preset thresholds are pre-defined, specifically as follows:

[0141] The size of the local window is preset to 3×3 or 5×5;

[0142] The preset threshold is set according to the noise level of the processed video image;

[0143] The pixel weight is preset based on the distance between the pixel value and the center point of the local window. The smaller the distance, the larger the pixel weight. The pixel weight corresponding to the center point of the local window is greater than or equal to 0.2.

[0144] Understandably, the preset window size is 3×3 or 5×5. The 3×3 size is suitable for high-frequency detail areas (such as the edges of pile foundation outlines), reducing computational complexity. The 5×5 size is suitable for large-scale noise (such as dust cover), enhancing global noise suppression capabilities.

[0145] The preset threshold T is determined based on the noise level. For example, for Gaussian noise (dust interference), T = 10 is set to make the algorithm biased towards mean filtering. For impulse noise (radio surges), T = 20 is set to make the algorithm biased towards median filtering.

[0146] The weights are assigned based on the distance between pixels and the center of the window, with closer pixels receiving a larger weight, and the center pixel having a weight ≥ 0.2. For example, the center pixel might have a weight of 0.3, adjacent pixels 0.15, and corner pixels 0.1. A higher center weight prioritizes preserving the details of the current pixel, avoiding edge blurring.

[0147] Denoising is applied to at least one frame (or multiple frames) of the video using each set of preset parameters to obtain the denoised image.

[0148] Calculate the cumulative variance between the denoised image and the target image:

[0149]

[0150] Among them, I out I represents the pixel value after noise reduction. target The pixel values ​​of the target image.

[0151] Specifically, when denoising construction videos of pile foundations, images of the pile foundation construction area with no dust and no electromagnetic interference, with a resolution of 1280×720, are selected as the noise-free benchmark.

[0152] Preset parameter groups: Group 1: 3×3 window, center weight 0.3, threshold T = 10 (for Gaussian dust). Group 2: 5×5 window, center weight 0.2, threshold T = 20 (for radio wave impulse noise). Group 3: 3×3 window, center weight 0.25, threshold T = 15 (balanced).

[0153] Noise reduction was performed on 10 frames of video containing dust and radio wave interference. Group 1 performed well in the dust area (mean filtering was dominant), but radio wave noise was not completely eliminated. Group 2 performed well in the radio wave area (median filtering was dominant), but there was still a lot of dust residue. Group 3 had the lowest overall variance (S=1200), preserved details in the edge area (pile foundation outline), and suppressed mixed noise.

[0154] The parameters of group 3 were ultimately chosen because they achieve joint suppression of dust and radio wave interference, and have high computational efficiency (3×3 window).

[0155] As one embodiment of this implementation, the comprehensive cumulative variance between the denoised image and the target image is specifically as follows:

[0156] When processing a frame of an image in a video, the cumulative variance between the denoised image and the target image is obtained, and the comprehensive cumulative variance is the cumulative variance.

[0157] When processing multiple frames of images in a video, multiple cumulative variances between the denoised images and the target image are obtained, and the comprehensive cumulative variance is obtained by summing / averaging.

[0158] In this process, noise reduction is performed on a single frame image, and the cumulative variance S between the frame image and the target image is calculated and directly used as the comprehensive cumulative variance.

[0159] To reduce noise in a multi-frame image (such as a video clip), calculate the cumulative variance of each frame, and obtain the overall cumulative variance by summing or averaging. For example:

[0160]

[0161] Where N is the number of frames, S n This represents the cumulative variance of the nth frame. It is used to handle dynamic scenarios (such as moving pile drivers) and avoid misjudgments caused by sudden noise changes in a single frame.

[0162] Specifically, the video contains 10 frames of images, with the first 5 frames representing dust interference and the last 5 frames representing radio wave surges.

[0163] The cumulative variance of each frame is calculated and averaged to ensure that the parameters adapt to both dust and radio interference. If a set of parameters performs well in dust frames but poorly in radio interference frames, its overall cumulative variance may be high, and it will be excluded.

[0164] In a preferred embodiment of the present invention, the corrected median pixel value and the corrected mean pixel value are obtained by numerically sorting the weighted pixel value set, specifically as follows:

[0165] After sorting the values ​​of the weighted pixel value set, the value corresponding to the median position is the corrected median pixel value;

[0166] The corrected mean pixel value is obtained by summing the values ​​in the weighted pixel value set.

[0167] The purpose of this step is to calculate the corrected median pixel value and the corrected mean pixel value by sorting and summing the weighted pixel value set, providing key inputs for subsequent dynamic blending filtering.

[0168] In this embodiment, the weighted pixel value set W = {I(i+m, j+n) × w(i+m, j+n)} is numerically sorted. The value in the middle position after sorting is taken as the corrected median I. median (i, j). For example, after sorting the 9 weighted pixel values ​​in a 3×3 window, the 5th value is the corrected median.

[0169] In addition, the corrected mean I is obtained by directly summing all the values ​​in the weighted pixel value set W. mean (i, j),

[0170]

[0171] It should be noted that this invention does not require normalization of the weight sum, simplifying the calculation process. Moreover, by directly summing rather than normalizing, it emphasizes the direct contribution of the weights to the pixel values, avoiding instability in the mean due to fluctuations in the weight sum.

[0172] In one specific embodiment, in a video of pile foundation construction at a construction site, a 3×3 window of a certain pixel (200, 300) contains the following pixel values ​​and weights:

[0173]

[0174]

[0175] The weighted pixel values ​​are sorted as follows: 10, 11, 16, 18, 19.5, 20, 21, 22.5, 54.

[0176] Corrected median pixel value: The 5th value after sorting is 19.5, but note that the weighted value here may need to be remapped to the original pixel value range.

[0177] Corrected mean pixel value: The sum is 10+11+16+18+19.5+20+21+22.5+54=192.

[0178] In this embodiment, if there is a sudden change in the original pixel value (such as salt-and-pepper noise with a pixel value of 255), its weighted value will be weakened and moved away from the median position after sorting. The weighted summation preserves the dominance of the center pixel (180) and avoids mean shift caused by Gaussian noise (such as dust interference).

[0179] This implementation method efficiently calculates the corrected median and mean pixel values ​​through weighted sorting and summation, providing core data support for hybrid filtering. In construction site video scenarios, this step significantly improves the ability to suppress mixed noise (such as dust and radio wave interference) while preserving key details (such as pile foundation outlines).

[0180] In a preferred embodiment of the present invention, the local variance is obtained based on the corrected median pixel value and the corrected mean pixel value, specifically as follows:

[0181] The squared difference is obtained based on the corrected median pixel value and the corrected mean pixel value;

[0182] The sum of squared differences corresponding to the local window is obtained by squared differences of multiple pixel values ​​within the local window, and then normalized by combining the size of the local window to obtain the local variance.

[0183] The purpose of this implementation is to calculate the local variance by correcting the median pixel value and the mean pixel value, so as to quantify the noise intensity and provide a basis for subsequent dynamic adjustment of the filter weights.

[0184] Understandably, local variance measures the squared average of the differences between the corrected mean and the corrected median within a local window, reflecting the noise intensity. The larger the variance, the more intense the noise (e.g., impulse noise dominating).

[0185] In this embodiment, for each pixel position (i, j), the modified median pixel value I is used. median (i, j) and the corrected mean pixel value I mean Calculate the square of the difference between (i, j):

[0186] diff 2 (i+m, j+n)=(I mean (i+m,j+n)-I median (i+m, j+n)) 2

[0187] Where m, n∈[-k / 2, k / 2] are the pixel positions within the local window. The squared difference reflects the noise intensity of the current pixel region; the larger the difference, the more severe the noise (such as impulse noise).

[0188] The sum of squared differences among all pixels within the local window is obtained by summing the squared differences:

[0189]

[0190] The sum of squares integrates the noise differences of all pixels within the window, providing the basis data for subsequent normalization.

[0191] Divide the sum of squared differences by the size k of the local window. 2 The local variance σ is obtained. 2 (i, j):

[0192]

[0193] Normalization ensures that the variance results are independent of the window size, facilitating comparisons between different window sizes (such as 3×3 and 5×5 windows) without requiring additional adjustments.

[0194] This implementation method calculates the sum of squares of the differences between the corrected mean and the median, and obtains the local variance by normalizing the window size, thereby achieving accurate quantification of noise intensity.

[0195] In a preferred embodiment of the present invention, the local variance is combined with a preset threshold to obtain the local weight, specifically as follows:

[0196]

[0197] Where (i, j) are the coordinates of the pixel, σ 2 (i, j) represents the local variance of the local window corresponding to the pixel position, T is the preset threshold, and α(i, j) is the local weight corresponding to the pixel position.

[0198] The purpose of this implementation is to utilize the local variance σ 2 Given (i,j) and a preset threshold T, the local weight α(i,j) of each pixel is dynamically calculated, thereby achieving an adaptive hybrid of median filtering and mean filtering.

[0199] Based on the local variance σ 2 Given (i, j) and a preset threshold T, the local weight α(i, j) is calculated using the following formula:

[0200]

[0201] Where, σ 2 (i, j) represents the local variance, used to measure noise intensity. T is a preset threshold, used to control the sensitivity of weight switching.

[0202] The value range α(i,j)∈[0,1] represents the weight ratio of median filtering.

[0203] It is understandable that when σ 2 >> When T (impulse noise dominates), α≈1, the weights are biased towards median filtering (suppressing outliers).

[0204] When σ 2 When << T (Gaussian noise dominates), α≈0, and the weights are biased towards mean filtering (smoothing noise).

[0205] Regarding the setting of the threshold T, when Gaussian noise (such as dust interference) is dominant, a smaller T (e.g., T=10) is set so that the algorithm prioritizes the use of mean filtering. When impulse noise (such as radio surges) is dominant, a larger T (e.g., T=20) is set so that the algorithm prioritizes the use of median filtering.

[0206] Meanwhile, T can be dynamically adjusted through dark area variance statistics or noise level analysis to adapt to complex scenarios.

[0207] Using a rational function form (rather than a hard threshold) ensures smooth weight changes and avoids abrupt changes in the filtering mode due to instantaneous noise fluctuations. For example, when σ 2 When the weights change slowly from around T, visual artifacts are reduced.

[0208] Moreover, the weight of each pixel is calculated independently, ensuring the algorithm's adaptability to different regions of the image (such as edges and flat areas).

[0209] In one specific embodiment, assume the local variance σ of a certain pixel (200, 300) is... 2 =25, preset threshold T=10:

[0210] The weights are then calculated as follows:

[0211]

[0212] The weight bias towards median filtering (71.4%) indicates that there is strong impulse noise (such as radio surges) in the current area.

[0213] If there are abrupt pixel values ​​near the pixel (such as salt-and-pepper noise of 255), median filtering will suppress outliers and preserve edge details (such as pile foundation outlines).

[0214] If σ 2 =5 (dust interference), then α≈0.33. Mean filtering will smooth background noise and improve image clarity.

[0215] This step calculates weights based on the ratio of local variance to a preset threshold, achieving an adaptive blend of median and mean filtering. In construction site video scenarios, this method significantly improves the suppression of mixed noise (such as dust and radio wave interference) while preserving key details (such as the clarity of pile foundation outlines).

[0216] In a preferred embodiment of this method, the local weights are combined with the corrected median pixel value and the corrected mean pixel value to obtain the denoised pixel value, specifically as follows:

[0217] The weighting coefficients for the corrected median pixel value and the corrected mean pixel value are determined using the local weights. The denoised pixel value is then obtained by weighting the corrected median pixel value and the corrected mean pixel value.

[0218] I out (i,j)=α(i,j)·I median (i,j)+(1-α(i,j))·I mean (i,j)

[0219] Among them, I mean (i,j) represents the adjusted mean pixel value, I median (i,j) represents the corrected median pixel value, I out (i,j) represents the pixel value after noise reduction.

[0220] The purpose of this embodiment is to correct the median pixel value I by using local weight α(i,j). median (i,j) and the corrected mean pixel value I mean The values ​​(i,j) are weighted to obtain the denoised pixel value I. out(i,j) dynamically mixes the median and mean filtering results according to the noise type, avoiding the limitations of a single filter.

[0221] Based on the local weights α(i, j), the weighting coefficients for the corrected median and the corrected mean are determined directly:

[0222] The weight of the corrected median is α(i,j) (range [0,1]); the weight of the corrected mean is 1-α(i,j).

[0223] The corrected median and corrected mean are linearly combined according to their weights to obtain the final denoised pixel values:

[0224] I out (i,j)=α(i,j)·I median (i,j)+(1-α(i,j))·I mean (i, j)

[0225] Through dynamic weight allocation, the algorithm prioritizes preserving details in edge regions (high impulse noise) and prioritizing the elimination of noise residue in flat regions (Gaussian noise).

[0226] It is understandable that when α≈1, the region is dominated by impulse noise, the output value is close to the corrected median, and outliers (such as abruptly bright pixels) are suppressed.

[0227] When α≈0, it is the region dominated by Gaussian noise, and the output value is close to the corrected mean, smoothing out random noise.

[0228] Furthermore, this embodiment can ensure I out Avoid overflow or truncation within the valid pixel value range (e.g., 0-255).

[0229] Specifically, in the noise reduction of a certain pixel (200, 300) in the construction site pile foundation video, the corrected median I... median =150 (edge ​​pixel value); Corrected mean I mean =140 (background pixel value affected by Gaussian noise); local weight α = 0.7 (due to local variance σ) 2 =25, preset threshold T=10).

[0230] Weighted calculation

[0231] I out =0.7×150+0.3×140=105+42=147

[0232] In this embodiment, the corrected mean of 140 is affected by Gaussian noise, but its contribution is limited by a weight of 0.3 to avoid blurring the edges. The corrected median of 150 preserves the sharpness of the pile foundation outline, and a weight of 0.7 ensures that edge details are not lost. The final output of 147 is close to the median, effectively suppressing background noise (such as dust interference) while preserving edge clarity.

[0233] This embodiment achieves adaptive suppression of mixed noise by weighting the corrected median and mean with local weights. In construction site video scenarios, this method significantly improves noise reduction (such as the joint suppression of dust and radio wave interference) while preserving key details (such as the clarity of pile foundation outlines).

[0234] As a preferred embodiment of the present invention, the video noise reduction method based on hybrid filtering further includes:

[0235] The pixels of each frame in the video are denoised to obtain the denoised pixel values;

[0236] After denoising each pixel of the frame-by-frame image in the video, the denoised video is obtained by combining multiple pixel values.

[0237] The purpose of this implementation is to extend the single-frame noise reduction algorithm into a complete video noise reduction process by processing each pixel in the video frame by frame, thereby ensuring the continuity and real-time performance of the output video.

[0238] For each frame of the video, iterate through all pixels (i, j) to obtain the noise reduction value I for each pixel. out (i, j).

[0239] For each frame of the image, the local window parameters, median / mean, local variance, and weights are calculated independently to ensure the independence of single-frame processing.

[0240] For example, in construction site videos, dust and radio noise are processed independently for each frame of the pile foundation construction area.

[0241] The noise reduction value I of all pixels out (i, j) are combined according to their spatial positions to form a complete denoised image frame. All processed frames are arranged in their original temporal order to form a continuous denoised video.

[0242] The noise reduction parameters (such as window size and weights) for each frame are calculated independently to avoid processing deviations in the current frame due to changes in the noise type of the previous frame. For example, if a frame experiences a sudden increase in local variance due to radio wave interference, its weights will be biased towards median filtering, while the weights will automatically switch when dust dominates in the next frame.

[0243] It is important to note that to avoid flickering or frame skipping caused by differences in single-frame processing (such as sudden changes in noise suppression intensity), inter-frame consistency checks are necessary. Smaller window sizes (e.g., 3×3) should be used for moving areas (e.g., pile driver movement) to reduce motion blur; larger windows (e.g., 5×5) should be used for static areas to enhance noise reduction.

[0244] This step extends the process from single-frame algorithms to complete video processing by combining frame-by-frame pixel-level noise reduction with video stream processing. In construction site monitoring scenarios, this method not only improves noise suppression (such as the combined processing of dust and radio wave interference) but also ensures the real-time performance and dynamic continuity of the video.

[0245] The present invention also provides an electronic device, comprising:

[0246] Memory, used to store computer instructions;

[0247] A processor is used to implement the hybrid filtering-based video noise reduction method when executing the computer instructions.

[0248] Therefore, this electronic device can achieve any effect of the video noise reduction method based on hybrid filtering, which will not be elaborated here.

[0249] For any parts not mentioned in this invention, existing technologies can be used or referenced.

[0250] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.

[0251] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.

Claims

1. A video noise reduction method based on hybrid filtering, characterized in that, include: Based on frame-by-frame images in the video, a set of pixel values ​​for each pixel position within a selected local window is obtained. Based on the set of pixel values, a weighted set of pixel values ​​is obtained by combining the pixel weights. By sorting the values ​​of the weighted set of pixel values, the corrected median pixel value and the corrected mean pixel value are obtained. The local variance is obtained based on the corrected median pixel value and the corrected mean pixel value. The local weight is obtained by combining the local variance with the preset threshold. The denoised pixel value is obtained by combining the corrected median pixel value and the corrected mean pixel value. Specifically, the size of the local window, the pixel weight, and the preset threshold are: Based on the video location, obtain the target image. The size of the local window is preset to 3×3 or 5×5. A preset threshold is preset based on the noise level of the processed video image. Pixel weights are preset based on the distance between the pixel value and the center point of the local window; the smaller the distance, the larger the pixel weight. The pixel weight corresponding to the center point of the local window is greater than or equal to 0.

2. Multiple sets of local window sizes, pixel weights, and preset thresholds are preset to process at least one frame of the video image to obtain a denoised image. The size of the local window, the pixel weight, and the preset threshold are obtained based on the comprehensive cumulative variance between the denoised image and the target image.

2. The video noise reduction method based on hybrid filtering according to claim 1, characterized in that, The combined cumulative variance between the denoised image and the target image is as follows: When processing a frame of an image in a video, the cumulative variance between the denoised image and the target image is obtained, and the comprehensive cumulative variance is the cumulative variance. When processing multiple frames of images in a video, multiple cumulative variances between the denoised images and the target image are obtained, and the comprehensive cumulative variance is obtained by summing / averaging.

3. The video noise reduction method based on hybrid filtering according to claim 1, characterized in that, By sorting the weighted pixel value set numerically, the corrected median pixel value and the corrected mean pixel value are obtained, specifically as follows: After sorting the values ​​of the weighted pixel value set, the value corresponding to the median position is the corrected median pixel value; The corrected mean pixel value is obtained by summing the values ​​in the weighted pixel value set.

4. The video noise reduction method based on hybrid filtering according to claim 1, characterized in that, The local variance is obtained based on the corrected median pixel value and the corrected mean pixel value, specifically as follows: The squared difference is obtained based on the corrected median pixel value and the corrected mean pixel value; The sum of squared differences corresponding to the local window is obtained by squared differences of multiple pixel values ​​within the local window, and then normalized by combining the size of the local window to obtain the local variance.

5. The video noise reduction method based on hybrid filtering according to claim 1, characterized in that, The local variance is combined with a preset threshold to obtain the local weights, specifically: in, These are the coordinates of the pixel. This represents the local variance of the local window corresponding to the pixel location. T For the preset threshold, This represents the local weight corresponding to the pixel location.

6. The video noise reduction method based on hybrid filtering according to claim 5, characterized in that, The local weights are combined with the corrected median pixel value and the corrected mean pixel value to obtain the denoised pixel value, specifically as follows: The weighting coefficients for the corrected median pixel value and the corrected mean pixel value are determined using the local weights. The denoised pixel value is then obtained by weighting the corrected median pixel value and the corrected mean pixel value. in, To correct the mean pixel value, To correct the median pixel value, These are the pixel values ​​after noise reduction.

7. The video noise reduction method based on hybrid filtering according to claim 1, characterized in that, Also includes: The pixels of each frame in the video are denoised to obtain the denoised pixel values; After denoising each pixel of the frame-by-frame image in the video, the denoised video is obtained by combining multiple pixel values.

8. An electronic device, characterized in that, include: Memory, used to store computer instructions; A processor, configured to implement the video noise reduction method based on hybrid filtering as described in any one of claims 1 to 7 when executing the computer instructions.

Citation Information

Patent Citations

  • Mean filtering method and system

    CN114399447B

  • Image speckle noise suppression method based on central affine filtering

    CN109615597A

  • Self-adaptive non-local mean image denoising method

    CN113643201A