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

📄 test_image.m

📁 matlab的工具箱
💻 M
字号:
% test for image transformation

name = 'barb';
n = 128;

M = load_image(name, n);

% find sampling location for an image
[Y,X] = meshgrid(1:n,1:n); 
pos = [X(:),Y(:)]';


% perform the transform
alpert_vm = [2 2];
% this is very important for images
options.part_type = '2axis';  
w = perform_alpert_transform_2d(M(:),pos,alpert_vm, 1, options);

% perform some thresholding
T = 20; % this threshold is ok for images in range [1...256], otherwise scale it
w1 = w .* (abs(w)>T);

% reconstruction
v1 = perform_alpert_transform_2d(w1,pos,alpert_vm, -1, options);
M1 = reshape(v1,n,n);

clf;
subplot(1,2,1);
imagesc(M);
title('Original'); axis image; axis off;
subplot(1,2,2);
imagesc(M1);
title('Approximated'); axis image; axis off;
colormap gray(256);

⌨️ 快捷键说明

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