A denoising processing method based on region labeling
By subdividing the image into different regions and employing a noise reduction method and fusion technique that matches the characteristics of each region, the problem of significant loss of sharpness in existing technologies is solved, achieving effective noise reduction while preserving sharpness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI JUNZHENG TECH CO LTD
- Filing Date
- 2021-10-25
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technologies suffer from significant loss of sharpness and are unable to segment different regions during image denoising.
The image is subdivided into different regions, and different noise reduction methods are used according to the characteristics of each region. The noise in each region is then processed by image fusion technology, including image region labeling, dimensional segmentation, noise reduction and fusion.
It effectively reduces noise, especially in flat and detailed areas, while maintaining image sharpness, thus preserving more image details.
Smart Images

Figure CN116029910B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a noise reduction method based on region labeling. Background Technology
[0002] Images are an important source of information, and image processing can help people understand the meaning of information. However, images are often degraded during generation and transmission due to various noise interferences, which adversely affects subsequent image processing (such as segmentation, compression, and image understanding). There are many types of noise, such as electrical noise, mechanical noise, channel noise, and others. To suppress noise, improve image quality, and facilitate higher-level processing, image denoising preprocessing is necessary. The impact of noise on the amplitude and phase of image signals is very complex; some noise is independent and uncorrelated with the image signal, while others are correlated, and even the noise itself may be correlated.
[0003] In existing technologies, various denoising methods have been proposed based on the characteristics of actual images, the statistical features of noise, and the spectral distribution patterns. The most intuitive method is to use low-pass filtering, based on the characteristic that noise energy is generally concentrated in the high frequencies while the image spectrum is distributed within a finite interval. Examples include moving average window filters, Wiener linear filters, and methods based on first-order filtering (ranking). However, low-pass filtering is a double-edged sword; while eliminating image noise, it also eliminates some useful high-frequency information. Therefore, research on various denoising methods is essentially a trade-off between noise reduction and preservation of high-frequency information. High-frequency information contains numerous image details; eliminating it will result in a loss of image sharpness.
[0004] Therefore, the shortcomings of existing technologies are as follows:
[0005] 1. When an image contains significant noise, denoising results in a substantial loss of sharpness. Existing technologies employ various denoising methods to address image noise issues, such as Gaussian filtering, median filtering, and wavelet denoising. However, these methods indiscriminately process different regions of an image, such as flat areas and detailed areas.
[0006] 2. The noise reduction process applies to the entire image and cannot segment and process different regions. Existing noise reduction technologies operate on the entire image and the noise reduction methods are relatively simple.
[0007] In addition, commonly used terms in the prior art include:
[0008] Binary image: The brightness value of the image has only two states: black and white.
[0009] Connected component labeling: By labeling pixels (targets) in a binary image, each individual connected component forms an identified block, which can then be used to obtain geometric parameters such as the outline, bounding rectangle, centroid, etc. of these blocks.
[0010] Alpha fusion: a weighted fusion of images, where the pixel value of each pixel is calculated by weighting the corresponding pixels of the two images.
[0011] High-quality images: images with no noise, or images with noise so small that it is negligible.
[0012] Laplacian algorithm: a second-order differential linear operator. In image edge processing, the second-order differential has stronger edge localization capabilities and better sharpening effect.
[0013] The degree of disorder of lines: that is, the number of lines contained in an area, including straight lines, curves, etc. Summary of the Invention
[0014] In order to solve the above problems, the object of the present invention is:
[0015] This method reduces image noise without compromising image sharpness. Based on the characteristics of different regions, such as texture and color, the image is subdivided into different regions, which are then labeled and segmented. The noise characteristics of each region are analyzed, and different denoising methods are used to process the noise in each region separately. Finally, the images are fused to obtain the final output image. This method effectively reduces noise in flat areas, relatively flat areas, and detailed areas, while minimizing the loss of image sharpness and preserving more image details.
[0016] Specifically, the present invention provides a noise reduction processing method based on region labeling, the method comprising:
[0017] S1: Image region labeling: Convert the color image into a grayscale image, then obtain the grayscale gradient image, and binarize it;
[0018] S2: Image Dimension Segmentation: The image is divided into different feature regions and labeled using connected component labeling and edge detection algorithms. Based on the labels, the image is divided into different dimension maps.
[0019] S3, Image Denoising: Denoising is performed using different denoising methods based on the features of each dimension of the image;
[0020] S4, Image Fusion: Obtain a high-quality image based on the image region features, perform alpha fusion processing on the high-quality image and the corresponding dimension image; finally, overlay the denoised images of all dimensions to obtain a denoised grayscale image, and then convert it into a color image for output.
[0021] The method is further described as follows:
[0022] S1. A noisy color image is converted to grayscale. The color image is an RGB image. The gradient of the grayscale image is calculated. Gradients less than or equal to a threshold are set to 0, and others are set to 1. The resulting binarized gradient image is labeled using an eight-neighbor labeling algorithm.
[0023] S2: Use the Laplacian operator to perform edge detection on the grayscale image corresponding to each connected component, and count the number of edges in each region. Based on the number of edges, divide the image into at least two dimensions by setting a threshold. Segmentation is achieved by setting the thresholds in step S2: If thresholds a, b, ..., m, n are set, regions less than threshold a are divided into the first region, corresponding to the first dimension, and the corresponding image is the first-dimensional image; regions between thresholds a and b are divided into the second region, corresponding to the second dimension, and the corresponding image is the second-dimensional image; ..., regions between thresholds m and n are the Xth region, corresponding to the Xth dimension, and the corresponding image is the Xth-dimensional image; regions greater than threshold n are divided into the Yth region, corresponding to the Yth dimension, and the corresponding image is the Yth-dimensional image. The more regions divided, the more accurate the image denoising process.
[0024] S3, apply the corresponding filtering algorithms to the first dimension graph, the second dimension, ..., the Y-th dimension graph for noise reduction;
[0025] S4, the filtered first-dimensional image, second-dimensional image, ... and Y-dimensional image are fused with the obtained noise-free first-dimensional image, second-dimensional image, ... and Y-dimensional image alpha, respectively;
[0026] Finally, the fused first-dimensional image, second-dimensional image, ... Y-th-dimensional image are superimposed and fused to obtain the final denoised image.
[0027] Step S1: Image region marking, further includes:
[0028] 1) Convert the color RGB image to grayscale, as shown in formula (1); calculate the grayscale gradient image, as shown in formulas (2)-(4); grayscale gradient Figure 2 Value-based, as shown in formulas (5)-(6):
[0029] F(x, y)=0.299*R(x, y)+0.587*G(x, y)+0.114*B(x, y) (1)
[0030] Where F(x, y) represents the grayscale image; R(x, y) represents the image of the R channel; G(x, y) represents the image of the G channel; B(x, y) represents the image of the B channel; (x, y) represents the pixel coordinates, x represents the x-axis, and y represents the y-axis.
[0031]
[0032]
[0033]
[0034] Among them, g x G represents the gradient in the x-direction. y M(x, y) represents the gradient in the y-direction, (x, y) represents the pixel coordinates, x represents the x-axis, y represents the y-axis, and M(x, y) represents the gradient grayscale image.
[0035]
[0036] Where I(x, y) is the gray-level gradient binary image, and T1 is the threshold, as shown in the following formula (6).
[0037]
[0038] Where m is the number of pixels in the image along the x-axis, and n is the number of pixels in the image along the y-axis;
[0039] 2) Eight-neighbor labeling method: Determine the leftmost, top-left, topmost, and top-right points in the eight-neighborhood of this pixel. If none of them are present, it indicates the start of a new region. If the leftmost point and both the top and right points in the eight-neighborhood of this pixel are present, then mark this pixel as the smallest of the two and change the larger label to the smaller label. If the top-left point and both the top and right points in the eight-neighborhood of this pixel are present, then mark this pixel as the smallest of the two and change the larger label to the smaller label. Otherwise, mark this pixel as one of the four points in the order of leftmost, top-left, topmost, and top-right.
[0040] There are a total of 8 points in the eight-neighborhood, including points at the diagonal positions.
[0041] In step S2, the edge detection algorithm used employs the Laplacian operator to perform edge detection on the grayscale image of the region corresponding to each connected component, but it is not limited to the Laplacian algorithm; the Tenengrad gradient algorithm is also included.
[0042] In step S2, if the image is subdivided into two regions using this method, then when the edge value in the connected component is greater than the threshold in S2, the threshold range is between the maximum and minimum values of the number of edges counted in all connected components. The specific value can be customized. In this case, it is determined to be a non-flat region, and the rest are flat regions.
[0043] Based on the identified regions, namely flat and non-flat areas, the grayscale image is divided into a first-dimensional image, where the pixel values in the flat areas remain unchanged and the remaining areas are filled with 0; and a second-dimensional image, where the pixel values in the non-flat areas remain unchanged and the remaining areas are filled with 0; thus, the grayscale image is divided into two dimensions.
[0044] Step S2: Image dimension segmentation further includes:
[0045] The Laplace algorithm is used to detect the edges of the grayscale image of the corresponding region after labeling, as shown in the following formula (7), and the number of edges in each region is counted. When the number of edges in the connected component is less than or equal to the threshold in S2, this region is judged as a flat region, and other regions are non-flat regions.
[0046]
[0047] Where F(x, y) is a grayscale image, which is the same as the one in formula (1), and x and y represent the x-axis and y-axis, respectively.
[0048] Step S3, image denoising, further includes:
[0049] The core of the first-dimensional plot is flat region data, and a median filtering algorithm is used to obtain a denoised image of the flat region; the core of the second-dimensional plot is non-flat region data, and a bilateral filtering algorithm is used to obtain a denoised image of the non-flat region. Figure 1 .
[0050] Step S4: Image fusion, further includes:
[0051] High-quality images are obtained through simulation based on image region features, namely noise-free first-dimensional images and noise-free second-dimensional images. This method is not limited; deep learning methods can also be used to obtain these two-dimensional images. (Noise reduction in flat regions) Figure 1 Perform alpha fusion with the noise-free first-dimensional map to obtain noise reduction in the flat region. Figure 2 Noise reduction in non-flat regions Figure 1 Alpha fusion is performed with the noise-free second-dimensional map to obtain noise reduction in non-flat regions. Figure 2 The alpha fusion processing algorithm is shown in Formula 8 below. Finally, noise reduction is performed on the flat region. Figure 2 Noise reduction in non-flat regions Figure 2 The image is then overlaid and fused to obtain a denoised grayscale image, which is then converted into a color image for output.
[0052] D(x, y)=a*S1(x, y)+(1-a)*S2(x, y)+g (8)
[0053] Where S1(x,y) represents the denoised image, S2(x,y) represents the noise-free image, D(x,y) represents the fused image, a is the alpha fusion coefficient, the parameter of the denoised image during fusion, and g is a constant, which usually depends on the average and maximum values to be adjusted for the pixels.
[0054] In step S4, the noise-free first-dimensional and second-dimensional graphs can also be obtained through other methods, including deep learning.
[0055] Therefore, the advantage of this application is:
[0056] The method proposed in this application can achieve better noise suppression with minimal loss of sharpness. The method can distinguish different regions of an image by block and perform targeted noise reduction based on the characteristics of each region. Attached Figure Description
[0057] The accompanying drawings, which are provided to further illustrate the invention and form part of this application, are not intended to limit the scope of the invention.
[0058] Figure 1 This is a flowchart of the method of the present invention.
[0059] Figure 2 This is a schematic diagram of the noise reduction process of the method in the embodiments of this application.
[0060] Figure 3 This is a schematic diagram of the image region marking process of the method in the embodiments of this application.
[0061] Figure 4 This is a schematic diagram illustrating the method in the embodiments of this application.
[0062] Figure 5 This is a schematic diagram of the eight fields of the method in the embodiments of this application. Detailed Implementation
[0063] To better understand the technical content and advantages of the present invention, the present invention will now be described in further detail with reference to the accompanying drawings.
[0064] This invention is an image denoising method based on region labeling, which mainly involves four parts: image region labeling, image dimension segmentation, image denoising, and image fusion.
[0065] First, a noisy color image is converted to grayscale. The color image is an RGB image. The gradient of the grayscale image is calculated, with gradients less than or equal to a threshold set to 0, and others set to 1. The resulting binary gradient image is labeled using an eight-neighbor labeling algorithm. Then, the Laplacian operator is used to perform edge detection on the grayscale image corresponding to each connected region, and the number of edges in each region is counted. When the value is greater than the threshold, it is determined to be a non-flat region. This method can also subdivide the image into more regions; the more regions, the more accurate the image denoising. This paper uses dividing the image into two regions as an example to illustrate its principle. The grayscale image is divided into two dimensions based on flat and non-flat regions. The first dimension image is the flat region image, where the grayscale values in the flat regions remain unchanged, and the rest are filled with 0. The second dimension image is the non-flat region image, where the grayscale values in the non-flat regions remain unchanged, and the rest are filled with 0. The first dimension image is processed using median filtering, but the filtering method is not limited to median filtering. The second dimension image is processed using bilateral filtering, and other filtering algorithms are also acceptable. The filtered first-dimensional and second-dimensional images are fused with the simulated noise-free first-dimensional and second-dimensional images alpha, respectively. The noise-free first-dimensional and second-dimensional images can also be obtained through other methods, such as deep learning. Finally, the fused first-dimensional and second-dimensional images are superimposed to obtain the final denoised image.
[0066] Specifically, such as Figure 1 As shown, this application relates to a noise reduction processing method based on region labeling, the method comprising:
[0067] S1: Image region labeling: Convert the color image into a grayscale image, then obtain the grayscale gradient image, and binarize it;
[0068] S2: Image Dimension Segmentation: The image is divided into different feature regions and labeled using connected component labeling and edge detection algorithms. Based on the labels, the image is divided into different dimension maps.
[0069] S3, Image Denoising: Denoising is performed using different denoising methods based on the features of each dimension of the image;
[0070] S4, Image Fusion: Obtain a high-quality image based on the image region features, perform alpha fusion processing on the high-quality image and the corresponding dimension image; finally, overlay the denoised images of all dimensions to obtain a denoised grayscale image, and then convert it into a color image for output.
[0071] The method is further described as follows:
[0072] S1. A noisy color image is converted to grayscale. The color image is an RGB image. The gradient of the grayscale image is calculated. Gradients less than or equal to a threshold are set to 0, and others are set to 1. The resulting binarized gradient image is labeled using an eight-neighbor labeling algorithm.
[0073] S2: The Laplacian operator is used to perform edge detection on the grayscale image corresponding to each connected component, and the number of edges in each region is counted. Based on the number of edges, a threshold is set. This threshold ranges between the maximum and minimum values of the counted edge count in all connected components. The specific value can also be customized. This divides the image into at least two dimensions. Segmentation is achieved by setting the threshold in step S2: If thresholds a, b, ..., m, n are set, regions less than threshold a are divided into the first region, corresponding to the first dimension, and the corresponding image is the first-dimensional image. Regions between thresholds a and b are divided into the second region, corresponding to the second dimension, and the corresponding image is the second-dimensional image, ..., regions between thresholds m and n are the Xth region, corresponding to the Xth dimension, and the corresponding image is the Xth-dimensional image. Regions greater than threshold n are divided into the Yth region, corresponding to the Yth dimension, and the corresponding image is the Yth-dimensional image. The more regions divided, the more accurate the image denoising process.
[0074] S3, apply the corresponding filtering algorithms to the first dimension graph, the second dimension, ..., the Y-th dimension graph for noise reduction;
[0075] S4, the filtered first-dimensional image, second-dimensional image, ... and Y-dimensional image are fused with the obtained noise-free first-dimensional image, second-dimensional image, ... and Y-dimensional image alpha, respectively;
[0076] Finally, the fused first-dimensional image, second-dimensional image, ... Y-th-dimensional image are superimposed and fused to obtain the final denoised image.
[0077] like Figure 2 The flowchart shown is a process for the method used in a specific embodiment of this application: original image input, image region marking, image dimension segmentation based on the marking, determination of noise type in different dimensions, denoising processing of different dimensions, fusion processing of each dimension with high-quality image, fusion and overlay processing of each dimension image to form an image, and finally processing and outputting the image.
[0078] like Figure 3 The flowchart shown is for the image region labeling method: image grayscale processing, binarization processing, connected component labeling, edge detection of the connected component corresponding to the original image region, determination of the degree of line disorder in the region, differentiation of individual feature regions in the image based on the degree of disorder, and labeling of each feature region.
[0079] Specifically, step S1: Image region marking:
[0080] 1) Convert the color RGB image to grayscale, as shown in formula (1), and calculate the grayscale gradient image, as shown in formulas (2)-(4). Figure 2 Value-based, as shown in formulas (5)-(6)
[0081] F(x, y)=0.299*R(x, y)+0.587*G(x, y)+0.114*B(x, y) (1)
[0082] Where F(x,y) represents the grayscale image; R(x,y) represents the R-channel image; G(x,y) represents the G-channel image; B(x,y) represents the B-channel image; (x,y) represents the pixel coordinates, x represents the x-axis, and y represents the y-axis.
[0083]
[0084]
[0085]
[0086] Among them, g x G represents the gradient in the x-direction. y M(x,y) represents the gradient in the y-direction, (x,y) represents the pixel coordinates, x represents the x-axis, y represents the y-axis, and M(x,y) represents the gradient grayscale image.
[0087]
[0088] Where I(x, y) is the gray-level gradient binary image, and T1 is the threshold, as shown in the following formula (6).
[0089]
[0090] Where m is the number of pixels in the image along the x-axis, and n is the number of pixels in the image along the y-axis;
[0091] 2) Eight-neighbor labeling method: Determine the leftmost, top-left, topmost, and top-right points within the eight neighbors of this pixel. If none of them are present, it indicates the start of a new region. If the leftmost and top-right points within the eight neighbors are present, mark this pixel as the smallest of the two and change the larger label to the smaller one. If the top-left and top-right points within the eight neighbors are present, mark this pixel as the smallest of the two and change the larger label to the smaller one. Otherwise, label this pixel as one of the four points in the order of leftmost, top-left, topmost, and top-right. Figure 4 The diagram shown is a labeled image; there are a total of 8 points in the 8-neighborhood, including the points on the diagonal, as follows. Figure 5 As shown.
[0092] 3) Use the Laplacian algorithm to detect the edges of the grayscale image of the corresponding region after marking, as shown in the following formula (7), and judge the degree of disorder of the lines in the region image. When the degree of disorder is less than the threshold, the region is judged as a flat region, and other regions are non-flat regions.
[0093]
[0094] Where F(x,y) is a grayscale image, which is the same as the one in formula (1), and x and y represent the x-axis and y-axis, respectively.
[0095] Note that the edge detection algorithm used in this invention is not limited to the Laplacian algorithm; other algorithms, such as the Tenengrad gradient algorithm, are also included.
[0096] Step S2: Image dimension segmentation,
[0097] Based on the identified regions—flat and non-flat areas—the grayscale image is divided into two dimensions: a first-dimensional image, where pixel values in flat areas remain unchanged and the remaining areas are filled with 0; and a second-dimensional image, where pixel values in non-flat areas remain unchanged and the remaining areas are filled with 0. This step results in a two-dimensional image of the grayscale image.
[0098] The image can also be divided into more than two dimensions by setting the thresholds in step two. For example, setting thresholds a and b, images less than threshold a are divided into the first dimension, images between thresholds a and b are divided into the second dimension, and images greater than threshold b are divided into the third dimension.
[0099] Step S3: Image denoising,
[0100] The core of the first dimension plot is the flat region data, and the median filtering algorithm is used to obtain noise reduction for the flat region. Figure 1 The core of the second-dimensional plot is the non-flat region data, and a bilateral filtering algorithm is used to obtain non-flat noise reduction. Figure 1 .
[0101] Note that the noise reduction algorithm used in this application is not limited to median filtering and bilateral filtering algorithms; other filtering algorithms are also acceptable.
[0102] Step S4: Image fusion,
[0103] High-quality images are obtained through simulation based on image region features, namely noise-free first-dimensional images and noise-free second-dimensional images. This method is not limited; deep learning methods can also be used to obtain these two-dimensional images. (Noise reduction in flat regions) Figure 1 Perform alpha fusion with the noise-free first-dimensional map to obtain noise reduction in the flat region. Figure 2 Noise reduction in non-flat regions Figure 1 Perform alpha fusion with the noise-free second-dimensional map to obtain noise reduction in non-flat regions. Figure 2 The alpha fusion processing algorithm is shown in Formula 8 below. Finally, noise reduction is performed on the flat region. Figure 2 Noise reduction in non-flat regions Figure 2The image is then overlaid and fused to obtain a denoised grayscale image, which is then converted into a color image for output.
[0104] D(x, y)=a*S1(x, y)+(1-a)*S2(x, y)+g (8)
[0105] Where S1(x,y) represents the denoised image, S2(x,y) represents the noise-free image, D(x,y) represents the fused image, a is the alpha fusion coefficient, the parameter of the denoised image during fusion, and g is a constant, which usually depends on the average and maximum values to be adjusted for the pixels.
[0106] In summary, the characteristics of the method in this application are as follows:
[0107] 1. Image region labeling: Convert the color image to a grayscale image to obtain a grayscale gradient image, binarize it, and use connected component labeling and Laplacian edge detection algorithms to divide the image into different feature regions and label them.
[0108] 2. Image dimensional segmentation and noise reduction: The image is divided into different dimensional images according to the labels, and different noise reduction methods are used to remove noise based on the characteristics of each dimensional image.
[0109] 3. Image fusion: High-quality images are obtained based on image region features. The high-quality images are then alpha-fused with the corresponding dimension images. Finally, the denoised images from all dimensions are superimposed and fused to obtain a denoised grayscale image, which is then converted into a color image for output.
[0110] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the embodiments of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A noise reduction method based on region labeling, characterized in that, The method includes: S1: Image region labeling: Convert the color image into a grayscale image, then obtain the grayscale gradient image, and binarize it; S2: Image Dimension Segmentation: The image is divided into different feature regions and labeled using connected component labeling and edge detection algorithms. Based on the labels, the image is divided into different dimension images. Further, this includes: using the Laplacian operator to perform edge detection on the grayscale image corresponding to each connected component region, counting the number of edges in each region, and dividing the image into at least two dimensions based on the number of edges by setting a threshold. Segmentation is achieved by setting the thresholds in step S2: If thresholds a, b, ..., m, n are set, regions less than threshold a are divided into the first region, corresponding to the first dimension, and the corresponding image is the first dimension image; regions between thresholds a and b are divided into the second region, corresponding to the second dimension, and the corresponding image is the second dimension image; ..., regions between thresholds m and n are the Xth region, corresponding to the Xth dimension, and the corresponding image is the Xth dimension image; regions greater than threshold n are divided into the Yth region, corresponding to the Yth dimension, and the corresponding image is the Yth dimension image. The more regions divided, the more accurate the image denoising processing. S3, Image Denoising: Denoising is performed using different denoising methods based on the features of each dimension of the image; further including: applying corresponding filtering algorithms to the first dimension image, the second dimension, ..., the Y-th dimension image for denoising processing respectively; S4, Image Fusion: Based on the image region features, obtain high-quality images, namely noise-free first-dimensional images, second-dimensional images, ... and Y-dimensional images. Perform alpha fusion processing on the high-quality images and the corresponding dimension images, that is, perform alpha fusion processing on the filtered first-dimensional images, second-dimensional images, ... and Y-dimensional images respectively with the obtained noise-free first-dimensional images, second-dimensional images, ... and Y-dimensional images. Finally, superimpose and fuse all dimension-fused and denoised images to obtain a denoised grayscale image, which is then converted into a color image for output.
2. The noise reduction method based on region labeling according to claim 1, characterized in that, The method is further described as follows: S1. A noisy color image is converted to grayscale. The color image is an RGB image. The gradient of the grayscale image is calculated. The gradient is set to 0 if it is less than or equal to the threshold, and 1 otherwise. The resulting binary gradient image is labeled by the eight-neighbor labeling algorithm. S4. Finally, the fused first-dimensional image, second-dimensional image, ... Y-th-dimensional image are superimposed and fused to obtain the final denoised image.
3. The noise reduction method based on region labeling according to claim 1, characterized in that, Step S1: Image region marking, further includes: 1) Convert the color RGB image to grayscale, as shown in formula (1); calculate the grayscale gradient image, as shown in formulas (2)-(4); binarize the grayscale gradient image, as shown in formulas (5)-(6): (1) Where F(x,y) represents the grayscale image; R(x,y) represents the image of the R channel; G(x,y) represents the image of the G channel; B(x,y) represents the image of the B channel; (x,y) represents the pixel coordinates, where x represents the x-axis and y represents the y-axis. (2) (3) (4) in, This represents the gradient in the x-direction. M(x,y) represents the gradient in the y-direction, (x,y) represents the pixel coordinates, x represents the x-axis, y represents the y-axis, and M(x,y) represents the gradient grayscale image. (5) in, For a grayscale gradient binary image, T1 is the threshold, and the formula is as follows (6). (6) Where m is the number of pixels in the image along the x-axis, and n is the number of pixels in the image along the y-axis; 2) Eight-neighbor labeling method: Determine the leftmost, top-left, topmost, and top-right points in the eight-neighborhood of this pixel. If none of them are present, it indicates the start of a new region. If the leftmost point and both the top and right points in the eight-neighborhood of this pixel are present, then mark this pixel as the smallest of the two and change the larger label to the smaller label. If the top-left point and both the top and right points in the eight-neighborhood of this pixel are present, then mark this pixel as the smallest of the two and change the larger label to the smaller label. Otherwise, mark this pixel as one of the four points in the order of leftmost, top-left, topmost, and top-right.
4. The noise reduction method based on region labeling according to claim 3, characterized in that, There are a total of 8 points in the eight-neighborhood, including points at the diagonal positions.
5. The noise reduction method based on region labeling according to claim 1, characterized in that, In step S2, the edge detection algorithm uses the Laplacian operator or the Tenengrad gradient algorithm to perform edge detection on the grayscale image of the region corresponding to each connected component.
6. The noise reduction method based on region labeling according to claim 1, characterized in that, In step S2, if the image is subdivided into two regions using this method, then when the edge value in the connected region is greater than the threshold in S2, it is determined to be a non-flat region, and the rest are flat regions. Based on the determined regions, i.e., flat regions and non-flat regions, the grayscale image is divided into a first-dimensional image, in which the pixel values of the flat regions remain unchanged, and the rest are filled with 0; and a second-dimensional image, in which the pixels of the non-flat regions remain unchanged, and the rest are filled with 0; thus, the grayscale image is divided into two dimensions.
7. The noise reduction method based on region labeling according to claim 6, characterized in that, Step S2: Image dimension segmentation further includes: The Laplace algorithm is used to detect the edges of the grayscale image of the corresponding region after labeling, as shown in the following formula (7), and the number of edges in each region is counted. When the edge value in the connected component is less than or equal to the threshold in S2, the region is judged as a flat region, and other regions are non-flat regions. (7) Where F(x,y) is a grayscale image, which is the same as the one in formula (1), and x and y represent the x-axis and y-axis, respectively.
8. The noise reduction method based on region labeling according to claim 7, characterized in that, Step S3, image denoising, further includes: The core of the first dimension plot is flat region data, and the median filtering algorithm is used to obtain the first flat region denoised image; the core of the second dimension plot is non-flat region data, and the bilateral filtering algorithm is used to obtain the first non-flat region denoised image.
9. The noise reduction method based on region labeling according to claim 8, characterized in that, Step S4: Image fusion, further includes: High-quality images are obtained through simulation based on image region features, namely a noise-free first-dimensional image and a noise-free second-dimensional image. The first noise-reduced image of the flat region is alpha-fused with the noise-free first-dimensional image to obtain the second noise-reduced image of the flat region. Similarly, the first noise-reduced image of the non-flat region is alpha-fused with the noise-free second-dimensional image to obtain the second noise-reduced image of the non-flat region. The alpha fusion algorithm is shown in Formula 8 below. Finally, the second noise-reduced image of the flat region and the second noise-reduced image of the non-flat region are superimposed and fused to obtain a denoised grayscale image, which is then converted into a color image for output. (8) Where S1(x,y) represents the denoised image, S2(x,y) represents the noise-free image, D(x,y) represents the fused image, a is the alpha fusion coefficient, the parameter of the denoised image during fusion, and g is a constant that depends on the average and maximum values to which the pixels are adjusted.
10. The noise reduction method based on region labeling according to claim 9, characterized in that, In step S4, the noise-free first-dimensional and second-dimensional graphs can also be obtained through deep learning methods.
Citation Information
Patent Citations
Depth map denoising method based on color image segmentation
CN102999888A
Graphic processing unit (GPU) with configurable filtering unit and operation method thereof
TW201142739A