[CV] 8-2. Image Alignment and Warping

실버버드·2025년 10월 23일

Computer Vision

목록 보기
7/14

8-2. Image Alignment and Warping

warping: 뒤틀림

1. Image Alignment and Warping

Image Alignment
we will fit the parameters of some transformation according to a set of matching feature pairs (“correspondences”)

  • Two broad approaches
  1. Direct (pixel-based) alignment: Search for alignment where most pixels agree
  2. Feature-based alignment: Search for alignment where extracted features agree (Can be verified using pixel-based alignment)

Alignment: Given two images, what is the transformation between them?
Warping: Given a source image and a transformation, what does the transformed output look like?

Gloabl Warping/Transformation

2. 2x2 Transformation

Scaling
a coordinate means multiplying each of its components by a scalar
Uniform scaling: this scalar is the same for all components, x2
Non-uniform scaling: different scalars per component, Xx2 Yx0.5

  • Scaling operation:
    x' = ax
    y' = by
    in matrix form:
    [x'y'] = [a00b][xy]
    scaling matrix S

Rotation

Shear
절단
x' = x + ay
y' = bx + y
in matrix form:
[x'y'][1ab1][xy]

2x2 Image Transformation

• Origin maps to the origin
• Lines map to lines
• Parallel lines remain parallel
• Closed under composition

Translation
x' = x + t_x
y' = y + t_y
matrix representation Impossible! -> 3x3

3. 3x3 Transformation

Homogeneous Coordinates
동차 좌표: n차원 좌표에 한 차원을 덧붙여 표시

Translation

Basic 2D Transformation

Affine Transformation
방향 크기뿐만 아니라 위치도 포함하는 변환

2x2와 다른 점: Origin does not necessarily map to the origin

4. Determining Unknown Transformations

p^=argminpif(xi;p)xi2\displaystyle \hat{p} = arg min_p\sum_i||f(x_i;p) - x'_i||^2

vectorize transformation parameters?

미분해서 0되는 값 x

5. RANSAC (RANdom SAmple Consensus)

outlier에 민감하지 않게 하는 방법
Outlier
• An erroneous pair of matching points from two images
• An edge point is noise, or doesn’t belong to the line we are fitting

RANSAC (RANdom SAmple Consensus)
approach: avoid the impact of outliers, look for inliers
intuition: outlier로 계산할 때 결과 line이 나머지 points의 support를 받지 못한다

  • Algorithm:
  1. Sample (randomly) the number of points required to fit the model
  2. Solve for model parameters using samples
  3. Score by the fraction of inliers within a preset threshold of the model
    • Repeat 1-3 until the best model is found with high confidence
    점 뽑고 선 만들고 이 선을 따르는 나머지 점들의 수를 점수 매긴다(얼마나 support하는지)

사진으로 설명

1 correspondence 뽑음, 나머지 점들을 이 식으로 계산해 잘 짝지어진 inlier 개수를 셈

더 많아서 이 모델을 뽑음

Estimating Affine Transformation using RANSAC

  • RANSAC loop
  1. Get three point correspondences (randomly)
  2. Compute M which minimizes ELLSE_{LLS}
  3. Count inliers
  4. Keep M if largest number of inliers
    • Recompute M using all inliers

Pros and Cons of RANSAC
Pros
• Simple and general
• Applicable to many different problems
• Often works well in practice
Cons
• Lots of parameters to tune
• Doesn’t work well for low inlier ratios (too many iterations, or can fail completely)
• Can’t always get a good initialization of the model based on the minimum number of samples

0개의 댓글