=L:{cs6320/cv_files/Practice1With... · 2019-04-17 · 3. 3D Modeling: Let us consider a scenario...

6
CS 6320 Computer Vision Practice Set Spring 2019 Name: UID: Each question carries 20 points. Show the necessary steps to compute the final solutions. You are free to use extra papers. 1. Pose Estimation: Let us consider a calibrated camera. Let the origin of the camera be given by O(0, 0, 0). The image resolution is 640 480 and the principal point is given by (320, 240). We assume the following parameters for the camera: u v 1 200 0 320 0 0 200 240 0 0 0 1 0 I 0 0 T 1 0 @ X m Y m Z m 1 1 A where (u, v) correspond to pixel coordinates and I denotes the 3 3 identity matrix. K -1 = 1 200 0 @ 1 0 -320 0 1 -240 0 0 200 1 A The projections of two 3D points A and B on the image are given by a(120, 240) and b(320, 240), respectively. Find the coordinates of the two 3D points A(X 1 ,Y 1 ,Z 1 ) and B(X 2 ,Y 2 ,Z 2 ) that satisfy the 2 conditions: (1) the length of the line segment OA is given by |OA| = 200, and (2) the line segments OA and AB are perpendicular to each other. [20 points] 1 A - x , K - ' La , ] = xi ( To ) B - Kk ' ' (4) = tyg ) I oat = T⇐¥+G = zoo 2×2 = 40000 X . - I look Since A is in front M camera its z value has to te positive a =L :{ I ) f ' II , " onto AJ :O [ ¥3 . L¥⇒= . * ( ÷ .

Transcript of =L:{cs6320/cv_files/Practice1With... · 2019-04-17 · 3. 3D Modeling: Let us consider a scenario...

Page 1: =L:{cs6320/cv_files/Practice1With... · 2019-04-17 · 3. 3D Modeling: Let us consider a scenario where a 3D point Q is observed by two cameras. Let the 2 camera matrices be given

CS 6320 Computer Vision Practice Set

Spring 2019Name:UID:

Each question carries 20 points. Show the necessary steps to compute the final solutions. You are

free to use extra papers.

1. Pose Estimation: Let us consider a calibrated camera. Let the origin of the camera be

given by O(0, 0, 0). The image resolution is 640 ⇥ 480 and the principal point is given by

(320, 240). We assume the following parameters for the camera:

✓uv1

◆⇠

✓200 0 320 00 200 240 00 0 1 0

◆⇣I 0

0T 1

⌘0

@Xm

Y m

Zm

1

1

A

where (u, v) correspond to pixel coordinates and I denotes the 3⇥ 3 identity matrix.

K�1 =1

200

0

@1 0 �3200 1 �2400 0 200

1

A

The projections of two 3D points A and B on the image are given by a(120, 240) and

b(320, 240), respectively. Find the coordinates of the two 3D points A(X1, Y1, Z1) and

B(X2, Y2, Z2) that satisfy the 2 conditions: (1) the length of the line segment OA is given

by |OA| = 200, and (2) the line segments OA and AB are perpendicular to each other. [20

points]

1

A -

- x,

K- '

La, ] = xi (To) B -

- Kk' '

(4) = tyg )

I oat = T⇐¥+G = zoo

⇒ 2×2 = 40000 ⇒ X .

-

I look

Since A is in front M cameraits z value has to

te positive ⇒ a

=L:{I ) f' II

,

" →

onto AJ :O

[¥3 . L¥⇒= .

* ( ÷.

Page 2: =L:{cs6320/cv_files/Practice1With... · 2019-04-17 · 3. 3D Modeling: Let us consider a scenario where a 3D point Q is observed by two cameras. Let the 2 camera matrices be given

2. Model fitting: In Figure ??, you are given a set of 6 2D points (A,B,C,D,E, F ). We can

obtain a line equation by choosing 2 points at a time. Given two 2D points (x1, y1) and (x2, y2),

we can obtain the line equation using the expression (y � y1)(x1 � x2) = (x � x1)(y1 � y2).

The distance of a point (x0, y0) from a line ax + by + c = 0 is given by|ax0+by0+c|p

a2+b2. Let the

threshold in selecting the inliers for a given line equation is given by 0.6.

• (a) Find a pair of points that gives the line equation with the maximum number of

inliers. Show the line equations and inliers.

• (b) Find a point pair that gives the line equation with the minimum number of inliers.

Show the line equations and inliers.

[20 points]

Figure 1:

2

Best line ADy In heirs = { A ,B,E,D3

Worst line BE n=4 Inters = { BE }=

-

Page 3: =L:{cs6320/cv_files/Practice1With... · 2019-04-17 · 3. 3D Modeling: Let us consider a scenario where a 3D point Q is observed by two cameras. Let the 2 camera matrices be given

3. 3D Modeling: Let us consider a scenario where a 3D point Q is observed by two cameras.

Let the 2 camera matrices be given by:

K1 = K2 =

0

@200 0 3200 200 2400 0 1

1

A

Rotation matrices: R1 = R2 = I.

Translation matrices: t1 = 0, t2 = (100, 0, 0)T.

The corresponding 2D points on the images are given by:

q1 =

0

@5204401

1

Aq2 =

0

@3204401

1

A

Compute the 3D point Q. [20 points]

3

Kikki'=

9. =L !]+akT[orig a- [ '

E]tkkI[ oh]⇒=

BE (E) t' 49 )

II 00

itg= ( If )

Dist ( 9,1925 - Cd,-1005 -124

,-725

⇒j= 26,

- too ) +46,

- k ) = o

⇒X

,- too -127

,-27<=0

2DEr 3,1,

-2×2-100 = -

-⇒

2=4,4 ,- WC - D .

- o X,

-_ too

X. = ) a 4<=100

9=C=

Page 4: =L:{cs6320/cv_files/Practice1With... · 2019-04-17 · 3. 3D Modeling: Let us consider a scenario where a 3D point Q is observed by two cameras. Let the 2 camera matrices be given

4. Vocabulary tree: We are given three images I1, I2 and I3. Each of these images have two

2D descriptors as given below.

I1 : {(1.5, 0.5), (�1.5,�1.5)}, I2 : {(1.5, 1.5), (1.5,�1.5)}, I3 : {(1.5, 0.5), (1.5,�0.5)}

In Figure ??, we show a vocabulary tree with branch factor 4. Using this vocabulary tree

find the best image match among the 3 possible pairs {(I1, I2), (I1, I3), (I2, I3)}. Assume that

the nodes in the tree has the same weight wi = 1. Show the normalized di↵erence in each of

the three pairs. [20 points]

Figure 2:

4

- -

TL* . "I.

t '

1- I

of ,

= [ 2,

o 0012oooo ]

GE ( 2, lil 4°

o oooooo I

5- ( 3540€ ,

ooo

00003

Norm - Diff Car,Gd =

Iz - Iz = Iz =3

Norm - Diff ( 9, its ) =

§ - Iz = 12=2

Norm - Diff ( Kid -

- Byz- 93£ = Yee

Page 5: =L:{cs6320/cv_files/Practice1With... · 2019-04-17 · 3. 3D Modeling: Let us consider a scenario where a 3D point Q is observed by two cameras. Let the 2 camera matrices be given

5. Belief Propagation: You have 2 Boolean variables (x1, x2 2 {0, 1}) and 3 equations as

shown below:

x1 + 4x2 = 5

�x1 + 2x2 = 1

�3x1 + 2x2 = �1.2

Show the factor graph and use Belief propagation to solve the equations. Please show the

messages in each iteration till the algorithm terminates. [20 points]

5

y④-

D-④yes

a'E¥ n.IE# n Yeast.

in

absolute values for

⑨ It ⑦ the difference .

Steps All zero messages

mi→a=o

,mz→a=7M→E9Mz→E ,

MI → Eo ,Mz→c=o

- x -

Stere ma→ ,

=min [Mz→aCn£t

Coracoid

k Mua Capt a ached ) =L !]

man -

- It:3^

b - si =

main [ massacred teacher ]Most Cnd tqci.az )

=

Similar 's mz→=f ;) me . ,

-

- ( :3 ) meet :3)

Steps 4=1 ⇒ bit toSteph

u,

←I

,

Nz ← \

-

Page 6: =L:{cs6320/cv_files/Practice1With... · 2019-04-17 · 3. 3D Modeling: Let us consider a scenario where a 3D point Q is observed by two cameras. Let the 2 camera matrices be given

S :

m ,→a= ( :⇒ meet:)must = ( 2 meet be ⇒Mhc = ( 3) Mate -_ ( I )

Stere :

ma→= main LI I=c⇒

man -

- i.EE: ":D

⇐( hi:)man ⇐min:L :*:⇐⇐C⇒

an = I:c:=L

Steps :

me- ' '

= ( %) mc→z=( to:{ )-

G,

-

- C so:{ ) h -

- ( so:3 )Step se

,← I

,nz←l

, tTERME