*Image transformation and interpolation
I. Nearest neighbor interpolationDevelop a MATLAB function called rotateImageNearestNeighbor thattransforms an image using the nearest neighbor interpolationmethod. The function inputs are an image and a 2D transformationmatrix. The function output is the transformed image. The functionmust set pixels to black in the output image that inversely map topixels outside of the input image boundaries.Develop a MATLAB script called hw1_nearest_neighbor.m that usesimread to read the input image cameraman.tif (included withMATLAB); rotates the image about the center at rotation angles π/6,π/4, and π/2; and writes the corresponding output images tocameraman_nearest_neighbor_rot30.png,cameraman_nearest_neighbor_rot45.png, andcameraman_nearest_neighbor_rot90.png. The script must call thefunction rotateAboutCenterImage to calculate each 2D transformationmatrix (hint: use the size function to determine the width andheight of the image). The script must call the functionrotateImageNearestNeighbor to apply the transformation. Use imwriteto write each output image in MATLAB. Include in your report theinput image and the output image for each rotation angle.
*Image transformation and interpolation I. Nearest neighbor interpolation Develop a MATLAB function called rotateImageNe
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am