フィルターのクリア

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

3 ビュー (過去 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 Center および File ExchangePoint Cloud Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by