Non-local mean denoising device and method based on FPGA

By designing cache, index calculation, weight calculation and denoising modules on the FPGA platform, the efficient image denoising of the NLM algorithm is achieved, which solves the problem of high computational complexity of the algorithm on FPGA and reduces hardware resource consumption and processing time.

CN118735807AActive Publication Date: 2024-10-01CENT CHINA OPTOELECTRONICS TECH RES INST (CHINA STATE SHIPBUILDING CORP 717TH RES INST) +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410726452.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-10-01
Estimated Expiration
2044-06-06

AI Technical Summary

Technical Problem

The NLM algorithm has high computational complexity in the image denoising process, which leads to increased consumption of hardware resources and processing time, making it difficult to implement efficiently on the FPGA platform.

Method used

A non-local mean denoising device based on FPGA is designed, including a cache module, an exponential calculation module, a weight calculation module and a denoising module. Through floating point number operations and parallel calculations, pixel templates and fixed-point number conversion are used to achieve efficient NLM. Algorithm hardware implementation.

Benefits of technology

It reduces the complexity, calculation density and delay of the NLM algorithm, meets the accuracy requirements of image denoising, and achieves efficient calculation on the FPGA platform.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735807A_ABST
    Figure CN118735807A_ABST
Patent Text Reader

Abstract

The invention relates to a non-local mean denoising device and method based on an FPGA, and the device comprises a caching module which is used for caching a target image into a multi-path first-in first-out queue according to a similar frame, a search frame and a center frame which are determined by a preset pixel template; the index calculation module is used for carrying out parallel calculation on a plurality of similarity indexes of the centermost pixel of each similar frame and the centermost pixel of the corresponding center frame through floating-point number calculation of the FPGA and the multi-path first-in first-out queue; the weight calculation module is used for calculating the sum of the plurality of similarity indexes through floating-point number conversion and calculating the weight of each pixel in each similar frame in non-local mean processing of each center frame; and the denoising module is used for performing non-local mean denoising on the target image according to the weight of each pixel in each similar frame in the non-local mean processing of each center frame. According to the method, non-local mean denoising of the FPGA is realized through conversion of pixel template setting and floating point calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing, and in particular relates to a non-local mean denoising device and method based on FPGA. Background Art

[0002] Image denoising is an essential preprocessing step in the fields of image processing and target detection. Common two-dimensional image denoising methods include median filtering, mean filtering, morphological filtering, etc. These traditional denoising methods are simple in principle and low in computational complexity, but they cannot preserve image texture and other detailed information. The non-local mean denoising (NLM) algorithm uses the redundant information commonly found in natural images for denoising, searches for similar areas in the image in units of image blocks, and then averages the similar areas, achieving relatively good results in removing noise and preserving texture details. However, the NLM algorithm has a high computational complexity and often requires more hardware resources and processing time.

[0003] FPGA is a programmable logic device, a semi-customized circuit in application-specific integrated circuits. Its basic structure includes programmable input and output units, configurable logic blocks, digital clock management modules, embedded block RAM, wiring resources, embedded dedicated hard cores, and bottom-level embedded functional units. It has the advantages of low power consumption, low cost, flexible development, and fast processing speed. FPGA can develop independent hardware circuit structures for each system, so it has the characteristics of parallel structure and pipeline processing.

[0004] The NLM algorithm has the characteristics of high computational complexity, high computational density, and large computational delay. Therefore, how to efficiently implement the NLM algorithm based on FPGA is the key to realizing the operation of the NLM algorithm on embedded platforms such as FPGA. Summary of the invention

[0005] In order to implement the NLM algorithm on the FPGA platform, in the first aspect of the present invention, a non-local mean denoising device based on FPGA is provided, comprising: a cache module, used to cache the target image into a multi-way first-in-first-out queue according to the similarity box, search box and center box determined by the preset pixel template; an index calculation module, used to parallelly calculate multiple similarity indexes of the center-most pixel of each similarity box and the center-most pixel of its corresponding center box through the floating-point operation of the FPGA and the multi-way first-in-first-out queue; a weight calculation module, used to calculate the sum of the multiple similarity indexes through floating-point conversion, and calculate the weight of each pixel in each similarity box in the non-local mean processing of each center box according to the sum of the multiple similarity indexes; a denoising module, used to perform non-local mean denoising on the target image according to the weight of each pixel in each similarity box in the non-local mean processing of each center box.

[0006] In some embodiments of the present invention, the index calculation module includes: a square sum calculation unit, which is used to calculate the square sum of the absolute values ​​of the corresponding pixel differences between each center box and its similar boxes in each first-in-first-out queue; a floating-point conversion unit, which is used to convert the square sum of the absolute values ​​into a half-precision floating-point number; a division unit, which is used to divide the square sum of the absolute values ​​after floating-point conversion by a preset standard deviation parameter; and a floating-point exponent calculation unit, which is used to calculate the similarity index between the centermost pixel of each center box and the centermost pixels of multiple corresponding similar boxes based on the calculation result of the division unit through a preset IP or piecewise function.

[0007] Furthermore, the square sum calculation unit includes: an input unit, used to match multiple similar boxes from one or more search boxes corresponding to each center box; a first calculation unit, used to calculate the variance of pixel values ​​corresponding to pixels of each center box and multiple similar boxes through a preset template.

[0008] In some embodiments of the present invention, the weight calculation module includes: a floating-point conversion unit, used to convert each similarity index from a floating-point number to a fixed-point number; a first calculation unit, used to calculate the sum of multiple similarity indices after floating-point conversion; a fixed-point conversion unit, used to convert multiple similarity indices and their sum into floating-point numbers, and normalize them according to the similarity indices and their sum after fixed-point conversion; a weight calculation unit, used to calculate the weight of each pixel in each similarity box in the non-local mean processing of each central box based on the normalized similarity indices and their sum.

[0009] Furthermore, the weight calculation unit also includes: an improving unit, which is used to improve the calculation clock frequency of the weight calculation unit.

[0010] In the above-mentioned embodiment, the denoising module includes: a fixed-point unit, which is used to fix the weight of each pixel in each search box for non-local mean processing of each central box; a multiplication and addition unit, which is used to multiply and sum a plurality of fixed-point weight values ​​with the pixel values ​​of the corresponding pixels to obtain the pixel value of each central box after non-local mean denoising.

[0011] The second aspect of the present invention provides a non-local mean denoising method based on FPGA, comprising: caching a target image in a multi-way first-in-first-out queue according to a similarity box, a search box and a center box determined by a preset pixel template; calculating in parallel multiple similarity indexes of the centermost pixel of each similarity box and the centermost pixel of its corresponding center box through floating-point number operations of the FPGA and the multi-way first-in-first-out queue; calculating the sum of the multiple similarity indexes through floating-point number conversion, and calculating the weight of each pixel in each similarity box in the non-local mean processing of each center box according to the sum of the multiple similarity indexes; performing non-local mean denoising on the target image according to the weight of each pixel in each similarity box in the non-local mean processing of each center box.

[0012] Furthermore, the parallel calculation of multiple similarity indexes between the centermost pixel of each similar frame and the centermost pixel of its corresponding center frame through the floating-point operation of the FPGA and the multi-way first-in-first-out queue includes: calculating the sum of the squares of the absolute values ​​of the corresponding pixel differences between each center frame and its similar frame in each first-in-first-out queue; converting the sum of the squares of the absolute values ​​into a half-precision floating-point number; and calculating the similarity index between the centermost pixel of each center frame and the centermost pixels of multiple corresponding similar frames through a preset IP or piecewise function based on the calculation result of the division unit.

[0013] The third aspect of the present invention provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the FPGA-based non-local mean denoising method provided in the second aspect of the present invention.

[0014] A fourth aspect of the present invention provides a computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the FPGA-based non-local mean denoising method provided in the second aspect of the present invention is implemented.

[0015] The beneficial effects of the present invention are:

[0016] The present invention relates to a non-local mean denoising device and method based on FPGA, wherein the device comprises: a cache module, which is used for caching a target image in a multi-channel first-in-first-out queue according to a similarity frame, a search frame and a center frame determined by a preset pixel template; an index calculation module, which is used for calculating multiple similarity indexes between the center-most pixel of each similarity frame and the center-most pixel of its corresponding center frame in parallel through floating-point number operations of FPGA and the multi-channel first-in-first-out queue; a weight calculation module, which is used for calculating the sum of the multiple similarity indexes through floating-point number conversion, and calculating the weight of each pixel in each similarity frame in non-local mean processing of each center frame; and a denoising module, which is used for performing non-local mean denoising on the target image according to the weight of each pixel in each similarity frame in non-local mean processing of each center frame.

[0017] It can be seen that the present invention aims at the problem of high complexity of hardware implementation of NLM algorithm, and provides a hardware implementation of NLM algorithm based on FPGA. By taking advantage of the parallel pipelined computing characteristics of FPGA device architecture, on the basis of meeting the accuracy requirements of NLM algorithm, based on pixel templates, conversion between fixed-point numbers and floating-point numbers, and under the premise of losing limited precision, a hardware full-pipeline efficient computing architecture of NLM algorithm based on FPGA is realized, thereby reducing the complexity, computing density and delay of NLM algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a structural schematic diagram of a non-local mean denoising device based on FPGA in some embodiments of the present invention;

[0019] Figure 2 It is a schematic diagram of the specific structure of a non-local mean denoising device based on FPGA in some embodiments of the present invention;

[0020] Figure 3 It is a structural schematic diagram of a cache module of a non-local means denoising device based on FPGA in some embodiments of the present invention;

[0021] Figure 4 is a schematic diagram of a pixel template in some embodiments of the present invention;

[0022] Figure 5 is a schematic diagram of the principle of an FPGA-based index calculation module in some embodiments of the present invention;

[0023] Figure 6 A schematic diagram of floating point format representation in some embodiments of the present invention;

[0024] Figure 7 A schematic diagram of floating-point division calculation IP in some embodiments of the present invention;

[0025] Figure 8A schematic diagram of a floating point exponent calculation IP in some embodiments of the present invention;

[0026] Fig. 9 It is a schematic diagram of the principle of the weight calculation module in some embodiments of the present invention and a schematic diagram of the deployment of FPGA NLM algorithm resources;

[0027] Fig.10 It is a NLM algorithm FPGA simulation diagram in some embodiments of the present invention;

[0028] Fig.11 A comparison diagram of FPGA NLM algorithm noise reduction in some embodiments of the present invention;

[0029] Fig.12 A basic flow chart of a non-local mean denoising method based on FPGA in some embodiments of the present invention;

[0030] Fig.13 It is a schematic diagram of the structure of an electronic device in some embodiments of the present invention. DETAILED DESCRIPTION

[0031] The principles and features of the present invention are described below in conjunction with the accompanying drawings. The examples given are only used to explain the present invention and are not used to limit the scope of the present invention.

[0032] refer to Figure 1 and Figure 2 In a first aspect of the present invention, a non-local mean denoising device 1 based on FPGA is provided, comprising: a cache module 11, used to cache the target image in a multi-way first-in-first-out queue according to the similarity box, search box and center box determined by a preset pixel template; an index calculation module 12, used to parallelly calculate multiple similarity indexes of the center-most pixel of each similarity box and the center-most pixel of its corresponding center box through floating-point number operations of FPGA and the multi-way first-in-first-out queue; a weight calculation module 13, used to calculate the sum of the multiple similarity indexes through floating-point number conversion, and calculate the weight of each pixel in each similarity box in the non-local mean processing of each center box according to the sum of the multiple similarity indexes; a denoising module 14, used to perform non-local mean denoising on the target image according to the weight of each pixel in each similarity box in the non-local mean processing of each center box.

[0033] It should be noted that in the present invention, the similarity index is based on the grayscale value of the pixel, or in other words, the pixel value in the present invention is the grayscale value of the pixel; the similarity box, search box and center box are for the convenience of description, and the corresponding areas are represented by rectangular boxes in the examples or drawings; without loss of generality, the above-mentioned similarity box, search box and center box can also be understood as the source area, search area and target area, which correspond to the center box, search box and similarity box, respectively.

[0034] refer to Figures 2 to 4 In some embodiments of the present invention, the cache module 11 is used to cache the target image in a multi-way first-in-first-out queue according to the similarity box, the search box and the center box determined by the preset pixel template.

[0035] Specifically, Figure 4 As shown in the figure, since the radius of the similarity box is 2, the diameter is 5, and the radius of the search box is 4, the diameter is 9. Therefore, when performing calculation comparison between the center box and the similarity box, the image cache module needs to form a 13x13 pixel template. 12 FIFOs are used for image data row cache. Each row of image data flows into the next level FIFO after being cached by the current level FIFO. After 12 levels of FIFO cache, 13 rows of image data can be output simultaneously to form a 13x13 image template for use by subsequent calculation modules. The depth of the FIFO is determined according to the column width of the image.

[0036] refer to Figures 4 to 8 In some embodiments of the present invention, the index calculation module 12 includes: a square sum calculation unit, which is used to calculate the square sum of the absolute values ​​of the corresponding pixel differences between each center box and its similar boxes in each first-in-first-out queue; a floating-point conversion unit, which is used to convert the square sum of the absolute values ​​into a half-precision floating-point number; a division unit, which is used to divide the square sum of the absolute values ​​after floating-point conversion by a preset standard deviation parameter; and a floating-point exponent calculation unit, which is used to calculate the similarity index between the centermost pixel of each center box and the centermost pixels of multiple corresponding similar boxes based on the calculation result of the division unit through a preset IP or piecewise function.

[0037] Furthermore, the square sum calculation unit includes:

[0038] The input unit is used to match multiple similar frames from one or more search frames corresponding to each central frame; the first calculation unit is used to calculate the variance of the pixel values ​​of each central frame and the pixels corresponding to the multiple similar frames through a preset template.

[0039] Specifically, it is necessary to calculate the absolute square sum of the corresponding pixels between the 5x5 center box and a 5x5 similar box. When calculating the absolute square sum of the corresponding pixel differences between the center box and the similar box, in order to save computing resources and implement pipeline computing, it is not necessary to completely cache the pixels of the two 5x5 templates before calculating. Figure 3 As shown, the corresponding 5x1 template pixels of the center box and the similar box are input column by column, and the sum of the squares of the differences between the 5x1 column data of the similar box and the 5x1 column data of the center box are calculated in sequence. Then, the sum of the squares of the 5 columns are added together to obtain the sum of the squares of the corresponding pixel differences between the 5x5 similar box and the 5x5 center box, which is recorded as d^2.

[0040] It can be understood that after obtaining d^2 between the center frame and one of its similar frames, it is necessary to use d^2 as the dividend and the input standard deviation parameter Std for division operation. Two aspects need to be considered when performing division operation: the first is to ensure the accuracy of the division operation, so the division result cannot only take the integer part, and a certain accuracy after the decimal point must be guaranteed; the second aspect is to consider the FPGA logic resources occupied by the division operation, and the higher the division accuracy, the more computing resources are consumed. After comprehensive consideration of the above two aspects, the present invention adopts half-precision floating point format for division calculation.

[0041] Therefore, the floating point conversion unit is used to convert the square sum of the absolute values ​​into a half-precision floating point number; specifically, firstly, d^2 and the standard deviation parameter Std are converted as follows: Figure 5 The format shown is used to convert fixed-point numbers to half-precision floating-point numbers. The half-precision floating-point format is 16 bits in total, with the highest bit being the sign bit, the exponent bit occupying 5 bits, and the decimal bit occupying 10 bits. Converting fixed-point numbers to half-precision floating-point numbers does not require calling IP, and can be completed using FPGA logic.

[0042] Next, a division operation is performed by the division unit; specifically, refer to Figure 7 , calling the floating-point calculation IP inside the FPGA can complete the division calculation.

[0043] It can be understood that according to the calculation process of the NLM algorithm, after the division calculation is completed, it is necessary to take the negation of the result of the division operation and perform logarithmic calculation on the negation. Currently, most FPGAs have integrated floating-point format index calculation IP (circuit).

[0044] Therefore, the floating point index calculation unit is used to calculate the similarity index between the center pixel of each center frame and the center pixels of the corresponding multiple similar frames through a preset IP or piecewise function based on the calculation result of the division unit. Figure 8 As shown, the exponential calculation IP can be directly called to perform exponential calculation. If the exponential calculation IP is not integrated inside the FPGA, the exponential calculation can be implemented by generating a lookup table based on the value range or by piecewise function fitting. The floating-point exponential calculation module adopts pipeline operation as a whole. For a 9x9 search area, excluding the center box itself, a total of 80 exponential calculation modules are required. The number of instantiations required for the exponential calculation module varies according to the search box definition.

[0045] refer to Fig. 9 In some embodiments of the present invention, the weight calculation module 13 includes:

[0046] a floating point conversion unit, used to convert each similarity index from a floating point number to a fixed point number; a first calculation unit, used to calculate the sum of the plurality of similarity indexes after floating point conversion;

[0047] Specifically, according to the 9x9 search area, each pixel can obtain 80 index results through the index calculation module. Since the d^2 value of the center box and itself is 1, its index value is 1. The 80 index results are summed with 1 in the weight calculation module to obtain the index sum.

[0048] A fixed-point conversion unit, used for converting a plurality of similarity indices and their sum into floating-point numbers, and performing normalization according to the similarity indices and their sum after fixed-point conversion;

[0049] Specifically, if the floating-point format is used for summation, the floating-point exponent needs to be aligned and shifted, and rounding errors will also occur. Therefore, this solution converts the floating-point exponent into a fixed-point number for summation. For 16-bit half-precision floating-point numbers, 25-bit fixed-point numbers are used to represent them, ensuring that there is no conversion error when converting floating-point numbers to fixed-point numbers. Specifically, a pipeline operation is used to add 80 fixed-point exponents to 1 to obtain the exponent sum.

[0050] The weight calculation unit is used to calculate the weight of each pixel in each similar frame in the non-local mean processing of each central frame according to the normalized similarity index and its sum. Each index calculated by the index calculation module 11 represents the similarity between the most central pixel of the similar frame and the most central pixel of the central frame. Therefore, after obtaining the index sum, it is necessary to further calculate the division of each index and the index sum for normalization. The division calculation is also performed in the format of half-precision floating point numbers, and the fixed-point index sum is converted to floating point numbers.

[0051] Furthermore, the weight calculation unit also includes: an improving unit, which is used to improve the calculation clock frequency of the weight calculation unit.

[0052] Specifically, 81 floating-point exponents are divided by the floating-point exponent sum, and the result is recorded as the weight parameter w, which represents the composite ratio of each pixel in the search box to the pixels after the final NLM processing. In order to save FPGA computing resources, this module increases the computing clock by 1.5 times. Originally, 81 division computing IPs were required, but only 54 division IPs are required in the 1.5 times clock domain.

[0053] In the above-mentioned embodiment, the denoising module 14 includes: a fixed-point unit, which is used to fix the weight of each pixel in each search box for non-local mean processing of each central box; a multiplication and addition unit, which is used to multiply and sum a plurality of fixed-point weight values ​​with the pixel values ​​of the corresponding pixels to obtain the pixel value of each central box after non-local mean denoising.

[0054] Specifically, after the weight calculation module obtains the weight value of each pixel in the search box, the floating-point weight value is fixed-point, and then the 81 fixed-point weight values ​​are multiplied and summed with the 81 corresponding pixels in the search box. Finally, the NLM calculated pixel value can be obtained. The multiplication and summation still use the pipeline calculation method.

[0055] Fig. 9 The resource usage table after deploying the NLM computing architecture of this solution based on Xlinx K7-325T FPGA shows that the logic resource LUT uses 33%, the register resource FF uses 22%, the block storage resource uses only 11%, and the DSP uses 60%, which is mainly used in the exponential calculation module.

[0056] Fig.11 The figure shows the FPGA simulation diagram of the NLM algorithm based on the present application, as well as the comparison diagram before and after PGA NLM noise reduction.

[0057] Example 2

[0058] refer to Fig.12 In a second aspect of the present invention, a non-local mean denoising method based on FPGA is provided, comprising: S100. caching a target image in a multi-way first-in-first-out queue according to a similarity box, a search box and a center box determined by a preset pixel template; S200. calculating in parallel a plurality of similarity indexes between the center-most pixel of each similarity box and the center-most pixel of its corresponding center box through floating-point number operations of FPGA and the multi-way first-in-first-out queue; S300. calculating the sum of the plurality of similarity indexes through floating-point number conversion, and calculating the weight of each pixel in each similarity box in the non-local mean processing of each center box according to the sum of the plurality of similarity indexes; S400. performing non-local mean denoising on the target image according to the weight of each pixel in each similarity box in the non-local mean processing of each center box.

[0059] Further, in step S200, the parallel calculation of multiple similarity indexes between the center pixel of each similar frame and the center pixel of its corresponding center frame by using floating point operations of FPGA and the multi-way first-in-first-out queue includes:

[0060] S201. Calculate the sum of the squares of the absolute values ​​of the corresponding pixel differences between each center box and its similar box in each FIFO queue;

[0061] S202. Converting the sum of squares of the absolute values ​​into a half-precision floating point number;

[0062] S203. Based on the calculation result of the division unit, calculate the similarity index between the centermost pixel of each center frame and the centermost pixels of the corresponding multiple similar frames through a preset IP or piecewise function.

[0063] Example 3

[0064] refer to Fig.13 According to a third aspect of the present invention, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to the second aspect of the present invention.

[0065] The electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0066] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.13 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Fig.13 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0067] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above functions defined in the method of the embodiment of the present disclosure are executed. It should be noted that the computer-readable medium described in the embodiment of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In an embodiment of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the foregoing.

[0068] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device. The computer-readable medium carries one or more computer programs. When the one or more programs are executed by the electronic device, the electronic device:

[0069] Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, Python, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0070] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0071] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A non-local mean denoising device based on FPGA, characterized in that: include: A cache module, for caching the target image into a multi-way first-in-first-out queue according to the similarity box, the search box and the center box determined by the preset pixel template; An index calculation module, used for calculating in parallel a plurality of similarity indexes between the centermost pixel of each similarity frame and the centermost pixel of its corresponding center frame through floating point operations of FPGA and the multi-way first-in-first-out queue; A weight calculation module, used to calculate the sum of the multiple similarity indexes through floating point conversion, and calculate the weight of each pixel in each similarity frame in the non-local mean processing of each central frame according to the sum of the multiple similarity indexes; The denoising module is used to perform non-local mean denoising on the target image according to the weight of each pixel in each similar box in the non-local mean processing of each central box.

2. The FPGA-based non-local means denoising device according to claim 1, characterized in that: The index calculation module includes: A square sum calculation unit, used for calculating the square sum of the absolute values ​​of the corresponding pixel differences between each central frame and its similar frame in each FIFO queue; A floating point conversion unit, used for converting the sum of squares of the absolute values ​​into a half-precision floating point number; A division unit, used for dividing the sum of squares of the absolute values ​​after floating point conversion by a preset standard deviation parameter; The floating-point index calculation unit is used to calculate the similarity index between the center pixel of each center frame and the center pixels of the corresponding multiple similar frames based on the calculation result of the division unit through a preset IP or piecewise function.

3. The FPGA-based non-local means denoising device according to claim 2, characterized in that: The square sum calculation unit comprises: An input unit, for matching a plurality of similar boxes from one or more search boxes corresponding to each center box; The first calculation unit is used to calculate the variance of the pixel values ​​of each central frame and the pixels corresponding to the multiple similar frames by using a preset template.

4. The FPGA-based non-local means denoising device according to claim 1, characterized in that: The weight calculation module includes: a floating point conversion unit for converting each similar exponent from a floating point number to a fixed point number; A first calculation unit, used for calculating the sum of multiple similarity indexes after floating point conversion; A fixed-point conversion unit, used for converting a plurality of similarity indices and their sum into floating-point numbers, and performing normalization according to the similarity indices and their sum after fixed-point conversion; The weight calculation unit is used to calculate the weight of each pixel in each similarity frame in the non-local mean processing of each central frame according to the normalized similarity index and its sum.

5. The FPGA-based non-local means denoising device according to claim 4, characterized in that: The weight calculation unit also includes: The boost unit is used to boost the calculation clock frequency of the weight calculation unit.

6. The FPGA-based non-local means denoising device according to claim 1, characterized in that: The denoising module comprises: A fixed-point unit, used for fixing the weight of each pixel in each search box for the non-local mean processing of each central box; The multiplication and addition unit is used to multiply and sum the multiple fixed-point weight values ​​with the pixel values ​​of the corresponding pixels to obtain the pixel value of each center frame after non-local mean denoising.

7. A non-local mean denoising method based on FPGA, characterized in that: include: Cache the target image into a multi-way first-in-first-out queue according to the similarity box, search box and center box determined by the preset pixel template; By using the floating point operation of the FPGA and the multi-way first-in first-out queue, multiple similarity indexes between the center pixel of each similarity frame and the center pixel of its corresponding center frame are calculated in parallel; Calculating the sum of the multiple similarity indexes by floating point conversion, and calculating the weight of each pixel in each similarity frame in the non-local mean processing of each central frame according to the sum of the multiple similarity indexes; According to the weight of each pixel in each similar box in the non-local mean processing of each central box, the target image is denoised by non-local mean.

8. The FPGA-based non-local means denoising method according to claim 7, characterized in that: The method of calculating multiple similarity indexes between the center pixel of each similar frame and the center pixel of the corresponding center frame in parallel by using the floating point operation of the FPGA and the multi-way first-in-first-out queue includes: Calculate the sum of the squares of the absolute values ​​of the corresponding pixel differences between each center box and its similar box in each FIFO queue; Convert the sum of squares of the absolute values ​​into a half-precision floating point number; Based on the calculation result of the division unit, the similarity index between the most central pixel of each central frame and the most central pixels of the corresponding multiple similar frames is calculated by using a preset IP or piecewise function.

9. An electronic device, comprising: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the FPGA-based non-local mean denoising method as described in any one of claims 1 to 6.

10. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the FPGA-based non-local mean denoising method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Image data noise reduction system and method based on FPGA

    CN113033574A

  • Infrared image nlmeans noise reduction simplification method and system based on fpga, medium and equipment

    CN117541496A

  • DEVICE AND METHOD FOR PERFORMING NON-LOCAL AVERAGE FILTRATION USING A MOTION ESTIMATING CIRCUIT OF A GRAPHICS PROCESSOR

    DE102020131901A1

  • Non-local means image denoising with detail preservation using self-similarity driven blending

    US20160086317A1