s6 - # 23 ECE 253a Digital Image Processing Pamela Cosman...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
# 23 ECE 253a Digital Image Processing Pamela Cosman 12/8/10 Solutions to Homework 6 1. JPEG quality levels To calculate the MSE, you have to write out the image as a jpeg, and then read it back in and calculate the MSE. The MATLAB code is: % For aerial4.tif aer=imread(’aerial4.tif’,’tif’); imwrite(aer,’aerial4.jpg’,’jpg’); aerjpg=imread(’aerial4.jpg’,’jpg’); aerd=double(aer); aerjpgd=double(aerjpg); mse(aerd,aerjpgd) % For xray.tif xray=imread(’xray.tif’,’tif’); imwrite(xray,’xray.jpg’,’jpg’); xrayd=double(xray); xrayjpg=imread(’xray.jpg’,’jpg’); xrayjpgd=double(xrayjpg); mse(xrayd,xrayjpgd) We get an MSE of 37.9 for the image ’aerial4.tif’ and an MSE of 1.166 for the image ’xray.tif’. To calculate the bit-rate, we use ls -l on a Unix system to find out the file size in bytes. Then the formula to be used is Bit - rate = Size × 8 # pixels to get the bit rate in bits per pixel (bpp). Applying this formula yields bit-rates of 2.0973 bpp for ’aerial4.tif’ and 0.4016 bpp for ’xray.tif’. Using different quality levels, the plots of MSE versus bitrate and PSNR versus bitrate are below. It is clear that xray is more compressible. Seeing the bpp values of the two images, as well as the visual quality and the MSE results, one can say that ’xray.tif’ is much more compressible than ’aerial4.tif’. The xray is a much smoother image. Also, for the xray image, as you put more bits into the JPEG compression, you rapidly hit a point of diminishing return. For the aerial image, you get diminishing returns as well, although it doesn’t happen at such as low bit rate. 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
. 0 1 2 3 4 5 6 7 8 0 100 200 300 400 500 600 700 MSE Plot for aerial4.tif 0 1 2 3 4 5 6 7 8 10 20 30 40 50 60 PSNR Bit-rate in bpp 0 0.5 1 1.5 2 2.5 3 0 20 40 60 80 100 120 Plots for xray.tif 0 0.5 1 1.5 2 2.5 3 25 30 35 40 45 50 55 60 Bitrate in bpp 2. JPEG: Successive Approximation Progressive Mode a) When we divide by 16 and round off to the nearest integer, we get the following block: 2 1 -1 0 0 0 0 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

s6 - # 23 ECE 253a Digital Image Processing Pamela Cosman...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online