[CV] Stereo Vision: Stereo Matching, Triangulation, Depth Map

2024. 6. 29. 16:30·Programming/DIP
728x90
728x90

CV와 DIP에서 Stereo Vision은 

  • 같은 대상에 대해, 
  • 서로 다른 view point에서 촬영된 두 image(보통 좌우 두개의 카메라로 구성되는 binocular stereo pair image)를 사용하여 
  • 3D 정보(주로 depth map)를 추출하는 기술을 가르킴.

Stereo Matching은

  • Stereo Vision의 sub-step(하위과정)으로,
  • binocular stereo pair images에서 동일한 장면에 대해
  • corresponding points(or correspondances)를 얻는 것임.
  • 즉, 각 image에서 key points(특정점)를 추출하고, 이들 간의 matching을 수행하는 것을 가르킴: 즉 correspondances를 얻어냄. 

Depth Map을 얻기 위해서는

  1. 서로 다른 view point(시점)에서 촬영된 binocular stereo pair images 중 
  2. 하나를 reference삼고 다른 하나는 target으로 삼은 후, 
  3. reference의 key points(특정점)에 대응하는 점(동일한 대상에 해당하는 점)을 target에서 찾는 matching을 수행하고, 
  4. 얻어진 correspondances를 통해, 
  5. stereo vision에서의 disparity를 계산하고 이를 통해 depth information 얻어낸다.

5번 단계를 가르켜 triangulation(삼각 측량)이라고 지칭함

우측의 Depth Map은 반비례하는 Disparity map 으로도 교체 가능함.

 

결국,

Stereo Vision은 3차원 정보를 추출하기 위한 전체적인 과정(기술)을 가리키며,

Stereo Matching은 Stereo Vision을 구현하기 위한 필수적인 하위 단계(sub-step)로 볼 수 있음.

Disparity Map을 구하기 위해 필요한 correspondances (or corresponding key points)를 구하는 것이 Stereo Matching임.


Stereo Vision의 과정

Stereo Vision은 다음과 같은 과정으로 이루어짐.

  1. Image Acquisition:
    • 좌우 두 개의 카메라를 사용하여 동일한 장면을 촬영하여 약간의 시차(slight disparity)가 있는 두 이미지를 얻는 것임.
    • 얻어진 image 쌍을 Binocular stereo pair (or stereo image pair)라고 부름.
  2. Feature Extraction:
    • 두 이미지에서 key points(특징점)을 추출하여 corresponding points(대응되는 점)을 찾아냄.
    • 이러한 key points(or features)은 주로 코너, 에지, 텍스처 등이 될 수 있음.
    • 참고로, key points를 사용하는 방식은 Stereo Mathcing의 방법 중에서 Local Matching에 해당하는데, 오늘날 Local Matching에서는 key points에 기반한 feature based matching이 많이 사용되지 않는다(old-fashion).
      • Local Matching이 사용되는 경우 주로 area-base matching 이 사용되는 추세.
      • 하지만, local matching이 아닌 global matching 방식이 좀더 fancy한 방법으로 받아들여지는 경우가 많고,
      • 최근엔 deep learning기반의 방식이 대세를 이루고 있음.
    • 하지만 보다 쉬운 이해를 이해 여기서는 feature based mathcing으로 설명한다. 
  3. Stereo Matching:
    • 좌우 이미지에서 corresponding features (=correspondances)을 추출
    • 각 feature의 위치와 주변 패턴 (kernel or epiline)을 비교하여 최적의 matching을 찾는 것임.
    • 이 과정은 "cost function"를 minimization하는 방식으로 수행됨: cost function은 dissimilarity를 측정.
      • 더보기
        다음은 opencv에서 template mathcing시 사용하는 metrics를 설명하고 있는 url임.
        https://dsaint31.me/mkdocs_site/DIP/cv2/ch02/dip_template_matching/#the-matching-methods-available-in-opencv

        similarity와 distance에 대한 소개글
        https://dsaint31.me/mkdocs_site/ML/ch00/ch00_31_instance_based_learning/#similarity-distance

        두개의 image간의 difference 혹은 similarity에 관련된 metrics를 설명하는 url임.
        https://dsaint31.me/mkdocs_site/DIP/cv2/etc/dip_metrics/

        -------------------------
  4. Depth Calculation (or Triangulation):
    1. Matched feature pairs를 기반으로 두 점 사이의 disparity b/w the points(시차)를 계산하고,
    2. 이를 이용하여 depth map를 estimation.
    3. disparity(시차)와 두 카메라 간의 알려진 거리를 사용하여 depth를 계산함 (Triangulation, 삼각측정).

Depth Calculation (or Triangulation)

다음 그림은 binocular stereo pair를 통해 depth를 계산하는 간단한 예임.

더보기

실제로 Triangulation은 아래의 가정의 경우보다는 epipolar geometry를 기반으로 다양한 fitting으로 구해짐.

대표적인 예가 linear triangulation이며 이는 다음을 참고할 것.

2024.06.30 - [Programming/DIP] - [CV] Triangulation : Linear Triangulation [작성중]

 

[CV] Triangulation : Linear Triangulation [작성중]

Triangulation : Linear TriangulationTriangulation 은2개의 image plane 사이의 기하학적 관계가 주어진 경우(←이는 Essential Matrix $E$ 또는 Fundamental Matrix $F$가 주어짐),이 2개의 image plane상의 stereo pair($\mathbf{u}_\

dsaint31.tistory.com


단, binocular stereo pair에서 x축이 서로 평행하다고 가정함 (stereo rectification이 수행된 이후를 의미).

  • $x_L$, $x_R$ : 좌우 카메라의 이미지에서 $P$에 대응하는 점의 x 좌표.
  • $o_L$, $o_R$ : 좌우 카메라 optical center.
  • $B$ : baseline의 거리.
  • $f$ : 좌우카메라의 focal length. (같다고 가정함)

depth calculation

간단히 애기하면, correspondance에서 diparity가 클수록 z가 작음! (Disparity is inversely proportional to depth)

 

다음과 같이 설명하는 경우도 있으니 참고할 것.

2024.07.04 - [Programming/DIP] - [CV] Triangulation: Simple Version

 

[CV] Triangulation: Simple Version

Triangulation: Simple VersionSimple Triangulation을 위해선 다음의 가정이 성립되어야 함.두 카메라는 동일한 focal length (초점거리) $f$ 를 가지며,동일한 평면 상에 virtual image plane을 가지며 (rectification을 수

dsaint31.tistory.com


주요 응용분야 및 알고리즘

Stereo Vision에서 핵심은 바로 Stereo Matching이기 때문에 주요 응용분야 및 알고리즘이 거의 비슷하게 제시된다.

 

Stereo Vision과 Stereo Matcing은 다음의 다양한 응용 분야에서 3D 정보(depth map)를 얻기 위해 사용됨. 

  • 자율 주행,
  • 로봇 공학,
  • 증강 현실(AR) 등등

대표적인 알고리즘 (거의 disparity를 추출하는 알고리즘)으로는

  • Block Matching,
  • Semi-Global Matching (SGM) ***,
  • Graph Cuts 등이 있으며,
  • 최근에는 딥러닝 기반의 방법도 많이 연구되고 있음.
더보기

Block Matching은 Local Matching에 속하고,
SGM와 Graph Cuts는 Global Matching에 속함.


Benchmark Dataset for Stereo Vision Algorithms

KITTI 와 Middleburry 자료가 많이 사용됨.

다음 URLs를 참고.

https://vision.middlebury.edu/stereo/

 

vision.middlebury.edu/stereo

Daniel Scharstein • Richard Szeliski • Heiko Hirschmüller Welcome to the Middlebury Stereo Vision Page. This website accompanies our taxonomy and comparison of two-frame stereo correspondence algorithms [1], extending our initial paper with Ramin Zabi

vision.middlebury.edu

https://www.cvlibs.net/datasets/kitti/

 

The KITTI Vision Benchmark Suite

We thank Karlsruhe Institute of Technology (KIT) and Toyota Technological Institute at Chicago (TTI-C) for funding this project and Jan Cech (CTU) and Pablo Fernandez Alcantarilla (UoA) for providing initial results. We further thank our 3D object labeling

www.cvlibs.net


같이보면 좋은 자료들

https://lueseypid.tistory.com/113

 

스테레오 영상

스테레오 영상인간의 시각체계를 모방해 두 대 이상의 카메라를 사용하여 3차원 영상과 정보를 추출하는 기법 두대의 카메라를 사용하여 스테레오 시스템을 만드는 단계1. 렌즈의 방사왜곡과

lueseypid.tistory.com

https://docs.opencv.org/4.x/dd/d53/tutorial_py_depthmap.html

 

OpenCV: Depth Map from Stereo Images

Goal In this session, We will learn to create a depth map from stereo images. Basics In the last session, we saw basic concepts like epipolar constraints and other related terms. We also saw that if we have two images of same scene, we can get depth inform

docs.opencv.org

 


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

[CV] Triangulation: Simple Version  (1) 2024.07.04
[CV] Triangulation : Linear Triangulation [작성중]  (1) 2024.06.30
[CV] Coordinate Systems  (0) 2024.06.29
[CV] Epipolar Geometry [작성중]  (0) 2024.06.28
[CV] Two View Geometry  (0) 2024.06.28
'Programming/DIP' 카테고리의 다른 글
  • [CV] Triangulation: Simple Version
  • [CV] Triangulation : Linear Triangulation [작성중]
  • [CV] Coordinate Systems
  • [CV] Epipolar Geometry [작성중]
dsaint31x
dsaint31x
    반응형
    250x250
  • dsaint31x
    Dsaint31's blog
    dsaint31x
  • 전체
    오늘
    어제
    • 분류 전체보기 (742)
      • Private Life (13)
      • Programming (188)
        • DIP (106)
        • ML (26)
      • Computer (119)
        • CE (53)
        • ETC (33)
        • CUDA (3)
        • Blog, Markdown, Latex (4)
        • Linux (9)
      • ... (351)
        • Signals and Systems (103)
        • Math (172)
        • Linear Algebra (33)
        • Physics (42)
        • 인성세미나 (1)
      • 정리필요. (54)
        • 의료기기의 이해 (6)
        • PET, MRI and so on. (1)
        • PET Study 2009 (1)
        • 방사선 장해방호 (4)
        • 방사선 생물학 (3)
        • 방사선 계측 (9)
        • 기타 방사능관련 (3)
        • 고시 (9)
        • 정리 (18)
      • RI (0)
      • 원자력,방사능 관련법 (2)
  • 블로그 메뉴

    • Math
    • Programming
    • SS
    • DIP
  • 링크

    • Convex Optimization For All
  • 공지사항

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

  • 태그

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

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
dsaint31x
[CV] Stereo Vision: Stereo Matching, Triangulation, Depth Map
상단으로

티스토리툴바