Dav*_*man 3 matlab image-compression
我试图计算给定图像的压缩比.我的matlab代码如下:
temp = imfinfo('flowers.jpg'); comperssion_ratio =(temp.Width*temp.Height*temp.BitDepth)/ temp.FileSize;
imfinfo显示以下内容:
FileSize: 11569
Format: 'jpg'
FormatVersion: ''
Width: 430
Height: 430
BitDepth: 8
ColorType: 'grayscale'
FormatSignature: ''
NumberOfSamples: 1
CodingMethod: 'Huffman'
CodingProcess: 'Sequential'
Comment: {}
Run Code Online (Sandbox Code Playgroud)
运行上面的代码给我一个大约120的压缩比,这是巨大的,似乎并不正确.有什么我做错了吗?我浏览了麻省理工学院的一份文件,他们发现宽度和高度以及比特深度应除以8然后除以FileSize.为什么除以8?