Mahalanobis distance between a point and a line
2 ビュー (過去 30 日間)
古いコメントを表示
hi all,
I am wondering if fellow reader can help me out to find a proper paper to calculate the Mahalanobis distance between a line and a point. I have found paper discussing "whitening transform" used to compute the Mahalanobis distance between a plane and a point, but could not find anything to for line/point.
mainly working in 3D.
thanks,
2 件のコメント
採用された回答
Adam
2014 年 5 月 3 日
I think this paper might has what you're looking for: Robust 3D Line Extraction from Stereo Point Clouds . I'm currently working on implementing this algorithm myself.
4 件のコメント
Kirk
2015 年 1 月 24 日
That paper breaks the transformation down into rotation and scale, but you can just use the whitening transformation (which does not separate the two).
Matlab example:
white = sqrt(Sigma); % Inverse of whitening transformation
l0w = white\(l0-Mean); % Demean, then whiten the point on the line
l1w = white\l1; % Whiten the direction vector
l1w = l1w/norm(l1w); % Normalize the direction vector
d = l0(2)*l1(1)-l0(1)*l1(2); % Distance from (0,0) to line
Where Mean and Sigma are the moments of your 2D Gaussian, white is the whitening transformation, l0 is a point on the line, l1 is the direction vector of your line, and d is the Mahalanobis distance. This appeared to work for me.
その他の回答 (3 件)
José-Luis
2014 年 4 月 24 日
doc pdist
doc mahal
And by distance between a point and a line do you mean the shortest distance? Also, the mahalanobis distances requires you know the covariances of the distribution (that you are assuming to be normal) you are calculating the distance to. How do you expect to find the covariance of a single point? Or of a line?
0 件のコメント
Image Analyst
2014 年 5 月 3 日
Not sure what the noise/uncertainty has to do with it, but for a given point, and a given line, why can't you just use the formula to find the distance: http://mathworld.wolfram.com/Point-LineDistance2-Dimensional.html
参考
カテゴリ
Help Center および File Exchange で Hypothesis Tests についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!