This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: RUTGERS UNIVERSITY School of Electrical and Computer Engineering ECE 447 Fall Course Laboratory No. 4 Solution Image Processing in MATLAB Image Decimation and Interpolation 1 Preliminaries The goal of this laboratory exercise is to explore the problem of changing the sampling rate of an image using only digital computation. As discussed in class, discrete representations of images are obtained by sampling, i.e., f [ m,n ] = f ( mD,nD ) (1) where we have assumed that the sampling period, D , is the same in both dimensions. Such discrete images have the discretespace Fourier representation of the form: F s ( u,v ) = X m = X n = f [ m,n ] e j 2 umD e j 2 vnD (2) where F s ( u,v ) is related to F ( u,v ) by the aliasing formula: F s ( u,v ) = 1 D 2 X q = X r = F ( u q/D,v r/D ) (3) It can easily be shown that if F ( u,v ) is spatial frequency limited, i.e, F ( u,v ) = 0 for  u  1 / (2 D ) and  v  1 / (2 D ) then the original continuousdomain image can be recovered from the samples by the interpolation formula: f r ( x,y ) = f ( x,y ) = X m = X n = f [ m,n ] h r ( x mD,y nD ) (4) where h r ( x,y ) is the ideal lowpass filter (with gain D 2 ) impulse response of the form: h r ( x,y ) = sin( x/D ) ( x/D ) sin( y/D ) ( y/D ) (5) To sample the image with a new sampling period, or at different sample points, it is nec essary to evaluate Eq. (4) at the desired new sample points. This can be done approximately using simple combinations of linear filtering with upsampling and downsampling. The purpose of this lab is to give you some experience with changing the sampling rate of an image (decimating and interpolating the image) using a range of linear filtering designs. 1 2 Exercise 1 Reducing the Sampling Rate of an Im age The sampling rate of a digital image, f [ m,n ] can be reduced by an integer factor P by simply sampling the discrete image with period P in both indices; i.e., f d [ m,n ] = f [ mP,nP ] (6) The operation of Eq. (6) is called downsampling by a factor P. Downsampling produces an image that is smaller than the original image by a factor of P 2 in pixel count. Thus if we begin with a sampled image with an image size of 512 x 512, the downsampled image, using a factor of P for downsampling, is of size 512 /P x 512 /P . Thus for P = 2 the downsampled image would be of size 256 x 256. The problem with downsampling a digital image is that the features of the image are likely to be subject to aliasing distortion since the spatial frequency at which we are sampling the frequency is half the size of the original spatial frequency at which the original image was sampled, and the resulting process naturally leads to spectral aliasing....
View
Full
Document
 Fall '08
 Rabiner,L
 Image processing

Click to edit the document details