如图,使用matlab编程实现小波变换对一幅图像进行处理,从而得出4个座标图。

如题所述

第1个回答  2014-03-16
A = imread('image.bmp');
B = A(:,:,1);
[lowf,highfH,highfV,highfD,C,S] = wavelet2D(double(B),'morlet',2);
function[lowf,highH,highV,highD,C,S] = wavelet2D(signal,wavelet,level)
[C,S]=wavedec2(signal,level,wavelet);
lowf = appcoef2(C,S,wavelet,level);
highH=detcoef2('h',C,S,level);
highV=detcoef2('v',C,S,level);
highD=detcoef2('d',C,S,level);
A = wrcoef2('a',C,S,wavelet,level);
Dh =wrcoef2('h',C,S,wavelet,level);
Dv =wrcoef2('v',C,S,wavelet,level);
Dd =wrcoef2('d',C,S,wavelet,level);
subplot(2,2,1),image(A);
subplot(2,2,2),imshow(Dh);
subplot(2,2,3),imshow(Dv);
subplot(2,2,4),imshow(Dd);追问

程序试过了吗,

追答

小波变换你明白什么意思吗?

追问

数学层面知道,matlab的程序不懂

追答

一个信号,分程三个高频信号+一个低频信号。三个高频信号又包括水平方向、垂直方向、45度方向。低频信号保留有图像信息和特征。

追问

程序错误

追答

把图片格式用QQ影像转化为bmp格式。

本回答被提问者采纳
第2个回答  2019-03-26
A = imread('‪image.bmp');
subplot(2,2,1);
imshow (A);
hold on;
[C, S]=wavedec2(A, 5, 'db3' );
subplot(2,2,2);
plot (C);
title('wavelet coeffs' );
hold on;
zoom on;
zoom off;
B=sort(C, 2, 'descend' );
subplot(2,2,3);
plot (B);
title('(sorted)');
hold on;
D=log10(B);
subplot(2,2,4);
plot (D);
title('(log10(sorted))');
hold on;
相似回答