matlab提取图像低频,获取图像频域并分解为高低频(MATLAB)

本文介绍了使用MATLAB进行图像频域分解的方法,包括离散余弦变换(DCT)和小波变换(SWT)。通过DCT将图像分解为高低频部分,并展示分解结果;同时,利用SWT变换处理图像,观察不同频段的分布特性。
摘要由CSDN通过智能技术生成

获取图像频域并分解为高低频(MATLAB)

我们展示两种频域分解方案:DCT或SWT变换。代码需要适配。

1. DCT变换

%// Load an image

Orig = im2double((imread("output_HEVC/1_QP22_" + tab(i) + ".png")));

%Orig = rgb2gray(Orig);

%// Transform

Orig_T = dct2(Orig);

%// Split between high- and low-frequency in the spectrum (*)

cutoff = round(0.5 * 256);

High_T = fliplr(tril(fliplr(Orig_T), cutoff));

Low_T = Orig_T - High_T;

%// Transform back

High = idct2(High_T);

Low = idct2(Low_T);

%// Plot results

figure, colormap gray

subplot(3,2,1), imagesc(Orig), title('Original'), axis square, colorbar

subplot(3,2,2), imagesc(log(abs(Orig_T))), title('log(DCT(Original))'), axis square, colorbar

subplot(3,2,3), imagesc(log(abs(Low_T))), title('log(DCT(LF))'), axis sq

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值