A method and device for smoothing digital images
By dynamically assigning central pixels, the problem that traditional image smoothing methods fail to consider the spatial distribution characteristics of data is solved, achieving a more natural smoothing effect and a higher signal-to-noise ratio.
Patent Information
- Application Number
- CN202111158585.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2041-09-30
AI Technical Summary
The traditional digital image smoothing method fails to fully consider the distribution characteristics of the data in the space during processing, resulting in blurred images and severe distortion after processing.
A digital image smoothing method is proposed. By traversing all pixel points in the image, determining the central pixel and selecting the k-order neighborhood with it as the center, calculating the weight and influence factor of each pixel, dynamically assigning the central pixel to maintain the natural distribution characteristics of the data.
It effectively reduces the distortion of the data after image smoothing, makes the smoothing result closer to natural data, and improves the signal-to-noise ratio of the image, especially when the noise is small, it shows obvious advantages.
Smart Images

Figure CN113947540B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to a method and device for digital image smoothing. Background Art
[0002] With the continuous development of science and technology, information technology is showing its indispensable and important position in various industries and fields. As one of the carriers of information, images have always been a hot topic of research along with the development of computer technology. Image preprocessing has always been an important part of image processing. Image smoothing can effectively reduce the noise in the image and improve the signal-to-noise ratio of the image, making the image more convenient for data calculation in the later stage. Traditional digital image smoothing methods mainly use mean filtering, median filtering, Gaussian filtering, and filtering schemes based on mathematical tools such as matrix transformation and function transformation developed in recent years. The above schemes do not fully consider the distribution of the data itself in space during the design process. In this case, the image will blur the distribution characteristics of the data in space after processing. Summary of the invention
[0003] In order to solve the problem that traditional schemes cannot express the distribution characteristics of data in space and process data using fixed methods or weights, the present invention proposes a method and device for digital image smoothing, which considers the distribution of source data in space in data preprocessing and processes data using dynamic weights.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] In one aspect, the present invention provides a method for digital image smoothing, comprising:
[0006] Step 1: Traverse all pixels of the digital image;
[0007] Step 2: Determine the central pixel, select a k-order neighborhood with the central pixel as the center, establish a mathematical model for the neighborhood pixels to calculate, and assign the calculation results to the central pixel;
[0008] Step 3: Repeat steps 1 and 2 until all pixels in the digital image are assigned values.
[0009] Furthermore, the step 2 comprises:
[0010] Step 2.1: Determine the central pixel A(x,y);
[0011] Step 2.2: Select a k-order neighborhood with A(x,y) as the center;
[0012] Step 2.3: Calculate the weight W of each pixel in the neighborhood:
[0013]
[0014] Where W( i,j ) represents the weight of the pixel point A(i,j) in the neighborhood, Pixel (i,j) A(i,j) is the pixel value corresponding to the pixel point;
[0015] Step 2.4: Calculate the influence factor P( i,j ):
[0016]
[0017] Step 2.5: Sum the influence factors of each pixel in the neighborhood;
[0018] Step 2.6: Assign the summation result to the center pixel, and finally get the pixel value of A(x,y):
[0019]
[0020] Another aspect of the present invention provides a digital image smoothing device, comprising:
[0021] A traversal module is used to traverse all pixels of a digital image;
[0022] The modeling and assignment module is used to determine the central pixel, select the k-order neighborhood with the central pixel as the center, establish a mathematical model for the neighborhood pixels to perform calculations, and assign the calculation results to the central pixel;
[0023] The loop module is used to repeatedly traverse the module and the modeling and assignment module until all the pixels in the digital image are assigned values.
[0024] Furthermore, the modeling assignment module includes:
[0025] A central pixel determination module, used to determine the central pixel A(x,y);
[0026] A neighborhood selection module is used to select a k-order neighborhood centered at A(x,y);
[0027] The neighborhood pixel weight calculation module is used to calculate the weight W of each pixel in the neighborhood:
[0028]
[0029] Where W( i,j ) represents the weight of the pixel point A(i,j) in the neighborhood, Pixel (i,j) A(i,j) is the pixel value corresponding to the pixel point;
[0030] The neighborhood pixel influence factor calculation module is used to calculate the influence factor P( i,j ):
[0031]
[0032] An influence factor summing module is used to sum the influence factors of each pixel in the neighborhood;
[0033] The assignment module is used to assign the summation result to the central pixel, and finally the pixel value of A(x,y) can be obtained:
[0034]
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] The present invention uses the data itself to determine its own weight, abandoning the concept of fixed weights in previous algorithms. Through this method, the smoothing result is closer to natural data, effectively reducing the distortion of data after smoothing. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A basic flow chart of a method for digital image smoothing according to an embodiment of the present invention;
[0038] Figure 2 This is an example diagram of a first-order neighborhood of a method for digital image smoothing according to an embodiment of the present invention;
[0039] Figure 3 The signal-to-noise ratio curves of the results of different image smoothing methods versus noise change;
[0040] Figure 4 The figure is a schematic diagram of the structure of a digital image smoothing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:
[0042] like Figure 1 As shown, a method for digital image smoothing comprises:
[0043] Step 1: Traverse all pixels of the digital image;
[0044] Step 2: Determine the central pixel, select a k-order neighborhood with the central pixel as the center, establish a mathematical model for the neighborhood pixels to calculate, and assign the calculation results to the central pixel;
[0045] Step 3: Repeat steps 1 and 2 until all pixels in the digital image are assigned values.
[0046] Furthermore, the step 2 comprises:
[0047] Step 2.1: Determine the central pixel A(x,y);
[0048] Step 2.2: Select a k-order neighborhood with A(x,y) as the center;
[0049] Step 2.3: Calculate the weight W of each pixel in the neighborhood:
[0050]
[0051] Where W( i,j ) represents the weight of the pixel point A(i,j) in the neighborhood, Pixel (i,j) is the pixel value corresponding to the pixel point A(i,j); this expression represents Pixel (i,j) The proportion of all pixel values;
[0052] Step 2.4: Calculate the influence factor P( i,j ):
[0053]
[0054] Step 2.5: Sum the influence factors of each pixel in the neighborhood;
[0055] Step 2.6: Assign the summation result to the center pixel, and finally get the pixel value of A(x,y):
[0056]
[0057] As a specific implementable method, taking the first-order neighborhood as an example, the specific steps are:
[0058] ① Traverse the pixels of the digital image from left to right and from top to bottom.
[0059] ②Record the current pixel (x, y) as the center pixel and the eight pixels in its neighborhood (such as Figure 2 Calculations are performed according to the method of the present invention, and the final result is summed up and assigned to the center pixel.
[0060] ③ Calculate and assign values to the entire digital image area in a similar manner as in steps ① and ②.
[0061] It is worth noting that for the pixel values of a color image, the corresponding components can be calculated separately. For example, for an RGB image, when the R component R(Pixel(x,y)) is calculated separately, the calculation result is as follows
[0062]
[0063] In order to verify the effect of the present invention, two sets of image data are analyzed to evaluate the processing results:
[0064] 1: Add white noise to the two images respectively, with the noise factor of 1-100, so that 100 new images containing different noises are obtained for each image.
[0065] 2: These noisy images are respectively smoothed using mean filtering, median filtering and the method of the present invention to obtain the processed result images.
[0066] 3: Calculate the signal-to-noise ratio of the image with different filtering and smoothing results, and visualize the processing results as shown below: Figure 3 shown.
[0067] It is not difficult to conclude from the calculation and visualization results that when the image contains less than a certain value of noise, the processing result of the method of the present invention is better than the median filter and the mean filter. Even when there is more noise, it is still better than the processing result of the mean filter. Therefore, the method of the present invention can have a more obvious advantage in actual project requirements, especially when the image contains less noise.
[0068] Based on the above embodiments, Figure 4 As shown, another aspect of the present invention provides a digital image smoothing device, comprising:
[0069] A traversal module is used to traverse all pixels of a digital image;
[0070] The modeling and assignment module is used to determine the central pixel, select the k-order neighborhood with the central pixel as the center, establish a mathematical model for the neighborhood pixels to perform calculations, and assign the calculation results to the central pixel;
[0071] The loop module is used to repeatedly traverse the module and the modeling and assignment module until all the pixels in the digital image are assigned values.
[0072] Furthermore, the modeling assignment module includes:
[0073] A central pixel determination module, used to determine the central pixel A(x,y);
[0074] A neighborhood selection module is used to select a k-order neighborhood centered at A(x,y);
[0075] The neighborhood pixel weight calculation module is used to calculate the weight W of each pixel in the neighborhood:
[0076]
[0077] Where W( i,j ) represents the weight of the pixel point A(i,j) in the neighborhood, Pixel (i,j) A(i,j) is the pixel value corresponding to the pixel point;
[0078] The neighborhood pixel influence factor calculation module is used to calculate the influence factor P( i,j ):
[0079]
[0080] An influence factor summing module is used to sum the influence factors of each pixel in the neighborhood;
[0081] The assignment module is used to assign the summation result to the central pixel, and finally the pixel value of A(x,y) can be obtained:
[0082]
[0083] In summary, the present invention uses the data itself to determine its own weight, abandoning the concept of fixed weights in previous algorithms. Through this method, the smoothing result is closer to natural data, effectively reducing the distortion of data after smoothing.
[0084] The above is only a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A method for digital image smoothing, characterized in that: include: Step 1: Traverse all pixels of the digital image; Step 2: Determine the central pixel, select a k-order neighborhood with the central pixel as the center, establish a mathematical model for the neighborhood pixels to calculate, and assign the calculation results to the central pixel; The step 2 comprises: Step 2.1: Determine the central pixel A(x,y); Step 2.2: Select a k-order neighborhood with A(x,y) as the center; Step 2.3: Calculate the weight W of each pixel in the neighborhood: Where W( i,j ) represents the weight of the pixel point A(i,j) in the neighborhood, Pixel (i,j) A(i,j) is the pixel value corresponding to the pixel point; Step 2.4: Calculate the influence factor P( i,j ): Step 2.5: Sum the influence factors of each pixel in the neighborhood; Step 2.6: Assign the summation result to the center pixel, and finally get the pixel value of A(x,y): Step 3: Repeat steps 1 and 2 until all pixels in the digital image are assigned values.
2. A digital image smoothing device, characterized in that: include: A traversal module is used to traverse all pixels of a digital image; The modeling and assignment module is used to determine the central pixel, select the k-order neighborhood with the central pixel as the center, establish a mathematical model for the neighborhood pixels to perform calculations, and assign the calculation results to the central pixel; The modeling assignment module includes: A central pixel determination module, used to determine the central pixel A(x,y); A neighborhood selection module is used to select a k-order neighborhood centered at A(x,y); The neighborhood pixel weight calculation module is used to calculate the weight W of each pixel in the neighborhood: Where W( i,j ) represents the weight of the pixel point A(i,j) in the neighborhood, Pixel (i,j) A(i,j) is the pixel value corresponding to the pixel point; The neighborhood pixel influence factor calculation module is used to calculate the influence factor P( i,j ): An influence factor summing module is used to sum the influence factors of each pixel in the neighborhood; The assignment module is used to assign the summation result to the central pixel, and finally the pixel value of A(x,y) can be obtained: The loop module is used to repeatedly traverse the module and the modeling and assignment module until all the pixels in the digital image are assigned values.
Citation Information
Patent Citations
Space-time united image sequence multi-scale geometric transformation denoising method
CN103093428A
Fuzzy clustering image segmentation method based on local information and non-local information of pixels
CN107316060A