Anda di halaman 1dari 2

ECE547 Image Processing

Oct 6, 2011

Machine Problem 4
Lecturer: Prof. Thomas Huang Due: Oct 20, 2011

Introduction

In this machine problem, you will apply image warping technique to modify the lena image. The aim is to deform the image to make lena (1) smile and (2) upset.

2
2.1

Description
Loading Data

The underlying image that we are going to work with is lena.tiff included in the distribution. You may use the following MATLAB statement to read it: img = double(imread(lena.tiff))/255; It is a 512 512 with 3 color channels, making img a 512 512 3 array. The initial mesh that we are using is specied in lena-neutral.txt. You may load it using the statement: m = loadmesh(lena-neutral.txt); Please see the documentation included in loadmesh.m for the format of the resulting mesh.

2.2

Warping

The current code in warpimg.m just copies the input image verbatim. Replace this default with your image warping implementation.

2.3

Alter Expression

Use the modifymesh.m function to alter Lenas expression. You may save the resultant mesh using the savemesh.m function.

2.4

Extra Credit

There are two possible options for extra credit: 1. Use your own starting mesh for Lena. You will have to develop your own tools or use a text editor to create this mesh. Please save this mesh as lena-neutral-alt.txt. If you decide to do this extra credit, you do not need to make more images with the provided mesh. 2. Do the warping using thin-plate-spline interpolation. Please create a MATLAB function named warpimg tps.m with the same prototype as warpimg.m. To generate images, you may call the function from the command line, or tweak modifymesh.m to use your new version. You still need to create a version which performs normal ane warping even if you decide to do this extra credit. MP4-1

Hand-in

Please create an archive of your work named netid.zip or netid.tar.gz, where netid is your NetID. In this archive, include: 1. Source code for the functions mentioned above, and any auxiliary functions you may have written. This includes warpimg tps.m if you decided to do extra credit 2. 2. (extra credit 1) Your alternate starting mesh. Name this le lena-neutral-alt.txt 3. The results of making Lena smile. This includes The mesh. Name this le lena-smile-mesh.txt. The image. Name this le lena-smile.png. (extra credit 2) The thin-plate-spline image. Name this le lena-smile-tps.png. 4. The results of making Lena upset. The mesh. Name this le lena-upset-mesh.txt. The image. Name this le lena-upset.png. (extra credit 2) The thin-plate-spline image. Name this le lena-upset-tps.png. 5. A short report (plain text will be ne, doc or pdf will be accepted) which species: (a) Your name. (b) A brief summary of how you went about moving the vertices. (c) (extra credit 1) A brief summary of how you chose your alternate starting mesh. (d) (extra credit 2) A comparison between the regular and the thin-plate spline warpings. Please email a copy of the archive to ece547.uiuc@gmail.com

Additional Resource

MathWorks Inc. provides an excellent documentation on how to use MATLAB. You may learn more about MATLAB from their website at: http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.shtml

MP4-2

Anda mungkin juga menyukai