Docsity

Computer Vision: Estimating 2D Transformations and Affine Transformation, Schemes and Mind Maps of Engineering

Partial preview of the text

Download Computer Vision: Estimating 2D Transformations and Affine Transformation and more Schemes and Mind Maps Engineering in PDF only on Docsity!

CS436/CS5310/EE

Computer Vision Fundamentals

Murtaza Taj

[email protected]

Lecture 09: Estimating 2D Transformations

Mon 03th^ Oct 2022

Hierarchy of 2D Transformations

Length Ratios
Length Ratios
Length Cross-Ratios

Cross Ratio ! (^) (A, B; C, D) = AC/BC : AD/BD ! (^) Or equivalently: ! (^) Points A, B, C, D and A', B', C', D' are related by a projective transformation so their cross ratios, (A, B; C, D) and (A', B'; C', D') are equal. ! (^) If one of the four points is the line's point at infinity, then the two distances involving that point are dropped from the formula ! (^) Order of points is important ! (^) Line direction is important (i.e. BA is considered as –ve of AB)

Wikipedia

Cross Ratio

Wikipedia

Projective Group (Homography)

! 3 x 3 transform defined in

Homogeneous coordinates

! Simulates out of plane rotations

! Preserves straight lines

! Physical Interpretation:

Plane + Camera

Without loss of generality, set z 1 = 1

■ Given two images with unknown transformation between them…

■ Compute the values for [ a

1 …^ a 6 ] – Affine parameters

Next: Recovering Best Affine Transformation

Recovering Best Affine Transformation

! Input: we are given some correspondences

! Output: Compute a1 – a6 which relate the images

! This is an optimization problem… Find the ‘best’ set of parameters,

given the input data

Parameter Optimization: Least Squared Error Solutions

! Let us first consider the ‘simpler’ problem of fitting a line to

a set of data points…

! Equation of best fit line?

x y

Line Fitting: Least Squared Error Solution = (^) ∑ ( + − ) i i i

E mx c y

2 ( ) ( ) 0

∑ ∑ i i i i i i i

mx c y

c

E

mx c y x

m

E

∑ ∑ ∑ ∑ ∑ ∑ i i i i i i i i i i i i

y

x y

c

m

x

x x

2

x y
m
c
Solution: m = 1.9274 c = 3.

Line Fitting: Least Squared Error Solution

Recovering Best Affine Transformation

! Input: Set of correspondences

! Image 1: ( x

i

, y

i

) Image 2: ( x

i

ʹ, y

i

Recovering Best Affine Transformation

! Least Squares Error Solution

! Is the solution (i.e. set of parameters a 1 … a 6 ) such that the sum of

the square of error in each corresponding point is as minimum as

possible

! No other set of parameters exists that may have a lower error (in

the squared error sense)

! Beauty of the solution is that I don’t have to try all the solutions, I

have a closed form solution.

Least Squares Error Solution ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ = ⎥ ⎥ ⎥ ⎦ ⎤ ⎢ ⎢ ⎢ ⎣ ⎡ 1 0 0 1 1 4 5 6 1 2 3

j j j j y x a a a a a a y x ∑ = = − + − n j j j j j E a a a a a a x x y y 1

  • ' 2 * ' 2 1 2 3 4 5 6 ( , , , , , ) ( ) ( ) ∑^ (^ ) = = + + − + + + − n j j j j j j j E a x a y a x a x a y a y 1 ' 2 4 5 6 ' 2 1 2 3 ( a ) ( ) ( ) ( ) ' ' xj , yj ( )

xj , yj

Least Squares Error Solution

! Minimize E w.r.t. a

! Compute , put equal to zero, solve simultaneously

n j j j j j j j

E a x a y a x a x a y a y

( a ) ( ) ( )

j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j j y y y x y x y x x x a a a a a a x y x y y y x x y x x y x y y y x x y x ' ' ' ' ' ' 6 5 4 3 2 1 2 2 2 2 0 0 0 1

a i E ∂ ∂