EE499 Digital Image Processing Project 3 xx_imbilinear.m

advertisement
EE499 Digital Image Processing
Project 3
Enlarging and Shrinking Images by Bilinear Interpolation
1. Write a function (xx_imbilinear.m) capable of enlarging or shrinking an image by bilinear
interpolation. The input and output images are of type uint8. An example call to the function
should look like:
B = xx_imbilinear(A, mag);
where A is an input image, mag is the desired magnification and B would be the output image.
The mag value is a multiplicative factor, not a percentage, i.e. mag should be 2 to increase the
size by 2 or 0.5 to shrink the image to ½ its original size.
2. Write a script (proj03.m) that reads in Fig. 2.22(b) (from the current directory) and then uses
your xx_imbilinear function to reduce it to ½ its size. Use xx_imbilinear to enlarge it back to
its original size. Also use xx_imnearest2 (provided in class) to enlarge the reduced figure back
to its original size. All 4 images (the original image, the reduced, and the two enlarged images)
should be written to an imgs subdirectory with file names img1.png to img4.png.
Turn in printed copies of both the function and the script. Email both files (as attachments) to
richardson.tony@gmail.com. The email subject must contain “EE499 Project 3” and then your name.
Download