[CV] Example: Essential Matrix and Epipolar Line

2024. 7. 16. 00:54·Programming/DIP
728x90
728x90

Essential Matrix와 Epiline 구하기

Essential Matrix $ \mathbf{E} $는
두 카메라의 normalized image plane에서의 대응점들(correspondance) 사이의 기하학적 관계를 나타냄.

 

Essential Matrix를 통해

  • camera calibration이 수행된 normalized image plane의 점 $ \mathbf{p}_1 $에 대해
    두 번째 카메라의 epiline $ \mathbf{l}' $을 구할 수 있음.

2024.06.28 - [Programming/DIP] - [CV] Epipolar Geometry [작성중]

 

[CV] Epipolar Geometry [작성중]

epipolar geometry는두 개의 카메라 images에서대응하는 점들 사이의 기하학적 관계를 설명하는 데 사용되는 용어Epipolar geometry는 각 카메라 image 상의 각 점이 epipolar line을 통해 어떻게 연결되었는지를

dsaint31.tistory.com

2024.07.16 - [Programming/DIP] - [CV] Example: Fundamental Matrix and Epipolar Line (등극선)

 

[CV] Example: Fundamental Matrix and Epipolar Line (등극선)

Fundamental Matrix와 Epipolar LineFundamental matrix $\mathbf{F}$ 는 두 카메라의 이미지 평면 상에서 correspondance 사이의 기하학적 관계를 나타내는 행렬임.두 카메라 간의 extrinsic parameter에 의해 결정됨.intrinsic

dsaint31.tistory.com

 


기본 개념

  • Essential Matrix $ \mathbf{E} $:
    • 두 카메라 간의 Rotation (회전) $ \mathbf{R} $과
    • Translation (평행 이동) $ \mathbf{t} $를 포함함.
  • Epiline:
    • stereo camera에서 한 카메라의 이미지 점에 대응하는 다른 카메라의 이미지 상의 직선.

수식

주어진 첫 번째 카메라의 normalized image plane 상의 점 $ \mathbf{p}_1 $에 대해 두 번째 카메라의 epiline $ \mathbf{l}' $은 다음과 같이 계산됨:

$$
\mathbf{l}' = \mathbf{E} \mathbf{p}_1
$$

여기서:

  • $ \mathbf{E} $는 Essential Matrix.
  • $ \mathbf{p}_1 $은 첫 번째 카메라의 normalized image plane 상의 점.

 


예제

주어진 값

  • Essential Matrix $ \mathbf{E} $:

$$
\mathbf{E} = \begin{bmatrix}
0 & -1 & 0 \\
1 & 0 & -0.5 \\
0 & 0.5 & 1
\end{bmatrix}
$$

  • 첫 번째 카메라의 점 $ \mathbf{p}_1 $:

$$
\mathbf{p}_1 = \begin{bmatrix}
0.2 \\
0.3 \\
1
\end{bmatrix}
$$


계산

두 번째 카메라의 normalized image plane상의 epiline $ \mathbf{l}' $을 계산하기 위해, 주어진 값을 위의 수식에 대입함:

$$
\mathbf{l}' = \mathbf{E} \mathbf{p}_1 = \begin{bmatrix}
0 & -1 & 0 \\
1 & 0 & -0.5 \\
0 & 0.5 & 1
\end{bmatrix} \begin{bmatrix}
0.2 \\
0.3 \\
1
\end{bmatrix}
$$

행렬 곱셈을 수행하면:

$$
\mathbf{l}' = \begin{bmatrix}
-0.3 \\
0.2 - 0.5 \\
0.5 \cdot 0.3 + 1
\end{bmatrix} = \begin{bmatrix}
-0.3 \\
-0.3 \\
1.15
\end{bmatrix}
$$

따라서 두 번째 카메라의 normalized image plane 상에서의 epiline $ \mathbf{l}' $은 다음과 같음:

$$
-0.3x - 0.3y + 1.15 = 0
$$


Python 코드

다음은 Python을 사용하여 동일한 계산을 수행하고 epiline을 시각화하는 코드임:

import numpy as np
import matplotlib.pyplot as plt

# Essential Matrix
E = np.array([[0, -1, 0],
              [1, 0, -0.5],
              [0, 0.5, 1]])

# Point in the first normalized image plane
p1 = np.array([0.2, 0.3, 1])

# Calculate the epiline in the second image plane
l_prime = np.dot(E, p1)

# Define the range of x values for plotting
x = np.linspace(-1, 1, 100)
# Calculate the corresponding y values
y = -(l_prime[0] * x + l_prime[2]) / l_prime[1]

# Plot the epiline
plt.plot(x, y, '-r', label='Epiline')
plt.xlabel('x')
plt.ylabel('y')
plt.title('Epiline in the Second Image')
plt.legend()
plt.grid()
plt.show()
728x90

'Programming > DIP' 카테고리의 다른 글

[CV] 8-point algorithm: Fundamental Matrix  (0) 2024.07.17
[CV] Stereo Calibration or Stereo Camera Calibration  (0) 2024.07.16
[CV] Example: Fundamental Matrix and Epipolar Line (등극선)  (1) 2024.07.16
[CV] Pose: Position + Orientation (+Boundary)  (0) 2024.07.09
[CV] Intrinsic Rotation and Extrinsic Rotation (Euler-Angle)  (0) 2024.07.07
'Programming/DIP' 카테고리의 다른 글
  • [CV] 8-point algorithm: Fundamental Matrix
  • [CV] Stereo Calibration or Stereo Camera Calibration
  • [CV] Example: Fundamental Matrix and Epipolar Line (등극선)
  • [CV] Pose: Position + Orientation (+Boundary)
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (787)
      • Private Life (15)
      • Programming (206)
        • DIP (116)
        • ML (35)
      • Computer (120)
        • CE (54)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (368)
        • Signals and Systems (115)
        • Math (176)
        • Linear Algebra (33)
        • Physics (43)
        • 인성세미나 (1)
      • 정리필요. (61)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (7)
        • PET Study 2009 (1)
        • 방사선 장해방호 (5)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

    • Test
    • PET Study 2009
    • 기타 방사능관련.
  • 인기 글

  • 태그

    linear algebra
    function
    math
    opencv
    Probability
    cv2
    random
    Programming
    SS
    signals_and_systems
    Python
    fourier transform
    ML
    SIGNAL
    Vector
    Term
    numpy
    인허가제도
    Optimization
    signal_and_system
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[CV] Example: Essential Matrix and Epipolar Line
상단으로

티스토리툴바