【发布时间】:2014-09-11 12:47:22
【问题描述】:
我正在尝试计算给定图像的压缩率。我的matlab代码如下:
temp = imfinfo('flowers.jpg'); 压缩比 = (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: {}
运行上面的代码给了我一个大约 120 的压缩比,这是巨大的,看起来并不正确。有什么我做错了吗?我浏览了麻省理工学院的一份文件,他们表明宽度和高度以及位深度应该除以 8,然后除以 FileSize。为什么要除以 8?
【问题讨论】: