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을 얻기 위해서는
- 서로 다른 view point(시점)에서 촬영된 binocular stereo pair images 중
- 하나를 reference삼고 다른 하나는 target으로 삼은 후,
- reference의 key points(특정점)에 대응하는 점(동일한 대상에 해당하는 점)을 target에서 찾는 matching을 수행하고,
- 얻어진 correspondances를 통해,
- stereo vision에서의 disparity를 계산하고 이를 통해 depth information 얻어낸다.
5번 단계를 가르켜 triangulation(삼각 측량)이라고 지칭함

결국,
Stereo Vision은 3차원 정보를 추출하기 위한 전체적인 과정(기술)을 가리키며,
Stereo Matching은 Stereo Vision을 구현하기 위한 필수적인 하위 단계(sub-step)로 볼 수 있음.
Disparity Map을 구하기 위해 필요한 correspondances (or corresponding key points)를 구하는 것이 Stereo Matching임.
Stereo Vision의 과정
Stereo Vision은 다음과 같은 과정으로 이루어짐.
- Image Acquisition:
- 좌우 두 개의 카메라를 사용하여 동일한 장면을 촬영하여 약간의 시차(slight disparity)가 있는 두 이미지를 얻는 것임.
- 얻어진 image 쌍을 Binocular stereo pair (or stereo image pair)라고 부름.
- 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으로 설명한다.
- 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/
-------------------------
-
- Depth Calculation (or Triangulation):
- Matched feature pairs를 기반으로 두 점 사이의 disparity b/w the points(시차)를 계산하고,
- 이를 이용하여 depth map를 estimation.
- 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이 수행된 이후를 의미).
- xL, xR : 좌우 카메라의 이미지에서 P에 대응하는 점의 x 좌표.
- oL, oR : 좌우 카메라 optical center.
- B : baseline의 거리.
- f : 좌우카메라의 focal length. (같다고 가정함)

간단히 애기하면, 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 |