📄 enoca2.m
字号:
function X = enoca2(X,Level,Degree)
%ENOCA2 2D Essentially Non-Oscillatory cell-average decomposition.
% Y = ENOCA(X,L,N) computes the L-stage Essentially Non-Oscillatory
% (ENO) decomposition of image X using cell-average discretization
% and Nth-degree interpolation. The image dimensions must be divisible
% by 2^L.
%
% ENOCA2(X,-L,N) is the inverse transform, reversing L levels.
%
% Example:
% % Transform with 3 stages and 5th-degree interpolation
% Y = enoca2(X,3,5); % Decompose X
% R = enoca2(Y,-3,5); % Recover X from Y
%
% See also ENOCA, ENOPV2.
% Pascal Getreuer 2005
if nargin < 2, error('Not enough input arguments.'); end
if rem(size(X),pow2(abs(Level))), error('Invalid input size.'); end
if Level > 0
for k = 1:Level
N = size(X)*pow2(1-k);
X(1:N(1),1:N(2)) = enoca(enoca(X(1:N(1),1:N(2)),1,Degree,1),1,Degree,2);
end
elseif Level < 0
for k = Level:-1
N = size(X)*pow2(k+1);
X(1:N(1),1:N(2)) = enoca(enoca(X(1:N(1),1:N(2)),-1,Degree,2),-1,Degree,1);
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -