about asp_sgm

61 views
Skip to first unread message

Zhen Yang

unread,
Dec 27, 2023, 3:33:25 AM12/27/23
to Ames Stereo Pipeline Support
Hello everyone,
I noticed that asp_sgm and asp_mgm support two-dimensional disparity calculation. I would like to know how the two-dimensional disparity calculation is implemented. My idea is similar to this patent (https://uspto.report/patent/app/20210065379): first, perform epipolar rectification on the left and right images to generate one-dimensional disparity, and then project the one-dimensional disparity back to obtain two-dimensional disparity. I'm not sure if this is correct.

Scott McMichael

unread,
Dec 27, 2023, 10:32:16 AM12/27/23
to Ames Stereo Pipeline Support
The code that implements the two dimensional disparity calculation can be found here:  https://github.com/visionworkbench/visionworkbench/blob/master/src/vw/Stereo/SGM.cc  It is somewhat messy but I can go back through it if you have particular questions.

I don't recall there being any special trick to performing the calculations in 2D.  The biggest problem is that there are certain optimizations that can be performed in the 1D case that cannot be used in the 2D case so the implementation is less efficient in addition to the expected cost of searching in 2D vs 1D.  If you can rectify the image such that a 1D search find all matches then that is the best approach but the ASP method is useful in cases where the rectification does not work that well.

Scott

Zhen Yang

unread,
Dec 27, 2023, 9:54:31 PM12/27/23
to Ames Stereo Pipeline Support
Thanks for your answer.
In other words, the reason why SGM in ASP can achieve two-dimensional disparity calculation is that it performs a search in a two-dimensional space when searching for disparities?

Scott McMichael

unread,
Dec 28, 2023, 12:43:08 PM12/28/23
to Ames Stereo Pipeline Support
Correct, the SGM algorithm including cost function computation and path accumulation is applied over a two dimensional range of disparities.

Scott

Zhen Yang

unread,
Jan 1, 2024, 8:44:03 PMJan 1
to Ames Stereo Pipeline Support
Well, thank you.
Reply all
Reply to author
Forward
0 new messages