✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,代码获取、论文复现及科研仿真合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
🔥 内容介绍
图像压缩在图像处理和传输中至关重要,它可以减少图像文件的大小,同时保持视觉上可接受的质量。本文将探讨基于奇异值分解(SVD)、分块奇异值分解(SVD)和小波变换结合奇异值分解(SVD)的三种图像压缩方法,并分析它们的压缩比和信噪比(SNR)。
奇异值分解(SVD)
奇异值分解(SVD)是一种矩阵分解技术,可以将一个矩阵分解为三个矩阵的乘积:
A = UΣV^T
其中,U和V是正交矩阵,Σ是对角矩阵,其对角线元素称为奇异值。
基于奇异值分解(SVD)的图像压缩
基于奇异值分解(SVD)的图像压缩方法利用了图像中数据的相关性。通过对图像进行SVD分解,可以将图像表示为奇异值和奇异向量的线性组合。然后,可以通过截断较小的奇异值来降低图像的秩,从而实现压缩。
分块奇异值分解(SVD)
分块奇异值分解(SVD)是一种改进的SVD方法,它将图像划分为较小的块,然后对每个块进行SVD分解。这种方法可以更好地捕捉图像中的局部特征,从而提高压缩效率。
小波变换结合奇异值分解(SVD)
小波变换是一种时频分析技术,可以将图像分解为不同尺度的子带。通过将小波变换与SVD相结合,可以进一步提高图像压缩效率。小波变换可以捕获图像中的边缘和纹理等高频成分,而SVD可以捕获低频成分。
压缩比和信噪比
图像压缩的两个重要指标是压缩比和信噪比(SNR)。压缩比衡量压缩后图像文件的大小与原始图像文件大小之比,而SNR衡量压缩后图像的质量。
📣 部分代码
function [ err ] = mmwrite(filename,A,comment,field,precision)%% Function: mmwrite(filename,A,comment,field,precision)%% Writes the sparse or dense matrix A to a Matrix Market (MM)% formatted file.%% Required arguments:%% filename - destination file%% A - sparse or full matrix%% Optional arguments:%% comment - matrix of comments to prepend to% the MM file. To build a comment matrix,% use str2mat. For example:%% comment = str2mat(' Comment 1' ,...% ' Comment 2',...% ' and so on.',...% ' to attach a date:',...% [' ',date]);% If ommitted, a single line date stamp comment% will be included.%% field - 'real'% 'complex'% 'integer'% 'pattern'% If ommitted, data will determine type.%% precision - number of digits to display for real% or complex values% If ommitted, full working precision is used.%if ( nargin == 5)precision = 16;elseif ( nargin == 4)precision = 16;elseif ( nargin == 3)mattype = 'real'; % placeholder, will check after FIND-ing Aprecision = 16;elseif ( nargin == 2)comment = '';% Check whether there is an imaginary part:mattype = 'real'; % placeholder, will check after FIND-ing Aprecision = 16;endmmfile = fopen([filename],'w');if ( mmfile == -1 )error('Cannot open file for output');end;[M,N] = size(A);%%%%%%%%%%%%% This part for sparse matrices %%%%%%%%%%%%%%%%if ( issparse(A) )[I,J,V] = find(A);if ( sum(abs(imag(nonzeros(V)))) > 0 )Vreal = 0;elseVreal = 1;endif ( ~ strcmp(mattype,'pattern') & Vreal )mattype = 'real';elseif ( ~ strcmp(mattype,'pattern') )mattype = 'complex';end%% Determine symmetry:%if ( M ~= N )symm = 'general';issymm = 0;NZ = length(V);elseissymm = 1;NZ = length(V);for i=1:NZif ( A(J(i),I(i)) ~= V(i) )issymm = 0;break;endendif ( issymm )symm = 'symmetric';ATEMP = tril(A);[I,J,V] = find(ATEMP);NZ = nnz(ATEMP);elseisskew = 1;for i=1:NZif ( A(J(i),I(i)) ~= - V(i) )isskew = 0;break;endendif ( isskew )symm = 'skew-symmetric';ATEMP = tril(A);[I,J,V] = find(ATEMP);NZ = nnz(ATEMP);elseif ( strcmp(mattype,'complex') )isherm = 1;for i=1:NZif ( A(J(i),I(i)) ~= conj(V(i)) )isherm = 0;break;endendif ( isherm )symm = 'hermitian';ATEMP = tril(A);[I,J,V] = find(ATEMP);NZ = nnz(ATEMP);elsesymm = 'general';NZ = nnz(A);endelsesymm = 'general';NZ = nnz(A);endendend% Sparse coordinate format:rep = 'coordinate';fprintf(mmfile,'%%%%MatrixMarket matrix %s %s %s\n',rep,mattype,symm);[MC,NC] = size(comment);if ( MC == 0 )fprintf(mmfile,'%% Generated %s\n',[date]);elsefor i=1:MC,fprintf(mmfile,'%%%s\n',comment(i,:));endendfprintf(mmfile,'%d %d %d\n',M,N,NZ);cplxformat = sprintf('%%d %%d %% .%dg %% .%dg\n',precision,precision);realformat = sprintf('%%d %%d %% .%dg\n',precision);if ( strcmp(mattype,'real') )for i=1:NZfprintf(mmfile,realformat,I(i),J(i),V(i));end;elseif ( strcmp(mattype,'complex') )for i=1:NZfprintf(mmfile,cplxformat,I(i),J(i),real(V(i)),imag(V(i)));end;elseif ( strcmp(mattype,'pattern') )for i=1:NZfprintf(mmfile,'%d %d\n',I(i),J(i));end;elseerr = -1;disp('Unsupported mattype:')mattypeend;%%%%%%%%%%%%% This part for dense matrices %%%%%%%%%%%%%%%%elseif ( sum(abs(imag(nonzeros(A)))) > 0 )Areal = 0;elseAreal = 1;endif ( ~strcmp(mattype,'pattern') & Areal )mattype = 'real';elseif ( ~strcmp(mattype,'pattern') )mattype = 'complex';end%% Determine symmetry:%if ( M ~= N )issymm = 0;symm = 'general';elseissymm = 1;for j=1:Nfor i=j+1:Nif (A(i,j) ~= A(j,i) )issymm = 0;break;endendif ( ~ issymm ) break; endendif ( issymm )symm = 'symmetric';elseisskew = 1;for j=1:Nfor i=j+1:Nif (A(i,j) ~= - A(j,i) )isskew = 0;break;endendif ( ~ isskew ) break; endendif ( isskew )symm = 'skew-symmetric';elseif ( strcmp(mattype,'complex') )isherm = 1;for j=1:Nfor i=j+1:Nif (A(i,j) ~= conj(A(j,i)) )isherm = 0;break;endendif ( ~ isherm ) break; endendif ( isherm )symm = 'hermitian';elsesymm = 'general';endelsesymm = 'general';endendend% Dense array format:rep = 'array';[MC,NC] = size(comment);fprintf(mmfile,'%%%%MatrixMarket mtx %s %s %s\n',rep,mattype,symm);for i=1:MC,fprintf(mmfile,'%%%s\n',comment(i,:));end;fprintf(mmfile,'%d %d\n',M,N);cplxformat = sprintf('%% .%dg %% .%dg\n', precision,precision);realformat = sprintf('%% .%dg\n', precision);if ( ~ strcmp(symm,'general') )rowloop = 'j';elserowloop = '1';endif ( strcmp(mattype,'real') )for j=1:Nfor i=eval(rowloop):Mfprintf(mmfile,realformat,A(i,j));endendelseif ( strcmp(mattype,'complex') )for j=1:Nfor i=eval(rowloop):Mfprintf(mmfile,cplxformat,real(A(i,j)),imag(A(i,j)));endendelseif ( strcmp(mattype,'pattern') )err = -2disp('Pattern type inconsistant with dense matrix')elseerr = -2disp('Unknown matrix type:')mattypeendendfclose(mmfile);
⛳️ 运行结果




结论
基于SVD、分块SVD和小波变换结合SVD的图像压缩方法都具有较高的压缩比和信噪比。其中,小波变换结合SVD方法的压缩效率最高,信噪比也最高。因此,小波变换结合SVD方法是一种适用于图像压缩的高效技术。
🔗 参考文献
[1] 许海霞,周维,陈维.基于SVD分解的数字图像盲水印[J].计算机系统应用, 2007, 16(010):106-109.DOI:10.3969/j.issn.1003-3254.2007.10.027.
[2] 刘汉强.基于奇异值分解(SVD)和小波变换的图像压缩算法[J].福建电脑, 2008(1):2.DOI:10.3969/j.issn.1673-2782.2008.01.040.
🎈 部分理论引用网络文献,若有侵权联系博主删除
🎁 关注我领取海量matlab电子书和数学建模资料
👇 私信完整代码和数据获取及论文数模仿真定制
1 各类智能优化算法改进及应用
生产调度、经济调度、装配线调度、充电优化、车间调度、发车优化、水库调度、三维装箱、物流选址、货位优化、公交排班优化、充电桩布局优化、车间布局优化、集装箱船配载优化、水泵组合优化、解医疗资源分配优化、设施布局优化、可视域基站和无人机选址优化、背包问题、 风电场布局、时隙分配优化、 最佳分布式发电单元分配、多阶段管道维修、 工厂-中心-需求点三级选址问题、 应急生活物质配送中心选址、 基站选址、 道路灯柱布置、 枢纽节点部署、 输电线路台风监测装置、 集装箱船配载优化、 机组优化、 投资优化组合、云服务器组合优化、 天线线性阵列分布优化
2 机器学习和深度学习方面
2.1 bp时序、回归预测和分类
2.2 ENS声神经网络时序、回归预测和分类
2.3 SVM/CNN-SVM/LSSVM/RVM支持向量机系列时序、回归预测和分类
2.4 CNN/TCN卷积神经网络系列时序、回归预测和分类
2.5 ELM/KELM/RELM/DELM极限学习机系列时序、回归预测和分类
2.6 GRU/Bi-GRU/CNN-GRU/CNN-BiGRU门控神经网络时序、回归预测和分类
2.7 ELMAN递归神经网络时序、回归\预测和分类
2.8 LSTM/BiLSTM/CNN-LSTM/CNN-BiLSTM/长短记忆神经网络系列时序、回归预测和分类
2.9 RBF径向基神经网络时序、回归预测和分类
本文探讨了使用奇异值分解(SVD)、分块SVD和小波变换结合SVD的图像压缩技术,比较了它们在压缩比和信噪比上的表现,指出小波变换结合SVD在压缩效率和质量上具有优势。
1252

被折叠的 条评论
为什么被折叠?



