PDA

查看完整版本 : [求助]matlab如何求图片大小


ajn25953
2008-06-07, 21:24
现在将一幅图片进行了压缩,想知道用什么函数可以求出图片的大小,以确定压缩前后图片大小的变化,得出压缩比。

Lean
2009-01-14, 00:47
现在将一幅图片进行了压缩,想知道用什么函数可以求出图片的大小,以确定压缩前后图片大小的变化,得出压缩比。

这个是得到图像尺寸的程序: [m,n]=size(图像名称); m,n即为长和宽

johnny8088
2009-01-31, 02:32
现在将一幅图片进行了压缩,想知道用什么函数可以求出图片的大小,以确定压缩前后图片大小的变化,得出压缩比。

Rafael C. Gonzalez's Digital Image Processing Using Matlab page 21

K=imfinfo('xxx.jpg');
image_bytes=K.Width*K.Height*K.BitDepth/8;
compressed_bytes=K.FileSize;
compression_ratio=image_bytes/compressed_bytes %no ; here to get the result.

Read the book

kevin_6603
2009-02-03, 23:05
现在将一幅图片进行了压缩,想知道用什么函数可以求出图片的大小,以确定压缩前后图片大小的变化,得出压缩比。

#2 is the common way we use for the size of the image

#3 is the direct right way to get the ratio of the change