How to calculate the Compression ratio

6 次查看(过去 30 天)
Hi, could someone explain to me how to calculate the compression ratio of an image from the quantization bit allocation? I thought calculating the ratio from the the image sizes was correct but no, there seems to be a way of calculating it from the quantization bits. Please guide me through this. Thank you

回答(1 个)

Walter Roberson
Walter Roberson 2013-1-18
Under limited circumstances in which quantization (and repacking of binary) is the only compression algorithm, then the compression ratio approaches the number of bits in the original pixel, divided by the number of bits in the quantized pixel.
If the number of quantization states is not a power of 2 (e.g., you quantize to 50 shades), then in the limit use log2 of the number of quantization states, provided you are usual optimal packing (but you would normally use arithmetic encoding instead in such a situation; it makes the calculations much easier.) A less efficient packing that is much easier to process would use ceil(log2(num_quantization_states)) -- e.g., ceil(log2(50)) bits per pixel.

类别

Help CenterFile Exchange 中查找有关 Image Segmentation and Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by