当前位置:网站首页>Bilateral filtering acceleration "recommended collection"
Bilateral filtering acceleration "recommended collection"
2022-07-31 15:11:00 【Full stack programmer webmaster】
Hello everyone, meet again, I'm your friend Quanstack Jun.
Bilateral filter is an image filtering, denoising and edge preserving filter similar to traditional Gaussian smoothing filter that considers both spatial domain and value domain information.Its template coefficient is the product of the spatial coefficient d and the range coefficient r.The idea is: the spatial coefficient is the Gaussian filter coefficient, and the value range coefficient is the difference between the pixel values of the neighboring pixels and the center pixel. When the difference is large, the value range coefficient r is small, that is, it isA decreasing function (positive half of the Gaussian function), the result is that the total coefficient w=d*r becomes smaller, reducing the influence of pixels that are more different from "me" on me.So as to achieve the effect of edge protection, and at the same time, it has a smoothing effect.
Bilateral filtering acceleration:
(1) Make a template coefficient table in advance, so that when traversing each pixel, the original multiplication and division of the coefficients become a more efficient lookup (lookup table), and a lookup table can be made for both the spatial coefficient and the value range.
(2) The separation of Gaussian filtering is simulated, and the two-dimensional bilateral filtering is decomposed into two one-dimensional bilateral filtering.First use the one-dimensional bilateral filtering template to filter the rows, and then perform column filtering on the convolution results. In this step, the original image data can be used for calculation when calculating the value range coefficients (not the intermediate results obtained by row filtering).(The number of multiplications is greatly reduced. When the template size is large, since the bilateral filter template coefficients are not as accurate and separable as the Gaussian filter template (the value range coefficients are not separable), there will be sliding along the coordinate system axis in the result.ambiguity).
(3) The pointer operation of the C language is completely used, and the running speed of the code can also be slightly improved.
Gaussian-like separation acceleration analysis of bilateral filtering: Bilateral filtering is strictly non-separable acceleration, and separation acceleration can obtain approximate results (in general, the results are better).
1. The Gaussian filter can be separated and accelerated, because the two-dimensional Gaussian function can be separated, that is, G(u,v)=g(u)*g(v), which can be directly obtained, the Gaussian template matrix G=G1*G2, the template matrix can be separated into a product of a column vector G1 and a row vector G2 (matrix multiplication).And the template does not depend on the pixel value, the template is independent of the pixel value and is fixed for the entire image.
2. For bilateral filtering: w=d*r, the value range coefficient r is related to the pixel value, the template matrix w cannot be decomposed into a product of a column vector and a row vector, and the template matrix w is related to the pixel value, not independenton the entire image.
3. Filtering separable conditions: (1) The template is independently fixed, (2) The template matrix can be decomposed into a product of a column vector and a row vector, and Gaussian-like filtering can be performed if (1) and (2) are satisfied.Separating acceleration operations.
Whether bilateral filtering can perform "FFT acceleration": bilateral filtering cannot perform FFT-based acceleration
FFT-based filtering acceleration method:
1. Fill the template and the image with 0 respectively (expand to the same size (M1+M2-1)*(N1+N2-1), and place the image and template in the upper left corner of the expansion matrix respectively)
2. The template and the image are respectively subjected to Fourier transform DFT (FFT fast algorithm)
3. Multiply the DFT results (element-wise multiplication)
4. Perform Inverse Fourier Transform IDFT (IFFT) on the multiplication result in the frequency domain
5. Intercept the time domain result obtained by the inverse Fourier transform to obtain the convolution result between the template and the image
Therefore, because the "basic FFT filtering acceleration" is a single operation to directly obtain the filtering result of the whole image, the filter template is required to be fixed and independent for the whole image, while the filter template of bilateral filtering is non-independent and fixed to the whole image, so, bilateral filtering cannot perform "basic FFT filtering acceleration".
And all Laplacian templates, prewiit, sobel and other full-image fixed, independent template filtering can be "based on FFT filtering acceleration".
Note: Due to the "basic FFT filtering acceleration" to perform 0-fill expansion, DFT, IDFT and other operations, although DFT and IDFT have fast algorithms, the computational complexity is still high, usually, when the template size (diameter) is less than 50, the traditional method is faster than the "radix FFT".
Summary: For small templates, use the traditional method or if separable, consider the separable method, and for larger templates, choose the "Radical FFT filtering acceleration" method.
The principle of "basic FFT filtering acceleration": convolution theorem, DFT( f(x)*h(x) ) = DFT( f(x) ) * DFT( h(x) ), the convolution of two signalsThe Fourier transform is equal to the product of the respective Fourier transforms (the time domain convolution is equal to the frequency domain product)
Publisher: Full-stack programmer, please indicate the source: https://javaforall.cn/128340.htmlOriginal link: https://javaforall.cn
边栏推荐
- R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(legend、修改可视化图像的图例在整图中的位置)
- element-plus虚拟表格virtual-list组件中是怎么实现清理lodash.memoize缓存的?
- OpenShift 4 - Customize RHACS security policies to prevent production clusters from using high-risk registry
- NC | 中国农大草业学院杨高文组揭示发现多因子干扰会降低土壤微生物多样性的积极效应...
- org.apache.jasperException(could not initialize class org)
- 四象限时间管理有多好用?
- 「秋招系列」MySQL面试核心25问(附答案)
- vb中如何连接mysql_vb怎么连接数据库「建议收藏」
- TRACE32 - C source code association
- 公告
猜你喜欢

深入浅出边缘云 | 4. 生命周期管理

TRACE32 - Common Operations

Getting started with UnityShader (1) - GPU and Shader

abaqus find contact pairs报错:surface name is already in use

Word表格转到Excel中

公告

Excel quickly aligns the middle name of the table (two-word name and three-word name alignment)

STM32(十)------- SPI通信

为什么黑客领域几乎一片男生?

LeetCode二叉树系列——222.完全二叉树的节点个数
随机推荐
7、常见面试口语提问问题汇总
TRACE32 - SNOOPer-based variable logging
SIGABRT 报错时的注意事项和解决方法
R语言的画图代码及差异性分析[通俗易懂]
双边滤波加速「建议收藏」
Advanced Mathematics - Commonly Used Indefinite Integral Formulas
The R language ggstatsplot package ggbarstats function visualizes bar charts, and adds hypothesis test results (including sample number, statistics, effect size and its confidence interval, significan
NC | 中国农大草业学院杨高文组揭示发现多因子干扰会降低土壤微生物多样性的积极效应...
ES6 类
网线RJ45接口针脚[通俗易懂]
模板与泛型编程值typelist实现
vb中如何连接mysql_vb怎么连接数据库「建议收藏」
WeChat chat record search in a red envelope
OpenCV测量物体的尺寸技能 get~
thread_local 变量的析构顺序
json到底是什么(c# json)
RecyclerView的高效使用第一节
Ubantu专题5:设置静态ip地址
NPM Taobao mirror (latest version) released a new version of npm mirror at 2021-11-21 16:53:52 [easy to understand]
Architecture actual combat battalion module 8 message queue table structure design