matlab实现jpeg算法进行图像压缩的源代码

matlab实现jpeg算法进行图像压缩的源代码

ID:1537539

大小:80.46 KB

页数:10页

时间:2017-11-12

matlab实现jpeg算法进行图像压缩的源代码_第1页
matlab实现jpeg算法进行图像压缩的源代码_第2页
matlab实现jpeg算法进行图像压缩的源代码_第3页
matlab实现jpeg算法进行图像压缩的源代码_第4页
matlab实现jpeg算法进行图像压缩的源代码_第5页
资源描述:

《matlab实现jpeg算法进行图像压缩的源代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、functionjpeg%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%THISWORKISSUBMITTEDBY:%%%%OHADGAL%%%%%%%%%%%%

2、%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%closeall;%==================%section1.2+1.3%==================%thefollo

3、winguseofthefunction:%%plot_bases(base_size,resolution,plot_type)%%willplotthe64wantedbases.Iwilluse"zero-padding"forincreasedresolution%NOTETHATTHESEARETHESAMEBASES!%forreferenceIplotthefollowing3graphs:%a)3Dplotwithbasicresolution(64plotsof8x8pixels)using"surf"fu

4、nction%b)3Dplotwithx20resolution(64plotsof160x160pixels)using"mesh"function%c)2Dplotwithx10resolution(64plotsof80x80pixels)using"mesh"function%d)2Dplotwithx10resolution(64plotsof80x80pixels)using"imshow"function%%NOTE:matrixsizeofpictures(b),(c)and(d),cansupporthig

5、herfrequency=higherbases%butIamnotaskedtodrawthese(higherbases)inthissection!%thezeropaddingisusedONLYforresolutionincrease!%%getallbasepictures(3Dsurfacefigure)plot_bases(8,1,'surf3d');%getallbasepictures(3Dsurfacefigure),x20resolutionplot_bases(8,20,'mesh3d');%ge

6、tallbasepictures(2Dmeshfigure),x10resolutionplot_bases(8,10,'mesh2d');%getallbasepictures(2Dmeshfigure),x10resolutionplot_bases(8,10,'gray2d');%==================%section1.4+1.5%==================%foreachpicture{'0'..'9'}performa2dimensionaldcton8x8blocks.%savethed

7、ctinsideacellofthesize:10cellsof128x128matrix%showforeachpicture,it'sdct8x8blocktransform.foridx=0:9%loadapictureswitchidxcase{0,1},input_image_128x128=im2double(imread(sprintf('%d.tif',idx),'tiff'));otherwise,input_image_128x128=im2double(imread(sprintf('%d.tif',i

8、dx),'jpeg'));end%performDCTin2dimensionoverblocksof8x8inthegivenpicturedct_8x8_image_of_128x128{idx+1}=image_8x8_block_dct(input_image_128x128);i

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。