티스토리 뷰
자료 출처: 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
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)
'AI > Computer Vision' 카테고리의 다른 글
[CS5670] Lecture 10: Cameras (1) pinhole, lens camera (0) | 2022.07.18 |
---|---|
[보충] Affine transformations and Homography (0) | 2022.07.14 |
[CS5670] Lecture 6: Feature Descriptors and Feature Matching (0) | 2022.06.23 |
[CS5670] Lecture 5: Feature Invariance (0) | 2022.06.23 |
Aliasing(엘리어싱) - 발생 이유, 결과, 방지 방법 (0) | 2022.06.01 |
- Total
- Today
- Yesterday
- 구글드라이브연동
- 프롬프트
- prompt learning
- 파이썬
- docker
- cs231n
- 데이터셋다운로드
- 도커 컨테이너
- style transfer
- Prompt
- NLP
- 구글드라이브다운
- 구글드라이브서버연동
- 서버에다운
- 구글드라이브서버다운
- Unsupervised learning
- few-shot learning
- clip
- 도커
- 서버구글드라이브연동
- vscode 자동 저장
- 퓨샷러닝
- stylegan
- support set
- CNN
- 파이썬 클래스 다형성
- 파이썬 클래스 계층 구조
- 딥러닝
- python
- 파이썬 딕셔너리
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |