-
-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SGM Parameter #1103
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to ask about the SGM method, where the formulas for the P1 and P2 penalty terms come from, and how the parameters in the formula are determined.
openMVS/libs/MVS
/SemiGlobalMatcher.cpp
// - P1 and P2s are algorithm constants very similar to those from the original SGM algorithm;
// they are set to defaults according to the patch size
// - alpha & beta form the final P2 as P2*(1+alphae^(-DI^2/(2beta^2)))
// where DI is the difference in image intensity I(x)-I(x_prev) in [0,255] range
// - subpixelSteps represents how much sub-pixel accuracy is searched/stored;
// if 1 no sub-pixel precision, if for example 4 a 0.25 sub-pixel accuracy is stored;
// the stored value is quantized and represented as integer: val=(float)valStored/subpixelSteps
SemiGlobalMatcher::SemiGlobalMatcher(SgmSubpixelMode _subpixelMode, Disparity _subpixelSteps, AccumCost _P1, AccumCost P2, float P2alpha, float P2beta)
:
subpixelMode(_subpixelMode),
subpixelSteps(_subpixelSteps),
P1(_P1), P2s(GenerateP2s(P2, P2alpha, P2beta))
{
}
openMVS/libs/MVS
/SemiGlobalMatcher.h
SemiGlobalMatcher(SgmSubpixelMode subpixelMode=SUBPIXEL_LC_BLEND, Disparity subpixelSteps=4, AccumCost P1=3, AccumCost P2=4, float P2alpha=14, float P2beta=38);
The text was updated successfully, but these errors were encountered: