appcoef2 matlab,2-D approximation coefficients

This example shows how to reconstruct approximation coefficients from a multilevel wavelet decomposition of an image.

Set the DWT extension mode to zero-padding. Load and display an image.

origmode = dwtmode('status','nodisplay');

dwtmode('zpd','nodisp')

load woman

image(X)

colormap(map)

title('Original')

f3f5210028aaf505d5f96a00b60b5b8c.png

size(X)

ans = 1×2

256 256

Perform a three-level wavelet decomposition of the image using the db1 wavelet. Display the number of elements in the coefficients array cfs, and the contents of the bookkeeping matrix inds. Note that cfs has the same number of elements as X.

wv = 'db1';

[cfs,inds] = wavedec2(X,3,wv);

numel(X)

ans = 65536

numel(cfs)

ans = 65536

inds

inds = 5×2

32 32

32 32

64 64

128 128

256 256

Extract and display the approximation coefficients at level 2.

cfs2 = appcoef2(cfs,inds,wv,2);

figure

imagesc(cfs2)

colormap('gray')

title('Level 2 Approximation Coefficients')

9ba70be6d9e0c7331e4470d955fc82a5.png

size(cfs2)

ans = 1×2

64 64

Extract and display the approximation coefficients at level 3.

cfs3 = appcoef2(cfs,inds,wv,3);

figure

imagesc(cfs3)

colormap('gray')

title('Level 3 Approximation Coefficients')

687fc51356d01a2a8cc5f9b135153cc7.png

size(cfs3)

ans = 1×2

32 32

Restore the original extension mode.

dwtmode(origmode,'nodisplay')

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值