Write a program that loads in an image and repeatedly rotates it by x degrees until the image has been rotated 360⁰ in total.
Your program should include the following:
• A parameter for the angle to rotate by at each step
• A function for multiplying two arbitrary nxm matrices (n and m should be dynamic)
• A rotation matrix of the format below. Each pixel in the image must be multiplied by R
using the matrix multiplication function (prior bullet).
An array variable for your image that is large enough for the entire image to be visible during all the intermediate rotations (when you’ve rotated 45⁰, the corners of your image should not be clipped)
Absolute color error calculation: Code to compute the absolute error between the colors of the original image’s pixels and the colors of the image after it’s been rotated 360⁰
Pixel displacement calculation: Code to compute the distance each pixel moves during rotation. This total value should be divided by:
(numPixelsInImage * numTimesImageWasRotated)
You can use the OpenCV and Numpy libraries for opening, displaying, and saving images and to create empty arrays/images. You may also use the math library built into Python for sine, cosine, and PI calculations. You may not use any other built-in functions or libraries.
Summary of the assignment goals
3+ images showing your code at intermediate stages (image rotated x degrees) with captions saying what angle stepsize is being used and the total rotation of the image so far (i.e. Image rotated 60⁰ with steps of 20⁰, 3 rotation operations applied so far.)
A chart with the following information filled in:
Angle Step Size
Absolute Color Error
(# Rotations) * (Pixel
Conclusions drawn from the completed chart
Discussion of any issues encountered