Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python Example Code: Affine Transformation The Rotation operator multiplied the vector representing the coordinate by a matrix The affine transformation is quite similar but

image text in transcribed

In python

Example Code:

Affine Transformation

The Rotation operator multiplied the vector representing the coordinate by a matrix

The affine transformation is quite similar but the user defines the matrix

The example below creates a matrix mat that is altered from the rotation matrix, and the affine_transform function is then called that maps the coordinates according to this prescription

%matplotlib inline import matplotlib.pyplot as plt import imageio import scipy.ndimage as nd import numpy as np

def AffineExample(data): theta = 11 * np.pi/180 # 11 degrees in radians mat = np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta/4), np.cos(theta)]]) data2 = nd.affine_transform(data, mat) return data2

url = 'https://raw.githubusercontent.com/joefoxva1/CDS468/master/Lecture2_3_4/bird_js.jpg' adata = imageio.imread(url, as_gray=1)

plt.title('Original Image') plt.imshow(adata, cmap='gray') plt.show()

mg2 = AffineExample(adata)

plt.title('Affine Image') plt.imshow(mg2, cmap='gray') plt.show()

Create an image with an affine transformation of 45 degrees and 90 degrees. Explain the 90 degree result

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions

Question

4. What decision would you make and why?

Answered: 1 week ago