当前位置:网站首页>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
边栏推荐
- 腾讯云部署----DevOps
- Message queue data storage MySQL table design
- abaqus find contact pairs报错:surface name is already in use
- ASP.NET Core 产生连续 Guid
- 乡村基冲刺港交所:5个月期内亏2224万 SIG与红杉中国是股东
- 数据库的范式(第一范式,第二范式,第三范式,BCNF范式)「建议收藏」
- Ubantu专题5:设置静态ip地址
- Excel快速对齐表格的中姓名(两个字姓名和三个字姓名对齐)
- 自适应控制——仿真实验三 用超稳定性理论设计模型参考自适应系统
- R语言ggplot2可视化:使用ggpubr包的ggboxplot函数可视化分组箱图、使用ggpar函数改变图形化参数(legend、修改可视化图像的图例在整图中的位置)
猜你喜欢
Ubantu project 4: xshell, XFTP connected the virtual machine and set xshell copy and paste the shortcut
11 pinia使用
【CUDA学习笔记】初识CUDA
「秋招系列」MySQL面试核心25问(附答案)
RecyclerView的高效使用第一节
LeetCode二叉树系列——226.翻转二叉树
基于极限学习机(ELM)进行多变量用电量预测(Matlab代码实现)
分成两栏后文字顺序混乱的问题解决【写期刊论文时】
看交互设计如何集成到Scrum敏捷流程中
Architecture actual combat battalion module 8 message queue table structure design
随机推荐
Ubantu专题5:设置静态ip地址
名创优品斥资6.95亿购买创始人叶国富所持办公楼股权
Prometheus之node_exporter性能监控信息采集含义
定时器的类型
R语言的画图代码及差异性分析[通俗易懂]
RecyclerView的高效使用第一节
The meaning of node_exporter performance monitoring information collection in Prometheus
模板与泛型编程值typelist实现
【MySQL】Mysql范式及外键作用
Synchronized和volatile 面试简单汇总
7、常见面试口语提问问题汇总
NPM Taobao mirror (latest version) released a new version of npm mirror at 2021-11-21 16:53:52 [easy to understand]
org.apache.jasperException(could not initialize class org)
TRACE32 - Common Operations
安装Xshell并使用其进行Ymodem协议的串口传输
格林美瑞交所IPO:募资3.8亿美元 更多中国企业将赴欧洲上市
谷歌CTS测试(cta测试)
01 邂逅typescript,环境搭建
RecyclerView高效使用第二节
JVM参数解析 Xmx、Xms、Xmn、NewRatio、SurvivorRatio、PermSize、PrintGC「建议收藏」