💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
基于小波的图像压缩和子带编码是一种常见的图像压缩技术,它利用小波变换将图像分解为不同频率的子带,然后对这些子带进行编码和量化,以实现图像的压缩。 小波变换是一种数学变换方法,它将信号分解为不同尺度和频率的成分。 在图像处理中,小波变换能够将图像分解为多个子带,每个子带对应不同频率的信息,包括低频和高频成分。 将图像通过小波变换分解为多个子带。 对每个子带进行编码和量化,通常采用熵编码等方法。 根据图像的重要性和压缩目标,调整不同子带的量化参数,以控制压缩比和图像质量之间的平衡。 存储或传输编码后的子带数据,以实现图像的压缩。基于小波的图像压缩和子带编码是一种常用的图像压缩技术,能够在保持一定图像质量的前提下实现较高的压缩比。在MATLAB中,可以利用内置的小波变换函数和编码工具来实现这种方法。
📚2 运行结果
主函数部分代码:
clear all;
close all;
X=imread('cameraman.tif');
X=X(1:256,1:256);
figure;
%load woman;
%subplot(2,1,1);
imshow(uint8(X));
[a1,a2]=size(X);
disp('The number of rows in input image are');
disp(a1);
disp('The number of coloums in input image are');
disp(a2);
figure;
title('Input image');
% Perform single-level decomposition
% of X using haar.
[cA1,cH1,cV1,cD1] = dwt2(X,'haar');
% Images coding.
[C,S] = wavedec2(X,1,'haar');
A1 = wrcoef2('a',C,S,'haar',1);
H1 = wrcoef2('h',C,S,'haar',1);
V1 = wrcoef2('v',C,S,'haar',1);
D1 = wrcoef2('d',C,S,'haar',1);
%Display the results of a first level decomposition.
colormap(gray);
subplot(2,2,1); image(wcodemat(A1,192));
title('Approximation A1')
subplot(2,2,2); image(wcodemat(H1,192));
title('Horizontal Detail H1')
subplot(2,2,3); image(wcodemat(V1,192));
title('Vertical Detail V1')
subplot(2,2,4); image(wcodemat(D1,192));
title('Diagonal Detail D1')
%disp(cod_cA1);
%Multi-level 1-D wavelet reconstruction.
re_ima1 = idwt2(cA1,cH1,cV1,cD1,'haar');
re_ima=uint8(re_ima1);
figure;
subplot(2,1,1);
imshow(uint8(X));
title('Input image');
subplot(2,1,2);
imshow(re_ima);
title('1-level reconstructed image');
figure;
🎉3 参考文献
文章中一些内容引自网络,会注明出处或引用为参考文献,难免有未尽之处,如有不妥,请随时联系删除。
[1]杨红菊,吉昌.学习驱动的图像压缩算法研究[J/OL].计算机工程:1-10[2024-06-06].https://doi.org/10.19678/j.issn.1000-3428.0068782.
[2]段增辉,胡益诚,张旭博.基于长短注意力模块的深度学习图像压缩方法[J].信息技术与信息化,2024(04):110-113.