Mahalanobis distance between a point and a line

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

How is this a Matlab question?
if you wish:
Does anyone have a matlab implementation of Mahalanobis distance between a point and a line in 3D?
thanks,

댓글을 달려면 로그인하십시오.

 채택된 답변

Adam
Adam 2014년 5월 3일

0 개 추천

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

thanks, I'll look into this paper and report back (time allowing).
The paper you cited has exactly what I want. Upon closer inspection, however, it contains a critical error. What equation 7 describes is actually the Eigen decomposition (noted the R and R'), and not SVD as the paper transcribes. Please make a note of it if you are implementing it.
That is, R can be obtained using eig(sigma), not svd(sigma).
of course, please correct me if I am wrong.
thanks,
Elvis Chen
Elvis Chen 2014년 5월 7일
편집: Elvis Chen 2014년 5월 12일
Equation 10) is also wrong. It calculates the adjacent of the triangle (figure 3a) but what we want is the opposite of the triangle.
can't believe this is an IEEE conference paper, with these 2 critical errors.
(edit:) SVD will work though it gives a different solution (but correct) than eigen decomposition. SVD also works since the covariance matrix is symmetric.
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
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?
Elvis Chen
Elvis Chen 2014년 4월 24일

0 개 추천

sorry, I realized that I was not clear in my original question.
For my application, the said covariance is actually the uncertainty associated with the point and it is given. And yes, I am looking for the shortest distance between a point and a line, given the uncertainties of this particular point.
That is, give a line defined by AB, and a point P_3x1, and the associated uncertainty C(P)_3x3, I like to find a closed-form solution for a point C_3x1 on AB that has the shortest Mahalanobis distance from P.
I apologize for not making my question clear. Thank you for your time,
Image Analyst
Image Analyst 2014년 5월 3일

0 개 추천

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

댓글 수: 1

thanks, but what you describes is to find the Euclidean distance between a point and a line. I am looking for Mahalanobis distance, not Euclidean distance.

댓글을 달려면 로그인하십시오.

질문:

2014년 4월 24일

댓글:

2015년 1월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by