Finding the distance between a large group of points from a plane
    6 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
Hi All,
I have a large group of points scattered in front of a curtain-like wall in the 3D space. I want to find the distance of each points from the wall.
If the number of points was low, I could find the distance of each points using the least square method. In other words, I could calculate the eucleadian distance of each point from all points on the wall and then find the lowest one. However, in my problem, I have about 3 million points that are scattered in front of a wall with irregular surface that can be described using around one million points. So totally I need to calculate the distance for about 3*E12 times, which is not feasible.
Is there any image processing method by which I can find the closest point on the wall to each point in front of the wall? I mean visually we can locate a set of few points on the wall that are closest to each point in front of it. Can we do the same thing using the MATLAB image processing toolbox?
Many thanks in advance,
2 Commenti
  Walter Roberson
      
      
 il 16 Dic 2019
				Is the current-like wall a logical plane? Or is it wavy like is not uncommon in some curtains?
  Memo Remo
 il 16 Dic 2019
				Hi Walter, Thanks for the reply. No, the surface of the wall is highly irregular. No surface fit can be considered.
Risposta accettata
  Walter Roberson
      
      
 il 16 Dic 2019
        https://www.mathworks.com/help/stats/knnsearch.html knnsearch() between the wall points and the cloud points. 
This does not compare each point to each other point, not under the circumstance that the points are low dimensional and that euclidean distance is being used: instead it builds an octree or equivalent for higher dimensions.
2 Commenti
  Image Analyst
      
      
 il 16 Dic 2019
				How long does it take if you do this?
numPoints = 100;
xy1 = rand(3*numPoints, 2);
xy2 = rand(numPoints, 2)
tic
distances = pdist2(xy1, xy2);
toc
Gradually increase numPoints up to a million.  I did 100000 on my slow computer and it tool almost 4 minutes.
But I think subsampling your data and using KNN like Walter suggested to estimate the nearby points is a good workaround that may be accurate enough for you.
Più risposte (1)
Vedere anche
Categorie
				Scopri di più su Interpolation of 2-D Selections in 3-D Grids in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!