anistropic filer

2024-03-01 08:32
文章标签 anistropic filer

本文主要是介绍anistropic filer,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1 、对相邻的8向或者26向进行标准邻域卷积;


hN = [0 1 0; 0 -1 0; 0 0 0];
hS = [0 0 0; 0 -1 0; 0 1 0];
hE = [0 0 0; 0 -1 1; 0 0 0];
hW = [0 0 0; 1 -1 0; 0 0 0];
hNE = [0 0 1; 0 -1 0; 0 0 0];
hSE = [0 0 0; 0 -1 0; 0 0 1];
hSW = [0 0 0; 0 -1 0; 1 0 0];
hNW = [1 0 0; 0 -1 0; 0 0 0];



        nablaN = imfilter(diff_im,hN,'conv');nablaS = imfilter(diff_im,hS,'conv');   nablaW = imfilter(diff_im,hW,'conv');nablaE = imfilter(diff_im,hE,'conv');   nablaNE = imfilter(diff_im,hNE,'conv');nablaSE = imfilter(diff_im,hSE,'conv');   nablaSW = imfilter(diff_im,hSW,'conv');nablaNW = imfilter(diff_im,hNW,'conv'); 


2、迭代到扩散方程

            cN = 1./(1 + (nablaN/kappa).^2);cS = 1./(1 + (nablaS/kappa).^2);cW = 1./(1 + (nablaW/kappa).^2);cE = 1./(1 + (nablaE/kappa).^2);cNE = 1./(1 + (nablaNE/kappa).^2);cSE = 1./(1 + (nablaSE/kappa).^2);cSW = 1./(1 + (nablaSW/kappa).^2);cNW = 1./(1 + (nablaNW/kappa).^2);



3、离散化方程



        diff_im = diff_im + ...delta_t*(...(1/(dy^2))*cN.*nablaN + (1/(dy^2))*cS.*nablaS + ...(1/(dx^2))*cW.*nablaW + (1/(dx^2))*cE.*nablaE + ...(1/(dd^2))*cNE.*nablaNE + (1/(dd^2))*cSE.*nablaSE + ...(1/(dd^2))*cSW.*nablaSW + (1/(dd^2))*cNW.*nablaNW );





参考资料

%   MATLAB implementation based on Peter Kovesi's anisodiff(.):
%   P. D. Kovesi. MATLAB and Octave Functions for Computer Vision and Image Processing.
%   School of Computer Science & Software Engineering,
%   The University of Western Australia. Available from:
%   <http://www.csse.uwa.edu.au/~pk/research/matlabfns/>.

% Credits:
% Daniel Simoes Lopes
% ICIST
% Instituto Superior Tecnico - Universidade Tecnica de Lisboa
% danlopes (at) civil ist utl pt
% http://www.civil.ist.utl.pt/~danlopes


这篇关于anistropic filer的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/761827

相关文章

纹理过滤模式中的Bilinear、Trilinear以及Anistropic Filtering

1、 为什么在纹理采样时需要texture filter(纹理过滤)。 我们的纹理是要贴到三维图形表面的,而三维图形上的pixel中心和纹理上的texel中心并不一至(pixel不一定对应texture上的采样中心texel),大小也不一定一至。当纹理大于三维图形表面时,导至一个像素被映射到许多纹理像素上;当维理小于三维图形表面时,许多个象素都映射到同一纹理。 当这些情况发生时,贴图就会变得模