A filtering method for removing an image contaminated by super-high-density salt-and-pepper noise and a related device
Patent Information
- Application Number
- CN202310428500.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-20
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-04-20
AI Technical Summary
[0006]本发明的目的在于提供一种去除超高密度椒盐噪声污染图像的滤波方法及相关装置,以解决现有的椒盐噪声图像滤波算法对低密度椒盐噪声时,滤波效果尚可,一旦噪声密度超过90%,滤波算法几乎失效的问题
[0048]本发明首先采用先检测再滤波的策略,保证信号点不被污染;其次,采用类十字形滤波模板,既充分利用待滤波点邻域信号点,又能极大程度恢复滤波图像的细节信息;最后,本发明提供的滤波方案便于硬件实现。其滤波效果从主观评价到客观评价均优于现有同类滤波方法。
Smart Images

Figure CN116703746B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of signal processing technology, and specifically relates to a filtering method and related apparatus for removing ultra-high density salt-and-pepper noise from images. Background Technology
[0002] Images are often contaminated by impulse noise due to noise and errors generated during image sensor or communication channel transmission. Therefore, removing image noise is crucial before performing subsequent processing such as edge detection, image segmentation, and object recognition.
[0003] Traditional methods for removing impulse noise include using median filters. Median filtering is a nonlinear signal processing technique based on order statistics theory, capable of filtering out impulse noise while preserving image edges. However, traditional median filters cannot distinguish between noise and signal points, making them almost ineffective for high-density noisy images. Therefore, over the past two decades, numerous scholars have conducted extensive research on median-based filters to remove image impulse noise. Furthermore, to avoid contaminating signal points, many recent studies have employed a switching scheme: first detecting noise points, and then filtering only the detected noise points to prevent signal point contamination.
[0004] The Progressive Switching Median Filter (PSMF) was one of the earliest filters to use a switching strategy to remove impulse noise. However, this method uses iterative thresholding for noise detection, leading to missed detections and increased time costs. To address the missed detection problem in PSMF, Eng and Ma proposed the Noise Adaptive Soft-Switching Median Filter (NASMF) using the concept of fuzzy logic. This scheme achieves intelligent noise detection and reduces the missed detection rate. However, when the noise density (ND) becomes larger, choosing a larger filter window can lead to severe image blurring and even higher time costs. For G-level grayscale noise images, damaged pixels are typically digitized into two extreme values: the minimum or maximum value in the dynamic range (0 or G-1). For this reason, impulse noise often appears as white or black dots in the image, which is the source of salt-and-pepper noise. Based on this, many filters identify noise points by defining the maximum and minimum values of the image's dynamic range, such as the Simple Adaptive Median Filter (SAMF), the Fast Efficient Median Filter (FEMF), the Pixel Density Based Trimmed Median Filter (PDBTMF), and the Adaptive Neighborhood Winsorized Mean Filter (ANWMF). For most natural images, this noise detection method is simple and effective. However, not all pixels with an intensity of 0 or G⁻¹ are noise. Considering this, the Probabilistic Decision-Based Improved Trimmed Median Filter (PDITMF) and the Pixel Density Based Filter (BPDF) conditionally determine whether points with values of 0 or G⁻¹ are noise points.
[0005] SAMF adaptively selects the filtering window based on ND, and while the algorithm is simple and easy to implement, its conditions are too stringent. As ND increases, a larger filtering template is required. At this point, the correlation between the filtered point and its neighborhood decreases, causing the filtered image to become more blurry. FEMF and BPDF suffer from the same problem. To address the issue of excessive detail loss due to an overly large filtering template, PDBTMF and ANWMF both use a fixed 3×3 filtering window. When ND > 90%, the filtering window may become a completely noisy window, rendering the PDBTMF algorithm completely ineffective. ANWMF directly assigns a fixed gray value to this situation, resulting in many color blocks with the same gray value in the filtered and restored image, leading to a loss of image detail. Summary of the Invention
[0006] The purpose of this invention is to provide a filtering method and related apparatus for removing ultra-high density salt and pepper noise from images, in order to solve the problem that existing salt and pepper noise image filtering algorithms are acceptable for low-density salt and pepper noise, but almost fail once the noise density exceeds 90%.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] In a first aspect, the present invention provides a filtering method for removing ultra-high density salt-and-pepper noise contamination from an image, comprising:
[0009] Acquire a noisy image, and perform edge mirroring expansion on the noisy image to obtain an edge-expanded noise image;
[0010] Noise detection is performed on the edge-spreading noise image, and the results are recorded in the noise recognition matrix;
[0011] Obtain the filter template, select the corresponding filter template for the noise point, and combine it with the edge-expanded noise image to obtain the filter function;
[0012] The filtered image is determined based on the noise identification matrix being 0, determined by the filtering function.
[0013] Optionally, perform edge mirroring expansion on the noisy image:
[0014] The edge mirror spread function is designed as shown in equation (1):
[0015]
[0016] Where y' represents the edge-mirrored extended image of the noisy image y, with a size of (L+6)×(W+6); y' kgThis represents the gray value at point (k,g), where k,g∈B,B={(k,g)|1≤k≤L+6,1≤g≤W+6}; the region to be processed is (k,g),k,g∈B',B'={(k,g)|4≤k≤L+3,4≤g≤W+3}.
[0017] Optionally, noise detection can be performed on the edge-spreading noise image:
[0018] For each (k,g) within region B', a noise detection matrix M is designed in a left-to-right, top-to-bottom order. NI As shown in equation (2):
[0019]
[0020] in, These represent the number of points with gray levels of 0 and 255 within a w×w window centered at (k,g), respectively, with w taking the value of 7.
[0021] Optional, obtain the filter template:
[0022] Let R1-R6 represent the Euclidean distance from the point to be filtered, with R1 = 1. R3 = 2; R6 = 3; R ED Ω1 represents the Euclidean distance between the point to be filtered (k,g) and its neighborhood (m,n); Ω1 to Ω5 represent the cross-shaped filter templates used in the algorithm.
[0023]
[0024]
[0025]
[0026]
[0027]
[0028] Optional, trim template definition;
[0029] And y'(m,n)≠0),y'(m,n)≠255)},k=1,2,3,4,5
[0030] Define the number of elements in the trim template;
[0031]
[0032] The function card represents The number of elements in the variable is recorded in the variable.
[0033] Optionally, for each noise point, a corresponding filter template is selected, and combined with the edge-spreading noise image, the filter function is obtained:
[0034] The filter function is expressed as:
[0035]
[0036] Optionally, the filtered image is determined based on the filtering function when the noise recognition matrix is 0:
[0037] Within region B', following the principle of left-to-right and top-to-bottom, determine each... Determine the filtered image f for this round;
[0038]
[0039] Take f as the new noise image y, that is, execute y = f, if the corresponding M NI For non-zero matrices, repeat the entire process; if the corresponding M NI If the matrix is zero, then the filtering process ends.
[0040] Secondly, the present invention provides a filtering system for removing ultra-high density salt-and-pepper noise contamination from images, comprising:
[0041] The mirror expansion module is used to acquire a noisy image and perform edge mirror expansion on the noisy image to obtain an edge-expanded noise image;
[0042] The noise detection module is used to detect noise in edge-spreading noise images, and the results are recorded in the noise recognition matrix.
[0043] The filter function acquisition module is used to obtain the filter template. For noise points, the corresponding filter template is selected, and the filter function is obtained by combining it with the edge-expanded noise image.
[0044] The image determination module is used to determine the filtered image when the noise recognition matrix is 0 based on the filtering function.
[0045] Thirdly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a filtering method for removing ultra-high density salt-and-pepper noise contamination from an image.
[0046] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a filtering method for removing ultra-high density salt-and-pepper noise contamination from an image.
[0047] Compared with the prior art, the present invention has the following technical effects:
[0048] This invention first employs a detection-then-filtering strategy to ensure that signal points are not contaminated. Second, it uses a cross-shaped filter template, which fully utilizes the neighboring signal points of the point to be filtered and can recover the detailed information of the filtered image to a great extent. Finally, the filtering scheme provided by this invention is easy to implement in hardware. Its filtering effect is superior to existing similar filtering methods in both subjective and objective evaluations. Attached Figure Description
[0049] Figure 1 The cross-shaped filter template used in the algorithm of this invention is shown in the figure as (a) Ω1; (b) Ω2; (c) Ω3; (d) Ω4; (e) Ω5;
[0050] Figure 2 Comparison of filtering results for traditional median filtering (MF), Haidi's adaptive median filtering algorithm (SAMF), and the adaptive switching median mean filtering algorithm (ASMMBF) proposed in this invention when adding ND: 90% to the test image Lena (Figure: (a) original Lena image; (b) noisy image (ND: 90%); (c) MF; (d) SAMF; (e) ASMMBF)
[0051] Figure 3 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 95% to the test image Lena (in the figure, (a) original Lena image; (b) noisy image (ND: 95%); (c) MF; (d) SAMF; (e) ASMMBF)
[0052] Figure 4 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 99% to the test image Lena (Figure: (a) original Lena image; (b) noisy image (ND: 99%); (c) MF; (d) SAMF; (e) ASMMBF)
[0053] Figure 5 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 90% to a hand X-ray image (Figure: (a) original hand X-ray image; (b) noisy image (ND: 95%); (c) MF; (d) SAMF; (e) ASMMBF)
[0054] Figure 6Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 95% to a hand X-ray image (Figure: (a) original hand X-ray image; (b) noisy image (ND: 95%); (c) MF; (d) SAMF; (e) ASMMBF)
[0055] Figure 7 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 99% to a hand X-ray image (Figure: (a) original hand X-ray image; (b) noisy image (ND: 99%); (c) MF; (d) SAMF; (e) ASMMBF)
[0056] Figure 8 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 90% to the test image "Sailboats" (in the figure: (a) original image of "Sailboats"; (b) noisy image (ND: 95%); (c) MF; (d) SAMF; (e) ASMMBF)
[0057] Figure 9 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 95% to the test image "Sailboats" (Figure: (a) Original image of "Sailboats"; (b) Noisy image (ND: 95%); (c) MF; (d) SAMF; (e) ASMMBF)
[0058] Figure 10 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 99% to the test image "Sailboats" (Figure: (a) Original image of "Sailboats"; (b) Noisy image (ND: 99%); (c) MF; (d) SAMF; (e) ASMMBF)
[0059] Figure 11 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 90% to the test image fingerprint (Figure: (a) original fingerprint; (b) noisy image (ND: 95%); (c) MF; (d) SAMF; (e) ASMMBF)
[0060] Figure 12 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 95% to the test image fingerprint (Figure: (a) original Sailboats image; (b) noisy image (ND: 95%); (c) MF; (d) SAMF; (e) ASMMBF)
[0061] Figure 13 Comparison of MF, SAMF, and ASMMBF filtering results when ND: 99% is added to the fingerprint of the test image (in the figure, (a) original fingerprint image; (b) noisy image (ND: 99%); (c) MF; (d) SAMF; (e) ASMMBF);
[0062] Figure 14 Comparison of MF, SAMF, and ASMMBF filtering results when adding ND: 99% to a nine-grid image of a manual test image (in the figure, (a) original nine-grid image; (b) noisy image (ND: 99%); (c) MF; (d) SAMF; (e) ASMMBF);
[0063] Figure 15 This is a comparison chart of PSNR values for the test images;
[0064] Figure 16 This is a comparison image of the test images using SSIM. Detailed Implementation
[0065] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Specifically, it includes the following steps:
[0066] Step 1: Perform edge mirroring expansion on the noisy image y. The edge mirroring expansion function is designed as shown in equation (1):
[0067]
[0068] y' represents the edge-mirrored extension of the noisy image y, with a size of (L+6)×(W+6). kg This represents the grayscale value at point (k,g) (k,g∈B,B={(k,g)|1≤k≤L+6,1≤g≤W+6}). The region to be processed is (k,g) (k,g∈B',B'={(k,g)|4≤k≤L+3,4≤g≤W+3}).
[0069] Step 2: Perform noise detection on the edge-spreading noise image y'. For each (k,g) region B', design a noise detection matrix M in a left-to-right, top-to-bottom order. NI As shown in equation (2):
[0070]
[0071] in, These represent the number of points with gray levels of 0 and 255 within a w×w window centered at (k,g), respectively, with w taking the value of 7.
[0072] Step 3, filter template design;
[0073] (1) Definition of filter template;
[0074] Let R1 = 1; R3 = 2; R6 = 3; R ED Ω represents the Euclidean distance from the point to be filtered (k, g) to its neighborhood (m, n). Ω1 to Ω5 represent the cross-shaped filter templates used in the algorithm.
[0075]
[0076] (2) Trim template definition;
[0077] And y'(m,n)≠0),y'(m,n)≠255)},k=1,2,3,4,5(4)
[0078] (3) Define the number of elements in the trim template;
[0079]
[0080] The function card represents The number of elements in the variable is recorded in the variable.
[0081] Step four: For the noise points, select the corresponding filter template, and combine the steps shown in Figure (1) to determine the filter function. The design is as follows:
[0082]
[0083] Step 5: Determine the image to be filtered in this round;
[0084] Within region B', following the principle of left-to-right and top-to-bottom, determine each according to formula (6). According to formula (7), determine the filtered image f for this round;
[0085]
[0086] Take f as the new noise image y, that is, execute y = f, if the corresponding M NI For a non-zero matrix, repeat steps one through five; if the corresponding M NI If the matrix is zero, then the filtering process ends.
[0087] The following are specific embodiments provided by the inventor;
[0088] Removing salt-and-pepper noise from images: Traditional median filtering and many other improved median filtering algorithms perform well in low noise density scenarios. However, as the noise density (ND) increases, especially above 90%, these algorithms become completely ineffective. This embodiment presents a filtering algorithm for removing high-density salt-and-pepper noise from images. The process is an adaptive cyclic operation. First, the noisy image undergoes edge mirroring expansion to ensure that edge pixels are processed during filtering. Then, the proposed Adaptive Switching Median Mean Filtering (ASMMBF) algorithm is applied. Finally, the filtering result is used as a new noisy image to determine whether to perform the next round of filtering. Simulation experiments show that this method achieves higher Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity (SSIM) than traditional median filtering methods. Furthermore, the subjective and objective evaluation metrics, PSNR and SSIM, complement each other, facilitating subsequent research and applications in image analysis, image recognition, and detection.
[0089] The test images are digital images of different types and resolutions, including portraits, X-rays, landscapes, fingerprints, and man-made images, for subjective evaluation of the algorithm.
[0090] Figure 2 , Figure 3 , Figure 4 The following are comparative images showing the filtering effects of adding salt-and-pepper noise (ND) of 90%, 95%, and 99% to the portrait image of Lena. (a) is a clear Lena image at a resolution of 512×512; (b) is the noisy image; (c) shows the effect of traditional median filtering (MF); (d) shows the effect of adaptive median filtering (SAMF); and (e) shows the effect of the proposed algorithm's adaptive switching median mean filtering (ASMMBF). As can be seen from the figures, after adding high-density noise (ND: 90%, 95%, 99%), the noise completely overwhelms the signal itself, and the MF algorithm fails to filter at ND of 90%, 95%, and 99%. At ND of 90%, the portrait is recognizable, but the image has black spots, and the edges of the portrait details are blurred; at ND of 95%, the portrait outline is faintly visible, but the image is covered by large areas of black spots; at ND of 99%, the portrait outline is faintly visible, but the image is covered by large areas of black spots. The ASMMB algorithm of this invention has significantly better clarity than MF and SAMF. It restores the detailed features of the image while filtering, and can still recover a recognizable portrait image even when the ND is 99%.
[0091] Figure 5 , Figure 6 , Figure 7The images show a comparison of the filtering effects of adding salt-and-pepper noise with ND values of 90%, 95%, and 99% to hand X-ray images for testing. (a) is a clear hand X-ray image with a resolution of 420×344; (b) is the noisy image; (c) shows the effect of traditional median filtering (MF); (d) shows the effect of adaptive median filtering (SAMF); and (e) shows the effect of the proposed algorithm's adaptive switching median mean filtering (ASMMBF). The images show that after adding high-density noise (ND: 90%, 95%, 99%), the noise completely overwhelms the signal, making the image target completely unidentifiable. The MF algorithm fails to filter at ND values of 90%, 95%, and 99%. The SAMF algorithm can identify the shape of the hand bones at 90% ND; however, the edges of the phalanges and metacarpals are not smooth and have obvious jagged edges, while the edges of the carpal bones are completely blurred and indistinguishable. A few black patches also remain in the filtered image. At 95% ND, the hand outline is faintly visible, but the image is largely covered by large black spots. At 99% ND, the filtered image is almost entirely covered by dark colors, with a few bright spots in the hand area. The ASMMB algorithm of this invention significantly outperforms MF and SAMF in terms of clarity, restoring detailed image features while filtering, especially at 99% ND, still recovering a recognizable hand image.
[0092] Figure 8 , Figure 9 , Figure 10 The following are comparative images showing the filtering effects of adding salt-and-pepper noise (ND) of 90%, 95%, and 99% to a sailboat landscape image for testing. (a) is a clear sailboat landscape image with a resolution of 768×512; (b) is a noisy image; (c) shows the effect of traditional median filtering (MF); (d) shows the effect of adaptive median filtering (SAMF); and (e) shows the effect of the algorithm of this invention adaptively switching median mean filtering (ASMMBF). As can be seen from the figures, after adding high-density noise (ND: 90%, 95%, 99%), the noise completely overwhelms the signal itself, and the MF algorithm fails at ND of 90%, 95%, and 99%. At ND of 90%, the sailboat is identifiable, but the image as a whole has a few black spots, and the edges of the sailboat details are blurred; at ND of 95%, the sailboat outline is faintly visible, but the image as a whole is covered by large black spots; at ND of 99%, the image as a whole is covered by dark colors, and the sailboat outline is completely invisible, indicating that the algorithm fails. The ASMMB algorithm of this invention has a significantly better filtering effect than MF and SAMF. While filtering, it restores the detailed features of the image. When the ND is 90%, the hull, mast, sail and boatman in the image are clearly visible. In particular, when the ND is 99%, a recognizable sailboat image is still restored.
[0093] Figure 11 , Figure 12 , Figure 13The images show a comparison of the filtering effects when salt-and-pepper noise (ND) is added to the test fingerprint images at 90%, 95%, and 99% (ND). (a) is a clear image with a resolution of 480×400; (b) is a noisy image; (c) shows the effect of traditional median filtering (MF); (d) shows the effect of adaptive median filtering (SAMF); and (e) shows the effect of the proposed algorithm's adaptive switching median mean filtering (ASMMBF). As can be seen from the images, after adding high-density noise (ND: 90%, 95%, 99%), the noise completely overwhelms the signal itself, and the MF algorithm fails to filter at ND values of 90%, 95%, and 99%. With the SAMF algorithm, the fingerprint is recognizable at ND 90%, but the image has black spots, and the fingerprint texture is discontinuous and incomplete. At ND 95%, the fingerprint outline is faintly visible, but the image is covered by large areas of black spots. At ND 99%, the fingerprint is completely invisible, and the image is covered by a dark color. The algorithm ASMMB of this invention has significantly better clarity than MF and SAMF. It restores the detailed features of the image while filtering, and can still recover a recognizable fingerprint even when the ND is 99%.
[0094] Figure 14 (a) is a 600×600 resolution artificial nine-square grid image, showing nine squares with a resolution of 200×200, and grayscale values of 30, 200, and 120, corresponding to black, white, and gray in the image. (b) is a nine-square grid image with 99% salt-and-pepper noise added, showing that the noise completely covers the signal. (c) is the effect of traditional median filtering, showing that the algorithm is completely ineffective. (d) is the effect of SAMF filtering, showing that there are a few bright spots in the bright squares, and the nine-square grid pattern is not discernible. (e) is the effect of the ASMMB filtering algorithm of this invention, showing that the nine-square grid pattern is clear, and the grayscale of black, white, and gray is displayed normally.
[0095] Objective evaluation is conducted using Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index (SSIM), with the following specific definitions:
[0096]
[0097]
[0098] In formulas (8) and (9), x represents the original clear image, f represents the filtering result after adding salt-and-pepper noise to x, and L and W represent the filtered and restored images, respectively; μ x μ f Let δ represent the mean of x and f, respectively. x δ f δ represents the variances of x and f, respectively. xf C1 represents the covariance of x and f; for G = 256, C1 takes the value of 6.5025 and C2 takes the value of 58.5225.
[0099] Table 1 shows the PSNR and SSIM values of four natural test images and one artificial image with 90%, 95%, and 99% salt-and-pepper noise added, respectively, using different algorithms.
[0100]
[0101]
[0102] Figure 15 The graph shows a comparison of PSNR and SSIM values for test images under three different noise conditions. The graph demonstrates that the algorithm of this invention has a high signal-to-noise ratio at high noise density.
[0103] Figure 16 The image shows a comparison of PSNR and SSIM values for the test image under three different noise levels. The figure illustrates that the filtered image and the original clear image have a high structural similarity when the algorithm of this invention is used in high noise density conditions.
[0104] In this embodiment, the present invention provides a filtering system for removing ultra-high density salt-and-pepper noise from images, which can be used to implement the above-mentioned filtering method for removing ultra-high density salt-and-pepper noise from images. Specifically, the system includes:
[0105] The mirror expansion module is used to acquire a noisy image and perform edge mirror expansion on the noisy image to obtain an edge-expanded noise image;
[0106] The noise detection module is used to detect noise in edge-spreading noise images, and the results are recorded in the noise recognition matrix.
[0107] The filter function acquisition module is used to obtain the filter template. For noise points, the corresponding filter template is selected, and the filter function is obtained by combining it with the edge-expanded noise image.
[0108] The image determination module is used to determine the filtered image when the noise recognition matrix is 0 based on the filtering function.
[0109] The module division in this embodiment of the invention is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in the various embodiments of the invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0110] In another embodiment of the present invention, a computer device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to achieve a corresponding method flow or corresponding function. The processor described in this embodiment of the present invention can be used in the operation of a filtering method for removing ultra-high density salt-and-pepper noise from images.
[0111] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the filtering method for removing ultra-high-density salt-and-pepper noise contamination from images in the above embodiments.
[0112] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0113] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0114] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0115] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A filtering method for removing ultra-high density salt-and-pepper noise from an image, characterized in that, include: Acquire a noisy image, and perform edge mirroring expansion on the noisy image to obtain an edge-expanded noise image; Noise detection is performed on the edge-spreading noise image, and the results are recorded in the noise detection matrix; Obtain the filter template, select the corresponding filter template for the noise point, and combine it with the edge-expanded noise image to obtain the filter function; The filtered image is determined based on the filtering function when the noise detection matrix is 0. Obtain the filter template: set up R1 - R6 This represents the Euclidean distance from the point to be filtered, specifically taking the value... R1 =1; R2 = ; R3 =2; R4 = ; R5 = ; R6 =3; Represents the point to be filtered ( k , g Distance to neighborhood ( m , n Euclidean distance; ~ These represent the cross-shaped filter templates used in the invented algorithm; ; Trim template definition; Define the number of elements in the trim template; function card represent The number of elements in the variable is recorded in the variable. ; For each noise point, a corresponding filter template is selected, and combined with the edge-spreading noise image, the filter function is obtained: The filtered image is determined based on the filtering function when the noise detection matrix is 0: In the region Inside, following the principle of left to right and top to bottom, determine each Determine the image to be filtered in this round. f ; Will f As a new noisy image y That is, execution y = f ,in For the noise detection matrix, if the corresponding For non-zero matrices, repeat the entire process; if the corresponding If the matrix is zero, then the filtering process ends.
2. The filtering method for removing ultra-high density salt-and-pepper noise from images according to claim 1, characterized in that, Edge mirroring expansion of noisy images: The edge mirror spread function is designed as follows: in, Representing noisy images y The edge-mirrored extended image, with a size of ( L +6)×( W +6); Let represent the gray value of the edge-mirror-extended image y' at coordinates (k, g), where (k, g) belongs to set B. The area to be processed is ( k , g ) k , g ∈ , .
3. The filtering method for removing ultra-high density salt-and-pepper noise from images according to claim 2, characterized in that, Noise detection for edge-spreading noise images: Targeting the region Each of them ( k , g Design the noise detection matrix in a left-to-right, top-to-bottom order. As shown in the following formula: in, , These represent the number of points with gray levels of 0 and 255 within a w×w window centered at (k, g), respectively, with w taking the value of 7.
4. A filtering system for removing ultra-high density salt-and-pepper noise from images, characterized in that, include: The mirror expansion module is used to acquire a noisy image and perform edge mirror expansion on the noisy image to obtain an edge-expanded noise image; The noise detection module is used to detect noise in the edge-spreading noise image, and the results are recorded in the noise detection matrix. The filter function acquisition module is used to obtain the filter template. For noise points, the corresponding filter template is selected, and the filter function is obtained by combining it with the edge-expanded noise image. The image determination module is used to determine the filtered image when the noise detection matrix is 0 based on the filtering function. Obtain the filter template: set up R1 - R6 This represents the Euclidean distance from the point to be filtered, specifically taking the value... R1 =1; R2 = ; R3 =2; R4 = ; R5 = ; R6 =3; Represents the point to be filtered ( k , g Distance to neighborhood ( m , n Euclidean distance; ~ These represent the cross-shaped filter templates used in the invented algorithm; ; Trim template definition; Define the number of elements in the trim template; function card represent The number of elements in the variable is recorded in the variable. ; For each noise point, a corresponding filter template is selected, and combined with the edge-spreading noise image, the filter function is obtained: The filtered image is determined based on the filtering function when the noise detection matrix is 0: In the region Inside, following the principle of left to right and top to bottom, determine each Determine the image to be filtered in this round. f ; Will f As a new noisy image y That is, execution y = f ,in For the noise detection matrix, if the corresponding For non-zero matrices, repeat the entire process; if the corresponding If the matrix is zero, then the filtering process ends.
5. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the filtering method for removing ultra-high density salt-and-pepper noise contamination from an image as described in any one of claims 1 to 3.
6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the filtering method for removing ultra-high density salt and pepper noise contamination from an image as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Noise-detection-based high density impulse noise self-adaptive filtering algorithm
CN103679732A
Method for removing super-high-density salt-and-pepper noises of image
CN105719257A
