下载  >  开发技术  >  其它  > 图像去噪算法IP之NLM(非局部均值)详解.pdf

图像去噪算法IP之NLM(非局部均值)详解.pdf 评分:

NLM(非局部均值)是一种降噪算法,其中每个像素的值由该像素周围的像素矩形(一个“中心补丁”)确定,所有像素大小相同的矩形(“搜索补丁”)都位于像素周围的一个相对较大的矩形(“搜索窗口”)中。 然后根据对应的搜索patch到中心patch的距离,对每个“搜索patch”的中心像素进行加权,通过计算搜索窗口中所有像素的加权平均得到输出像素
回碳现 回 The weight of each patch is then calculated as a function of its distance from the center pixel, according to the equation SSD (Sum of Square Differences) d sSD ,9=e h SAD Sum of Absolute Differences, SAD h is a parameter which is generally proportional to the expected noise of the image For more information about the nlm algorithm the reader is referred to: 1.https://dx.doi.org/10.1109%2fcvpr.2005.38 2.http://123seminarsonly.com/seminar-rEports/029/42184313-10-1-1-100-81.pdf 3.http://www.ipol.im/pub/art/2011/bcmnlm NLM implementations may vary in the following aspects See above)-Distance calculation may be done by summing the squares or absolute values The distance of the center patch is, by defin ition, 0. Heuristically, however, choosing 0 often disrupts noise reduction. therefore, implementations often prefer to use a lower value for the weight of the center patch Calculation done for pixels at the edges and near the edges of the image, where there is no complete search window Accuracy of the calculations-from the input pixels, through the various stages and up to and including the output pixels page 3 of 8 WWAGO Contact method WWAGO sales@wwago-inc.commoreinfowww.wwago-inc.com Copyright e WWAGO, all righsresarved this Core is frcm WwAGo iP technology pa tner team Contents subject to charge without notice trademarks are the property of their 回 The NLMo1 Block Diagram RAI ima=a - wrid- columm multipliers adders de calclate distance pipelined divider out weight weight The figure above depicts a simplified block diagram of the v-NLMol IP Incoming pixels are handled by a ram-interface unit, which stores previous rows in an off-IP RAM, and outputs a column of N-1 pixels(n is the height of the search window Next, the column of pixels enter the calculate Distance unit. a Column Shift register stores the values of the previous n columns and, at all times the values of all pixels in the search window. In parallel, a group of column summers concurrently sums the absolute differences for all the patches in the search window Distances out of the Calculate Distances unit are input to a Weight tables unit, which calculates weight estimates using a piece-wise linear approximation of the exponent function Both the search window pixel values and the correspond ing weights are input to a Column Multipliers unit, which multiplies the values of the pixels by the corresponding weights. The products are then added by the adders unit, which produces a sum-of products value for each input pixel. At the same time, the weights of all pixels of the search window are summed in a Weight Adders unit. the sum of products and the sum of weights enter a Pipeline Divider unit, which produces the output pixel by division and rounding to the nearest PAGE 4 of 8 WWAGO Contact method WWAGO sales@wwago-inc.commoreinfowww.wwago-inc.com Copyright e WWAGO, all righsresarved this Core is frcm WwAGo iP technology pa tner team Contents subject to charge without notice trademarks are the property of their 回碳现 回 IP Pads The following table depicts the inputs and outputs of the rtl model Pads like power, boundary scan and similar are not included and should be added by the customer as part of the back-end design All signals except rst n are synchronous to the clock input Pad |deScription Clock, Reset CloC input Single clock input. Frequency should be at least twice the pixel rate rst n input Asynchronous active-low reset input Modes. parameters bypass mode Input Used for debug. When this active- high input is asserted the v-NLM01 will assign zero weights to all pixels in the search window except the center pixel ,so that the output pixe l stream will be identical to the input pixel stream one_over_h[11: 0] Input This input should be driven with the value of 5232/h where h is as defined in the nlm algorithm (see above Video Input pixel_in [NUM_BITS- Input Pixel input stream 1:0] pixel in valid Input Signal indicating valid pixel input. There must be a gap of at least one clock cycle between every two clocks with pixel in valid=1 line start in Input Single clock period pulse, indicating the beginning of an input video line line end in Input Single clock period pulse, indicating the end of an input video line frame start in Input Single clock period pulse, indicating the beginning of an input video frame frame end in Input Single clock period pulse, indicating the end of an input video frame Video output pixel out Output De-noised pixel output stream NUM BITS-1: 0 pixel out valid Output Signal indicating valid pixel output. There will be a gap of at least one clock cycles between every two clocks with pixel out valid=1 page 5 of 8 WWAGO Contact method WWAGO sales@wwago-inc.commoreinfowww.wwago-inc.com Copyright e WWAGO, all righsresarved this Core is frcm WwAGo iP technology pa tner team Contents subject to charge without notice trademarks are the property of their 回 Pad Description line start out Output Single clock period pulse, indicating the beginning of an output video line line end out Output Single clock period pulse, indicating the end of an output video line frame start out Output Single clock period pulse, indicating the beginning of an output video frame frame end out Output Single clock period pulse, indicating the end of an output video frame RAM interface(*) ram ceb Output RAM enable, active low. ram web Output RAM write, active low ram addr Output RAM Address. NUM BITS-1: 0] ram din Output RAM write data NUMB|TS*(N-1)-1:0] ram web Output RAM write mask active low [NUM BITS"(N-1)-1: 0 ram dout Input RAM read-data INUM BITS (N-1)-1: 0 ()It is assumed that a one clock cycle synchronous rAM is used, but arbitration logic between the v-NLM-01 and the sram adds one clock cycle delay to all outputs to the SRAM, and one extra clock cycle delay to the ram dout input from the sram Handling of boundary Pixels Boundary pixels are pixels located near or at the edge of the image, and, consequently are not surrounded by full search windows The v-NLMO1 handles boundary pixels as follows: Pixels at one of the 4 edges-those pixels not only lack a significant portion of the search window but they also do not have a center patch hence it is impossible to determine their distance and the ir weight. Those pixels are transferred as are from input to output page 6 of 8 WWAGO Contact method WWAGO sales@wwago-inc.commoreinfowww.wwago-inc.com Copyright e WWAGO, all righsresarved this Core is frcm WwAGo iP technology pa tner team Contents subject to charge without notice trademarks are the property of their 回 Pixels close to the edge-pixels which are( N-1)/2-1 or less pixels apart from an image edge(n is the search window size) have a partial search window only as depicted in the figure below Effective search windows are colored grey the value of the pixel is evaluated by calculating the weighted average of the patches in the grey area only page 7 of 8 WWAGO Contact method WWAGO sales@wwago-inc.commoreinfowww.wwago-inc.com Copyright e WWAGO, all righsresarved this Core is frcm WwAGo iP technology pa tner team Contents subject to charge without notice trademarks are the property of their 回碳现 回 The c model a bit-exact C model of the vNLMo1 RTL is provided executable only) along with a. ba script file Verilog Test bench read from file 2UX⊥9∠Ux⊥0 RAM w.dela y XEcL t frame read from file crror detection and log n fr the uut. a write to file A Verilog test bench is provided with the vnlmo1 configured for 1920 pixel lines search window= 21x21 in the figure above It reads an input image from a file has defined WIDTH, HEIGHT, bit-per-pixel, search-window size and one over h. It feeds the UUT with the pixels and with the video control signals. It generates randomly spaced pixel valid signals. The output from the UUt is stored in an output image Using define switches, it is possible to make it compare its output to a given expected-results file, and stop when/if any pixel fails The test bench also include a model of the off-lP memory with de lay as defined by the customer page 8 of 8 WWAGO Contact method WWAGO sales@wwago-inc.commoreinfowww.wwago-inc.com Copyright e WWAGO, all righsresarved this Core is frcm WwAGo iP technology pa tner team Contents subject to charge without notice trademarks are the property of their

...展开详情
2019-07-23 上传 大小:1.05MB
举报 收藏
分享