티스토리 뷰

728x90

자료 출처: CS5670

 

 

 

Image alignment

Why don’t these image line up exactly?

 

What is the geometric relationship between these tow images?

Answer: Similarity transformation (translation, rotation, uniform scale)

 

 

Very important for creating mosaics!
First, we need to know what this transformation is.
Second, we need to figure out how to compute it using feature matches.

먼저 이 변환(transformation)이 무엇인지 알아야 하고, 둘째로 feature들끼리 일치하도록 계산하는 방법을 알아야 합니다.

 

 

Image Warping

  • Image filtering: change range of image

$g(x) = h(f(x))$

 

 

  • Image warping: change domain of image

$g(x) = f(h(x))$

 

 

 

  • Examples of parametric warps:
    • translation
    • rotation
    • aspect

 

Parametric (global) warping

  • Transformation T is a coordinate-changing machine:
    • $p’ = T(p)$
  • What does it mean that T is global?
    • Is the same for any point p
    • can be described by just a few numbers (parameters)
  • Let’s consider linear $x$ forms (can be represented by a $2 * 2$ matrix)
    • $p’ = Tp$

 

 

Common linear transformation

  • Uniform scaling by s:

 

What is the inverse?

 

  • Rotation by angle $\theta$ (about the origin)

 

What is the inverse?

 

For rotations: $R^{-1} = R^T$

 

 

2*2 Matrices

What types of transformations can be represented with a 2*2 matrix?

 

2D mirror about Y axis?

$x^\prime = -x$

$y^\prime = y$

 

2D mirror across line y = x?

$x^\prime = y$

$y^\prime = x$

 

2D Translation?

$x^\prime = x + t_x$

$y^\prime = y + t_y$

 

No!

 

Translation is not a linear operation on 2D coordinates.

 

All 2D Linear Transformations

 

  • Linear transformations are combinations of …
    • Scale
    • Rotation
    • Shear
    • Mirror

  • Properties of linear transformations:
    • Origin maps to origin
    • Lines map to lines
    • Parallel lines remain parallel
    • Ratios are preserved
    • Closed under composition

 

Homogeneous coordinates

  • Trick: add one more coordinate:

 

  • homogeneous image coordinates

 

  • Converting from homogeneous coordinates

 

참고 자료: 다크 프로그래머님의 블로그 글

 

Translation

  • Solution: homogeneous coordinates to the rescue

 

 

any transformation represented by a 3x3 matrix with last row [ 0 0 1 ] we call an affine transformation

 

Basic affine transformations

 

  • Translate

 

  • Scale

 

  • 2D in-plane rotation

 

  • Shear

 

Affine transformations

  • Affine transformations are combinations of…
    • Linear transformations, and
    • Translations
  • Properties of affine transformations:
    • Origin does not necessarily map to origin
    • Lines map to lines
    • Parallel lines remain parallel
    • Ratios are preserved
    • Closed under composition

 

Is this an affine transformation?

 

Where do we go from here?

 

 

Projective Transformations aka Homographies aka Planar Perspective Maps

Called a homography (or planar perspective map)

 

 

 

Homographies

What happens when the denominator is 0?

 

 

Point at infinity

 

 

 

Image warping with homographies

 

 

  • Image plane in front
  • black area where no pixel maps to

 

 

Homographies

 

  • Homographies …
    • Affine transformations, and
    • Projective warps
  • Properties of projective transformations:
    • Origin does not necessarily map to origin
    • Lines map to lines
    • Parallel lines do not necessarily remain parallel
    • Ratios are not preserved
    • Closed under composition

 

Alternate formulation for homographies

 

Where the length of the vector [$h_{00}, h_{01}, \dots, h_{22}$] is 1

 

2D image transformations

 

These transformations are a nested set of groups

  • Closed under composition and inverse is a member

 

Implementing image warping

  • Given a coordinate x form $(x^\prime,y^\prime) = T(x,y)$ and a source image $f(x,y)$, how do we compute an x formed image $g(x^\prime,y^\prime) = f(T(x,y))$?

 

Forward Warping

  • Send each pixel $f(x)$ to its corresponding location $(x^\prime,y^\prime) = T(x,y)$in $g(x^\prime,y^\prime)$

What if pixel lands “between” two pixels?

 

  • Send each pixel $f(x,y)$ to its corresponding location $x^\prime = h(x,y)$ in $g(x^\prime, y^\prime)$

What if pixel lands “between” two pixels?

Answer: add “contribution” to several pixels, normalize later (splatting)

  • Can still result in holes

 

 

Inverse warping

  • Get each pixel $g(x^\prime,y^\prime)$ from its corresponding location $(x, y) = T^{-1}(x,y)$ in $f(x,y)$
  • Requires taking the inverse of the transform
  • What if pixel comes from “between” two pixels?

 

  • Get each pixel $g(x^\prime)$ from its corresponding location $x^\prime = h(x)$ in $f(x)$

What if pixel comes from “between” two pixels?

Answer: resample color value from interpolated(pre-filtered) source image

 

 

Interpolation

  • Possible interpolation filters:
    • nearest neighbor
    • bilinear
    • bicubic
    • sinc
  • Needed to prevent “jaggies” and “texture crawl” (with pre-filtering)

 

728x90
댓글