⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boundmirrorensure.m

📁 example of matlab source code of snake algorithm.
💻 M
字号:
function B = BoundMirrorEnsure(A)% Ensure mirror boundary condition%% The number of rows and columns of A must be greater than 2%% for example (X means value that is not of interest)% % A = [%     X  X  X  X  X   X%     X  1  2  3  11  X%     X  4  5  6  12  X %     X  7  8  9  13  X %     X  X  X  X  X   X%     ]%% B = BoundMirrorEnsure(A) will yield%%     5  4  5  6  12  6%     2  1  2  3  11  3%     5  4  5  6  12  6 %     8  7  8  9  13  9 %     5  4  5  6  12  6%% Chenyang Xu and Jerry L. Prince, 9/9/1999% http://iacl.ece.jhu.edu/projects/gvf[m,n] = size(A);if (m<3 | n<3)     error('either the number of rows or columns is smaller than 3');endyi = 2:m-1;xi = 2:n-1;B = A;B([1 m],[1 n]) = B([3 m-2],[3 n-2]);  % mirror cornersB([1 m],xi) = B([3 m-2],xi);          % mirror left and right boundaryB(yi,[1 n]) = B(yi,[3 n-2]);          % mirror top and bottom boundary

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -