please can someone help me ?
Show older comments
Assignment One: Programming Transform images 1. 2D transformation matrix Develop a MATLAB function called rotateAboutCenterImage that calculates the 2D transformation matrix that rotates an image about its center (center = width/2, height/2). The function inputs are image width, image height, and rotation angle. The function output is the 2D transformation matrix. Include the numerical results output of the function rotateAboutCenterImage with image width = 320, image height = 240, and rotation angle = π/6 in your report with sufficient precision such that it can be evaluated (hint: use format shortg in MATLAB prior to displaying your results).
2. Image transformation and interpolation
I. Nearest neighbor interpolation Develop a MATLAB function called rotateImageNearestNeighbor that transforms an image using the nearest neighbor interpolation method. The function inputs are an image and a 2D transformation matrix. The function output is the transformed image. The function must set pixels to black in the output image that inversely map to pixels outside of the input image boundaries. Develop a MATLAB script called hw1_nearest_neighbor.m that uses imread to read the input image cameraman.tif (included with MATLAB); rotates the image about the center at rotation angles π/6, π/4, and π/2; and writes the corresponding output images to cameraman_nearest_neighbor_rot30.png, cameraman_nearest_neighbor_rot45.png, and cameraman_nearest_neighbor_rot90.png. The script must call the function rotateAboutCenterImage to calculate each 2D transformation matrix (hint: use the size function to determine the width and height of the image). The script must call the function rotateImageNearestNeighbor to apply the transformation. Use imwrite to write each output image in MATLAB. Include in your report the input image and the output image for each rotation angle.
II. Linear interpolation Develop a MATLAB function called rotateImageLinear that transforms an image using the linear interpolation method. The function inputs are an image and a 2D transformation matrix. The function output is the transformed image. The function must set pixels to black in the output image that inversely map to pixels outside of the input image boundaries. Develop a MATLAB script called hw1_linear.m that uses imread to read the input image cameraman.tif; rotates the image about the center at rotation angles π/6, π/4, and π/2; and writes the corresponding output images to cameraman_linear_rot30.png, cameraman_linear_rot45.png, and cameraman_linear_rot90.png. The script must call the function rotateAboutCenterImage to calculate each 2D transformation matrix (hint: use the size function to determine the width and height of the image). The script must call the function rotateImageLinear to apply the transformation. Use imwrite to write each output image in MATLAB. Include in your report the output image for each rotation angle. Comment on the qualitative differences between these results and those obtained using nearest neighbor interpolation. The book web site image data base
Answers (1)
Image Analyst
on 20 Oct 2022
0 votes
Categories
Find more on Image Transforms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!