Creating a Disparity Map of Two Images from a Smartphone Camera
Final Project Presentation
Bryan Heryanto
Spring 2023
Final Presentation
Disparity
2
Spring 2023
depth
“The disparity is the distance between a pixel and its horizontal match in the other image.” Akhavan et al. (2013, 2014)
To calculate disparity we need rectified image
problem: not every smartphone have
stereo camera
This research focus on using translation of mono camera
Final Presentation
Overview and few things that is used in Project
Feature Matching – ORB (Oriented Fast and Rotated BRIEF)
Calculate Fundamental – (8 point algorithm with RANSAC (implemented myself) and opencv 7 point algorithm ransac)
Stereo Rectify (Hartley (my implementation, OpenCV))
Stereo Matching - (SSD (myself) , SAD (OpenCV BFMatch and SGBM), HitNet
3
Spring 2023
Final Presentation
Added and Deprecated Plan
Take 2 Picture of Objects using any camera
Either Manually or with SIFT based library (Changed
to ORB)
Using 8 point algorithm (Calibrate the camera for finding Essential)
Feature Matching
Calculate Fundamental and/or Essential
Using Hartley & Zisserman method or Trucco & VIeri method
Doing stereo rectification
Find Disparity
Using Matching Transformation
with several cost (Changed
to with SSD, SAD , SGBM and HITNet (Data-Driven Approach))
4
Spring 2023
Final Presentation
About Implementation of SSD
5
my result for middleburry dataset:
Solution: Change to stereoBM
OpenCv implementation
Spring 2023
Final Presentation
SGBM (Semi- Global Block Matching)
6
H. Hirschmuller, "Stereo Processing by Semiglobal Matching and Mutual Information," in IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 30, no. 2, pp. 328-341, Feb. 2008, doi: 10.1109/TPAMI.2007.1166.
Spring 2023
Final Presentation
Before SBGM (Energy Minimization)
The pixelwise cost and the smoothness constraints are expressed by defining the energy E(D) that depends on the disparity image D
7
The first term is the sum of all pixel matching costs
The second term adds a constant penalty P1 for all pixels q in the neighborhood Np of p , for which the disparity changes a little bit (that is, 1 pixel)
The third term adds a larger constant penalty P2, for all larger disparity changes
PROBLEM : NP-COMPLETE
Spring 2023
Final Presentation
Before SBGM (Scan-Line Aprroach)
8
Using DP it can be solved in polynomial time but it easily suffer from streaking
cause of problem : very strong constraints in one direction along image rows and it is combined with none or much weaker constraints in the other direction along image columns.
Spring 2023
Final Presentation
SBGM
9
each cell run by path(number of direction) number of times
Idea of aggregating matching cost of 1D from all direction equally
Spring 2023
Final Presentation
SGBM VS OpenCV (From OpenCV docs)
10
Spring 2023
Final Presentation
HITNet: Hierarchical Iterative Tile Refinement Network for Real-time Stereo Matching (2022)
11
Spring 2023
Final Presentation
HITNet (Feature Extraction)
12
Spring 2023
Final Presentation
HITNet (Initialization)
13
matching cost:
Initial Disparity:
Tile Hypotheses:
Feature Descriptor:
Spring 2023
Final Presentation
HITNet (Propagation) –Warping
14
The warping step computes matching costs between the feature maps eiL l and eiR at every feature resolution associated to the tiles.
Spring 2023
Final Presentation
HITNet (Propagation) – Tile Update Prediction
augment the tile hypothesis with the matching costs φ from the warping step for refining the result of hypothesis
15
Spring 2023
Final Presentation
Test Image
16
Spring 2023
Final Presentation
1st Pipeline
ORB (Oriented Fast and BRIEF) – 8 point algorithm with RANSAC (implemented myself)- Hartley Stereo Matching(implemented myself)- BFMatching
17
Spring 2023
Final Presentation
What is Wrong?
18
Spring 2023
Final Presentation
2nd Pipeline (Feature Matching Fix)
ORB (Oriented Fast and BRIEF) with FLANN Matching – 8 point algorithm with RANSAC (implemented myself)- Hartley Stereo Matching(implemented myself)- BFMatching
19
attempt 1
attempt 2
Spring 2023
Final Presentation
2nd Pipeline Result
20
Spring 2023
Final Presentation
3rd Pipeline
ORB (Oriented Fast and BRIEF) – 8 point algorithm with Ransac (implemented myself)- Hartley Stereo Matching(implemented myself)- SGBMMatching
21
Spring 2023
Final Presentation
4th Pipeline
ORB (Oriented Fast and BRIEF) – 8 point algorithm with Ransac (implemented myself)- Hartley Stereo Matching(implemented by openCV)- SGBMMatching
22
No Big Effect because same Algorithm
Spring 2023
Final Presentation
5th Pipeline Moving on to OpenCV
ORB (Oriented Fast and BRIEF) – 7 point algorithm with Ransac (implemented with openCV)- Hartley Stereo Matching(implemented by openCV)- SBGMMatching
23
Spring 2023
Final Presentation
6th Pipeline
ORB (Oriented Fast and BRIEF) – 8 point algorithm with Ransac (implemented myself) - Hartley Stereo Matching(implemented by openCV)- HITNet
24
Spring 2023
Final Presentation
7th Pipeline
ORB (Oriented Fast and BRIEF) – 7 point algorithm with Ransac (implemented with openCV) - Hartley Stereo Matching(implemented by openCV)- HITNet
25
Spring 2023
Final Presentation
Trying to project into left Camera
26
Spring 2023
Final Presentation
Test on other images 1st
27
Spring 2023
Final Presentation
Result Test on other images 1st
28
Spring 2023
Final Presentation
Images 3 and 4
29
Spring 2023
Final Presentation
Result Images 3 and 4
30
low number of point corespondence
low number of point correspondence and too large baseline
Spring 2023
Final Presentation
Result Image 5
31
Spring 2023
Final Presentation
Result Image 5
32
Small Baseline: move only little bit and the object is almost fronto parallel to camera because of plannar
Spring 2023
Final Presentation
Fun Things With Disparity
33
Spring 2023
Final Presentation
Fun Things With Disparity
34
Spring 2023
Thank You
(QnA)
35
Final Presentation
The Conclusion
My method of finding disparity map is still not robust enough so there must be a lot of things to try on:
36
Spring 2023
Final Presentation
Reference and Fair Use
37
Spring 2023