Noise reduction method based on FPGA
The FPGA-based image denoising method addresses detail loss and discontinuity issues by using convolution and gradient analysis, effectively preserving image details and edge continuity, resulting in improved denoising outcomes.
Patent Information
- Application Number
- CN202411802207.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing image denoising processes often result in detail loss and discontinuity issues in images.
A method utilizing FPGA, involving image conversion, 5×5 Gaussian Laplacian operator convolution, gradient analysis, and edge denoising models, with training data and backup image comparison to generate a denoised image through a combination model, effectively addressing detail preservation and edge continuity.
The method enhances image denoising by maintaining more image details and improving edge continuity, resulting in a better denoised image.
Smart Images

Figure CN119624821A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of noise reduction, and in particular to a noise reduction method based on FPGA. Background Art
[0002] Image noise reduction is a technique used to improve digital images by reducing noise in the image.
[0003] In the existing image denoising process, it is inevitable that details in the image will be lost and the image will be poorly continuous. Summary of the invention
[0004] The purpose of the present invention is to provide a denoising method based on FPGA to solve the problem that details in the image are inevitably lost and the image continuity is poor in the existing image denoising process proposed in the above background technology. To achieve the above purpose, the present invention provides the following technical solution: a denoising method based on FPGA, comprising the following steps: S1: Convert the image into two mif files recognizable by FPGA as the operation image and backup image, and store them through the storage module; S2: Perform 5×5 Gaussian Laplacian convolution on the operation image and threshold it; S3: Calculate the maximum first-order partial derivatives in four directions at the center point of the 7×7 array using templates of the Sobel operator in four directions: 0°, 45°, 90°, and 135°; S4: For suspicious zero crossing points, when their direction is consistent with the normal direction of the gradient at the center point, this point is considered to be a true zero crossing point, otherwise it is a false zero crossing point, and the expansion and corrosion operations in the gradient direction are performed respectively through the basic bodies in the four directions of 0°, 45°, 90° and 135°. For non-zero crossing points, the opening operation of corrosion and expansion is performed to denoise the image and obtain the image edge denoising model; S5: The training image data is input into the image segmentation model, and the image segmentation model and the image edge denoising model process the data in sequence; S6: The image obtained by S5 is compared with the backup image, and repeated highly consistent pixels are extracted through the image stitching model to generate a denoised image.
[0005] The thresholding is a preset positive and negative threshold, and a three-bit sign bit register is allocated in the FPGA. When the convolution value is greater than the positive threshold, the sign bit is "001", when it is less than the negative threshold, the sign bit is "010", and in other cases the sign bit is "100". According to the signs of the LOG convolution values at the center point and the adjacent points, the suspicious zero crossing points are found from the two cases of "001" and "010", among which the case of "100" is a non-zero crossing point.
[0006] The training image data adds noise to low-noise image data, including: Generate a two-dimensional random number matrix of the same size as the low-noise image data. For each pixel in the low-noise image data, obtain a random number from the corresponding same position in the two-dimensional random number matrix and set the noise density. Set the pixel value of the pixel in the low-noise image data according to the following formula:
[0007] x is the position of the pixel, I(x) is the pixel value after the pixel is set, P(x) is the pixel value before the pixel is set, Ns(x) is the pixel value corresponding to white, NP(x) is the pixel value corresponding to black, rand is the random number corresponding to the x position in the two-dimensional random number matrix, and p is the noise density.
[0008] The convolution operation is as follows: image data is cached in 7 lines through a shift register, and the 7 lines of data are stored in a 7×7 register array with the cycle, and the shift operator in the Verilog language is used to achieve a power-of-2 effect, and then the 25 registers covered by the template are added to obtain the convolution value.
[0009] Compared with the prior art, the present invention has the following beneficial effects: In the present invention, the image obtained by fitting the image stitching model into the image edge denoising model and the backup image are extracted to obtain a denoised image, thereby improving the image denoising effect, making the image edge continuity better and retaining more details. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 It is a flowchart of the present invention. DETAILED DESCRIPTION
[0011] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technical personnel in this field without creative work are within the scope of protection of the present invention.
[0012] See also Figure 1 The present invention provides a technical solution: a noise reduction method based on FPGA, comprising the following steps: S1: Convert the image into two mif files recognizable by FPGA as the operation image and backup image, and store them through the storage module; S2: Perform 5×5 Gaussian Laplacian convolution on the operation image and threshold it; S3: Calculate the maximum first-order partial derivatives in four directions at the center point of the 7×7 array using templates of the Sobel operator in four directions: 0°, 45°, 90°, and 135°; S4: For suspicious zero crossing points, when their direction is consistent with the normal direction of the gradient at the center point, this point is considered to be a true zero crossing point, otherwise it is a false zero crossing point, and the expansion and corrosion operations in the gradient direction are performed respectively through the basic bodies in the four directions of 0°, 45°, 90° and 135°. For non-zero crossing points, the opening operation of corrosion and expansion is performed to denoise the image and obtain the image edge denoising model; S5: The training image data is input into the image segmentation model, and the image segmentation model and the image edge denoising model process the data in sequence; S6: The image obtained by S5 is compared with the backup image, and repeated highly consistent pixels are extracted through the image stitching model to generate a denoised image.
[0013] The threshold is set to preset positive and negative thresholds, and a three-bit sign bit register is allocated in the FPGA. When the convolution value is greater than the positive threshold, the sign bit is "001", when it is less than the negative threshold, the sign bit is "010", and in other cases the sign bit is "100". According to the signs of the LOG convolution values at the center point and the adjacent points, the suspicious zero crossing points are found from the two cases of "001" and "010", among which the case of "100" is a non-zero crossing point.
[0014] The training image data adds noise to the low-noise image data, including: Generate a two-dimensional random number matrix of the same size as the low-noise image data. For each pixel in the low-noise image data, obtain a random number from the corresponding same position in the two-dimensional random number matrix and set the noise density. Set the pixel value of the pixel in the low-noise image data according to the following formula:
[0015] x is the position of the pixel, I(x) is the pixel value after the pixel is set, P(x) is the pixel value before the pixel is set, Ns(x) is the pixel value corresponding to white, NP(x) is the pixel value corresponding to black, rand is the random number corresponding to the x position in the two-dimensional random number matrix, and p is the noise density.
[0016] The convolution operation is as follows: the image data is cached in 7 lines through the shift register, and the 7 lines of data are stored in the 7×7 register array with the cycle. The shift operator in the Verilog language is used to achieve the effect of multiplication by a power of 2, and then the 25 registers covered by the template are added to obtain the convolution value.
[0017] The above shows and describes the basic principles, main features and advantages of the present invention. Technical personnel in this industry should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not used to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A noise reduction method based on FPGA, characterized in that: The steps include: S1: Convert the image into two mif files recognizable by FPGA as the operation image and backup image, and store them through the storage module; S2: Perform 5×5 Gaussian Laplacian convolution on the operation image and threshold it; S3: Calculate the maximum first-order partial derivatives in four directions at the center point of the 7×7 array using templates of the Sobel operator in four directions: 0°, 45°, 90°, and 135°. S4: For suspicious zero crossing points, when their direction is consistent with the normal direction of the gradient at the center point, this point is considered to be a true zero crossing point, otherwise it is a false zero crossing point, and the expansion and corrosion operations in the gradient direction are performed respectively through the basic bodies in the four directions of 0°, 45°, 90° and 135°. For non-zero crossing points, the opening operation of corrosion and expansion is performed to denoise the image and obtain the image edge denoising model; S5: The training image data is input into the image segmentation model, and the image segmentation model and the image edge denoising model process the data in sequence; S6: The image obtained by S5 is compared with the backup image, and repeated highly consistent pixels are extracted through the image stitching model to generate a denoised image.
2. The FPGA-based noise reduction method according to claim 1, characterized in that: The thresholding is a preset positive and negative threshold, and a three-bit sign bit register is allocated in the FPGA. When the convolution value is greater than the positive threshold, the sign bit is "001", when it is less than the negative threshold, the sign bit is "010", and in other cases the sign bit is "100". According to the signs of the LOG convolution values at the center point and the adjacent points, the suspicious zero crossing points are found from the two cases of "001" and "010", among which the case of "100" is a non-zero crossing point.
3. The FPGA-based noise reduction method according to claim 1, characterized in that: The training image data is low-noise image data with noise added, including: Generate a two-dimensional random number matrix of the same size as the low-noise image data. For each pixel in the low-noise image data, obtain a random number from the corresponding same position in the two-dimensional random number matrix and set the noise density. Set the pixel value of the pixel in the low-noise image data according to the following formula: x is the position of the pixel, I(x) is the pixel value after the pixel is set, P(x) is the pixel value before the pixel is set, Ns(x) is the pixel value corresponding to white, NP(x) is the pixel value corresponding to black, rand is the random number corresponding to the x position in the two-dimensional random number matrix, and p is the noise density.
4. The FPGA-based noise reduction method according to claim 1, characterized in that: The convolution operation is as follows: image data is cached in 7 lines through a shift register, and the 7 lines of data are stored in a 7×7 register array with the cycle, and the shift operator in the Verilog language is used to achieve a power-of-2 effect, and then the 25 registers covered by the template are added to obtain the convolution value.