필터 지우기
필터 지우기

What is the functionality of the distance evaluation function in the RANSAC MATLAB function?

조회 수: 5 (최근 30일)
Dear all,
I have used the RANSAC Matlab function for computing inlier points of the data. Can anyone please tell me the functionality of "distFcn" in the input argument of ransac?
Is the functionality of the distance evaluation function is a euclidean distance?
The following things mentioned with the help of RANSAC.
[model,inlierIdx] = ransac(data,fitFcn,distFcn,sampleSize,maxDistance)
sampleSize = 2; % number of points to sample per trial
maxDistance = 2; % max allowable distance for inliers
fitLineFcn = @(points) polyfit(points(:,1),points(:,2),1); % fit function using polyfit
evalLineFcn = ... % distance evaluation function
@(model, points) sum((points(:, 2) - polyval(model, points(:,1))).^2,2);
[modelRANSAC, inlierIdx] = ransac(points,fitLineFcn,evalLineFcn, sampleSize,maxDistance);
distFcn — Function to compute distances from model:
Function to compute distances from the model to the data, specified as a function handle. The function must be of the form: distances = distFcn(model,data)
If model is an n-element array, then distances must be an m-by-n matrix. Otherwise, distances must be an m-by-1 vector.
Thanks & regards
Sukumar.

채택된 답변

Walter Roberson
Walter Roberson 2021년 7월 13일
The function that you post uses Euclidean distance. The people who designed ransac did not want to restrict to Euclidean in case someone had a need for a different distance measure. See the documentation for pdist() for examples of other distance functions that are possible (in a general sense.)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by