# Problem 1. Zooming and Shrinking by Interpolation

Use the image of Lena used in lab 1 or get it from the attachment with this material

- Shrinking the image into half size of the original
- Zoom the image into double size of the original
- Shrink the image into one third size of the original
- Zoom the image into triple size of original

# Problem 2. Image Reconstruction by Projection Slice Theorem

- Introduction

For this problem, you will implement Fourier Transform technique for the 2D image construction n problem. The goal is to construction the original 32x32 image g(x, y). You are given a set of 180 projections ${f}_{\theta}\left({x}_{\theta}\right)$ with $\theta $ varying from 0 to 179

For each projection ${f}_{\theta}\left({x}_{\theta}\right)$ is the line integral of g(x, y) along lines at the angle $\theta $ with the x-axis

- Data Format

Once you load the file lab3_2.mat, you will have the following matrices:

- img original (32x32): This is the original image.
- proj (49x180): This is the set of 180 projections, each being a column vector. You are free to choose the number of projections necessary to reconstruct the original image.
- proj theta (1x180): The angles corresponding to each projection.
- x theta (49x1): This is the coordinate values of the projected ${x}_{\theta}$-axis. For this specific case, we have $-\text{24}\le {x}_{\theta}\le \text{24}$
- Implementation

You are asked to implement Fourier Transform Technique for this image reconstruction, For this method, once you have obtained the Fourier domain samples on polar raster, use linear interpolation to obtain the estimates on the rectangular raster. Then perform inverse FFT to reconstruct the original image

You may want to use the following functions: **meshgrid, interp2** (or **griddata**), **pol2cart**

# Problem 3. Image warping

- Loading Data

Get the image from “lab3_pkg.zip” in the attachment

The package includes:

- A 515x512 with 3 color channels of Lena in Lena.tiff

After loading it by **img = double(imread(‘lena.tiff’))/255;**

You will have 515x512x3 array

- The initial mesh in lena-neutral.txt. You may load it using the statement

m = loadmesh(‘lena-neutral.txt’)

**loadmesh **is the function defined in loadmesh.m which includes the document for the format of the resulting mesh

- warping.m: main warping image
- mainwarping.m: starting point of the package
- Other files: GUI and supporting function, you can have a look at them at home if you are interested
- Warping

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

- Alter Expression

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

We will have the competition for the most beautiful Lena made up

# Related documents

All the file including images and Matlab files are here.

### Tập tin đính kèm

- Day3materials.rar