Вы находитесь на странице: 1из 16

Robotics and Machine Vision

(MBE 4032)

Assignment 2
Question 1

q (m) p (c) Equation of a straight line


q
q 0 p q0 By using the equation, the look-up table
p0 that gives the new brightness:
128
q p 128 Original p 32 64 128 256 512
256
New q 112 96 64 0 0
q 0.5 p 128
Question 2

N
0 0 0 0 0 0
0 0 0 0
n
0 0
1 1 1 1 1 1 1
1 1
1 1


1 1 1 n N


1 1
1 1
1 1 1 1 1 1 1
0 0
0 0 0 0
0 0 0 0 0 0
Question 2
The Sobel Operators are:
Gx Gy Given image:
-1 -2 -1 -1 0 1
0 0 0 -2 0 2 a b c
1 2 1 -1 0 1 d e f
g h i

Gx (1)(a) (2)(b) (1)(c) Gy (1)(a) (0)(b) (1)(c)


(0)(d ) (0)(e) (0)( f ) (2)(d ) (0)(e) (2)( f )
(1)( g ) (2)(h) (1)(i ) (1)( g ) (0)(h) (1)(i )
G Gx Gy
Question 2
7) 0 0 0 Gx = 1 0 0 0 0 0 0
1) 0 0 0 Gx = 0 0 0 0 0

Gy = 0 0 0 1 Gy = 3
0 0 0 0 0

G=0 0 0 1 G=4 1 1 1 1 1 1 1
0 0 0 1 1

8) 0 0 0 Gx = 3 1 1

2) 0 0 0 Gx = 1 Gy = 3
0 1 1
0 0 0 Gy = 1 G=6 1 1 1
0 1 1
0 0 1 G=2

1 1
3) 0 0 0 Gx = 3 14) 1 1 1 Gx = 0 1 1
1 1 1 1 1 1 1
0 0 0 Gy = 1 1 1 1 Gy = 0 0 0

0 1 1 G=4 1 1 1 G=0 0 0 0 0
0 0 0 0 0 0

26) 1 0 0 Gx = -1
0 0 0 Gy = -1 26 cases in total
0 0 0 G=2
Question 2
N
0 0 0 0 0 0
0 0 n 0 0
0 2 4 4 4 4 4 2 0
4 6 4 4 4 4 4 6 4
4 4 0 0 0 4 4
4 4


4 4 0 0 0 4 4 n N


4 4
4 4 0 0 0 4 4
4 6 4 4 4 4 4 6 4
0 2 4 4 4 4 4 2 0
0 0 0 0
0 0 0 0 0 0
Question 3

N/2 N/2

LA LA LB LB
LA LA LB LB
LA LA LB LB

N



LA LA LB LB
Question 3
Gray-scale wedge:
N/2 N/2

0 K
Gray Level

K/2

N/2 N
Question 3
Image: N/2 N/2

LA LA LA LA LB LB LB LB

Level

LA

LB

N/2 N
Operation: 0 K

LA LA LA LA LB LB LB LB
Question 3
Case 1: LA < 2LB 0.5KLA < KLB
Level
LA LA LA LA LA LB LB LB LB
LB

Gray Level N/2 N


K
0 0.5K K
K/2

Gray Level N/2 N


KLB 0 KLB

0.5KLA
0.5KLB Number of Pixels

N/2 N P
P/2
Histogram:
0.5KLB 0.5KLA KLB Gray Level
Question 3
Case 2: LA > 2LB 0.5KLA > KLB
Level
LA
LA LA LA LA LB LB LB LB
LB

Gray Level N/2 N


K
0 0.5K K
K/2

Gray Level N/2 N


0.5KLA 0 KLB

KLB
0.5KLB Number of Pixels

N/2 N P
P/2
Histogram:
0.5KLB KLB 0.5KLA Gray Level
Question 4

1
1
2 0
0 0 0 Chain Code: 000332123211
2
3
First Difference: 1 10 = 3
1 3 2 00 = 0
2

1 3 1 3 300303311330
Shape Number: 300303311330 smallest
2 2 003033113303 number
030331133030

= 003033113303
Question 5

Image coordinates of the point Perspective World coordinates


as projected on the plane matrix (lens) of the point

c PRTwc
Rotation(s) required to align the Translation required to align the
camera frame with the world frame camera frame with the world frame
Question 5
a) Rotation about the x-axis by a = 135o is performed by using this transformation
1 0 0 0 1 0 0 0 1 0 0 0
0 cos a sin a 0 0 cos(135) sin(135) 0 0 2 / 2 2/2 0
Ra , 135
0 sin a cos a 0 0 sin( 135) cos(135) 0 0 2 / 2 2 / 2 0

0 0 0 1 0 0 0 1 0 0 0 1
Rotation about the z-axis by q = 135o is performed by using this transformation
cos q sin q 0 0 cos(135) sin(135) 0 0 2/2 2/2 0 0
sin q
cos q 0 0 sin(135) cos(135) 0 0 2 / 2 2 / 2 0 0
Rq , 135
0 0 1 0 0 0 1 0 0 0 1 0

0 0 0 1 0 0 0 1 0 0 0 1
For the Rotation Transformation Matrix, R = Ra x Rq:
1 0 0 0 2/2 2/2 0 0 2 / 2 2/2 0 0
0 2 / 2
2/2 0 2 / 2 2 / 2 0 0 1 / 2 1/ 2 2 / 2 0
R
0 2 / 2 2 / 2 0 0 0 1 0 1 / 2 1/ 2 2 / 2 0

0 0 0 1 0 0 0 1 0 0 0 1
b) The displacement (X0, Y0, Z0) is (0, 0, 2) and the following is the Translation
Transformation Matrix (to bring the camera back to the world origin)
1 0 0 X 0 1 0 0 0
0 1 0 Y0 0 1 0 0
T
0 0 1 Z 0 0 0 1 2

0 0 0 1 0 0 0 1
Question 5
c) For the Perspective Transformation Matrix, l=50mm=0.05m
1 0 0 0 1 0 0 0 1 0 0 0
0 1 0 0 0 1 0 0 0 1 0 0
p
0 0 1 0 0 0 1 0 0 0 1 0

0 0 1/ l 1 0 0 1 / 0.05 1 0 0 20 1

d) For the point in the world coordinate (X,Y,Z)= (1/2, 1/2, 2/2)
X 1/ 2
Y 1 / 2
wc
Z 2 / 2

1 1

e) The general formulation of camera coordinate from world coordinates is


c PRTwc
1 0 00 2 / 2 2/2 0 0 1 0 0 0 1/ 2
0
1 0 0 1 / 2 1/ 2 2 / 2 0 0 1 0 0 1 / 2
c
0 0 1 0 1 / 2 1/ 2 2 / 2 0 0 0 1 2 2 / 2

0 0 20 1 0 0 0 1 0 0 0 1 1
Question 5
2 / 2 2 /2 0 0 1 0 0 0 1/ 2

2 / 2 0 0 1 0 0 1 / 2
c
1/ 2 1/ 2
1/ 2 1 / 2 2 / 2 0 0 0 1 2 2 / 2

10 10 10 2 1 0 0 0 1 1
2 / 2 2/2 0 0 1/ 2

1 1/ 2
c
1/ 2 1/ 2 2/2
1/ 2 1 / 2 2 / 2 1 2 / 2

10 10 10 2 19 1
0
0
c
1

19
The coordinates of the object on the image plane:
0
x 0
19
0
y 0
19

Вам также может понравиться