-
Homogeneous coordinate영상처리/3D computer vision 2023. 2. 2. 21:07728x90
computer vision을 공부하면 제일 먼저 만나는 건, 역시나 pinhole camera 모델이다.
그 pinhole camera 모델을 공부하려면 이제 homogeneous coordinate로 시작하게 된다.
하지만 생각보다 정의가 명확하지 않아, 공부를 시작하다보면 여기서 좀 막히는 경향이 있다...
(그러려니 라고 생각하면 별 문제는 없다.)
Homogeneous coordinate
https://en.wikipedia.org/wiki/Homogeneous_coordinates
Homogeneous coordinates - Wikipedia
From Wikipedia, the free encyclopedia Coordinate system used in projective geometry Rational Bézier curve – polynomial curve defined in homogeneous coordinates (blue) and its projection on plane – rational curve (red) In mathematics, homogeneous coord
en.wikipedia.org
Homogeneous coordinate는 projective geometry에 사용되는 좌표계이다.
더보기In mathematics, homogeneous coordinates or projective coordinates, introduced by August Ferdinand Möbius in his 1827 work Der barycentrische Calcul,[1][2][3] are a system of coordinates used in projective geometry, just as Cartesian coordinates are used in Euclidean geometry.
(x,y)에 1을 추가해서 (x,y,1)을 만들면 homogeneous coordinate라고 되어있는 글이 많은데... 반은 맞고 반은 틀린듯하다.
더보기- Any point in the projective plane is represented by a triple (X, Y, Z), called homogeneous coordinates or projective coordinates of the point, where X, Y and Z are not all 0.
- The point represented by a given set of homogeneous coordinates is unchanged if the coordinates are multiplied by a common factor.
- Conversely, two sets of homogeneous coordinates represent the same point if and only if one is obtained from the other by multiplying all the coordinates by the same non-zero constant.
- When Z is not 0 the point represented is the point (X/Z, Y/Z) in the Euclidean plane.
- When Z is 0 the point represented is a point at infinity.
위의 내용을 나름 이해해보면, 원점으로부터 공간상의 x,y,z를 지나는 직선을 정의하면, 이 선 위에 있는 모든 점들은 homogeneous coordinates라고 할 수 있다. 이 점들은 projective plane위에 동일한 점으로 projection 되게 된다. (그래서 homogeneous coordinate, 한글로는 동차 좌표 라고 부른다. 즉, projection해보면 동일한 점 의 집합)
homogeneous coordinate란, 동일한 점으로 projection되는 점들의 집합이다. 실질적으로, 공간상의 점 (x,y,z)에 대해서 무한히 많은 homogeneous coordinate (λx, λy, λz)들이 발생하지만, 이 중 computer vision에 중요한 점은 위에 표현된 (fx/z, fy/z, f) 와 (x/z, y/z, 1) 이다.
pinhole camera model
공간상의 점 x,y,z는 카메라의 image plane으로 projection 된다.
이때의 좌표는 (fx/z, fy/z, f)가 된다. 여기서 f는 카메라의 초점거리가 된다. (distortion이 있다면 여기서 벗어나게 되지만..) (https://courses.cs.duke.edu//fall16/compsci527/notes/camera-model.pdf)
이렇게 pin hole(원점)을 기준으로 image plane에 projection 되는 카메라 모델이 바로 pinhole 카메라 모델이다.
Homogeneous coordinate for affine transformation
affine transformation이란, 선형 변환의 한 종류로, image 상의 point들을 변환할때 사용하게 된다. 이러한 변환은 translation을 포함하게 되며, 이를 수학적으로 표현하기 위해 homogeneous coordinate 중, (x/z, y/z, 1)를 사용하게 된다.
Homogeneous coordinate는 computer graphics와 3D computer vision에서 transformations을 matrix로 쉽게 표현하도록 해준다. (다시 말하면, 연산을 쉽게 표현하게 하는 의미이다.)
더보기Homogeneous coordinates have a range of applications, including computer graphics and 3D computer vision, where they allow affine transformations and, in general, projective transformations to be easily represented by a matrix.
여기까지 공부한 바를 정리하자면
1. homogeneous coordinate
: 어떤 point (x,y,z)의 상수배 로 표현되는 점들의 집합 = 원점을 지나는 동일 직선에 존재하는 점들의 집합.
2. homogeneous coordinate 세트는 projective plane으로 projection 하면 모두 동일한 점이 된다.
3. pinhole camera model에서 공간상의 (x,y,z)가 image plane상의 (fx/z, fy/z,f)로 projection된다.
4. homogeneous coordinate 중 (x/z, y/z, 1)은 transformation을 쉽게 표현하기 위해 활용된다.
나와 같은 의문을 가진 사람의 포스팅을 발견하여 추가한다.
여기서도 마찬가지.. homogeneous coordinate의 수학적 정의와 개발자들이 흔히 쓰는 [x,y,1] 사이의 정의의 차이에 대해 의문을 던진다.
해당 포스팅에서 말하듯, 1로 표현된 (z로 나누어진) homogeneous coordinate는 normalized form이라고 따로 부르는 것이 맞는것 같다.
http://deltaorange.com/2012/03/08/the-truth-behind-homogenous-coordinates/
The Truth Behind Homogeneous Coordinates
Share this:
deltaorange.com
728x90'영상처리 > 3D computer vision' 카테고리의 다른 글
pyflow optical flow (0) 2023.11.01 RAFT: Recurrent All-Pairs Field Transforms for Optical Flow 돌려보기 (0) 2023.10.30 Dense Optical Flow algorithm 비교 (open cv) (2) 2023.10.15 Epipolar geometry (0) 2023.02.12 CNN 기반 camera pose estimation의 한계 (0) 2023.02.02