Docsity

Computer Vision Assignment: Transformations and Parallelism, Assignments of Computer science

Toggle sidebar
bg1
Assignmen1
Computer vison
1) Point A = (1,1) T is to be rotated about (-1,-1) T by 45° in the counter clockwise
direction. What is the location of this point after rotation? (Show all steps)
A=[1,1];
In homogeneous form
A=[1 ,1 ,1]’
T=[-1,-1];
T =
1 0 -1
0 1 -1
0 0 1
Inverse_T=[1,1]
inverse_T =
1 0 1
0 1 1
0 0 1
Theta=45
rotation_matrix=[cos(theta) -1*sin(theta);sin(theta) cos(theta)]
rotation_matrix =
0.7071 -0.7071
0.7071 0.7071
M=translation*rotation_matrix*inverse_T;
M=0.7071 -0.7071 -1.0000
0.7071 0.7071 0.4142
pf3
pf4
pf5

Partial preview of the text

Download Computer Vision Assignment: Transformations and Parallelism and more Assignments Computer science in PDF only on Docsity!

Computer vison

1) Point A = (1,1) T is to be rotated about (-1,-1) T by 45° in the counter clockwise

direction. What is the location of this point after rotation? (Show all steps)

A=[1,1];

In homogeneous form

A=[1 ,1 ,1]’
T=[-1,-1];
T =

Inverse_T=[1,1]

inverse_T =

Theta=

rotation_matrix=[cos(theta) -1*sin(theta);sin(theta) cos(theta)]

rotation_matrix =

M=translationrotation_matrixinverse_T;

M=0.7071 -0.7071 -1.

Computer vison

M*A=

2). Give the 2D homogeneous matrix for each of the transformations in parts a-c. Leave

composite transformations in factored form:

a. Scale in the x-dimension by 2 and the y-dimension by 3 with fixed point (-3,1)

scaling_matrix =

[

]

T =

[

]

inverse_T =

[

]

Transformation matrix=TranslationScalinginverse

[

]

[

]

[

]

b. Rotate by 135 degrees about the point (-4,- 3)

Theta=

Computer vison

3) Find a transformation matrix that transforms Figure 1 to 2

A=¿
B=¿

Pseudo inverse method will be used which is

X=(A’*A)-1AtB

A’*A=

[

]

(A’*A)-1At= −0.0475^ 0.0240−0.0409^ 0.08900.

Computer vison

(A’A)-1AtB=transformation matrix=

4) The following 2D transformation is composed of a rotation followed by a scaling followed by a

translation. [ 0.6 −1.04 −20 0.693 0.4 −50 0 0 1 ]

a. a) Find the rotation, scaling and translation matrices, which when multiplied in the

order given above, will result in this transformation (Assume accuracy of up to 2

decimal places)

M= 0.6000 -1.
SVD(M) =

U= rotation1=

Scaling=

s = 1.2007 0

v =Rotation2=

Computer vison

5) Show that parallelism is preserved under a general affine transformation.

To prove: Let f ( x) =A x

→

  • b

→

Then f maps parallel lines to parallel lines

Let l and m are parallel lines

Where

l = p

→

  • t u

→

m = q

→

  • t v

→

v

→

= k u

→

for some k ∈ R

f ( p

→

  • t u

→

) =A ( p

→

  • t u

→

)+ b

→

f ( p

→

  • t u

→

) =A ( p

→

)+ b

→

  • t A u

→

f ( p

→

  • t u

→

) = p 1

→

  • t u 1

→

____eq

f ( q

→

  • t v

→

) =A( q

→

  • t v

→

)+ b

→

f (^ q

→

  • t v

→

) (^) =A( q

→

)+ b

→

  • t A v

→

f ( q

→

  • t v

→

) =A ( q

→

¿

  • b

→

  • t A k u

→

)

f (^ q

→

  • t v

→

) (^) = q 1

→

  • t k u 1

→

_____eq

line

l andm are mapped to lines l1 and m1 which are

parallel