0

enter image description here

Hello,

I am trying to find the grid points which are outside from my data and at least 2cm close to grid data. The grid data is shown in red col and data is shown in blue. I can find the point inside if dist(cubeGridPoint < SampleDataPoint). I am interested in finding the points which are 2 cm close to sample. Any algorithm or help will def help me.

In summary, I want to find only grid points which are at least 2 cm from sample and lying outside the sample.

Keugyeol
  • 2,355
  • 1
  • 28
  • 36
snoze
  • 123
  • 1
  • 3
  • 12
  • point A(x1,y1,z1) is at least L from B(x2,y2,z2) if for any of k:x,y,z this is true that |k1-k2|>L – 4pie0 Aug 27 '14 at 00:16
  • if you can find those points which are inside a particular distance... wouldn't all the OTHER points be outside that particular distance? Just reverse the logic of your comparison... right? In any case, it's just a distance formula... – lornix Aug 27 '14 at 00:46
  • I don't understand your use of “inside” and “outside”. Apparently your sample is a point cloud, so what would be its inside? Would you define it using some distance threshold, or rather its convex hull? The equation you give is strange, since you write `dist(P < Q)` for two points `P,Q`. I can understand `dist(P,Q) – MvG Aug 27 '14 at 10:42
  • To simplify the problem, I have moved the cubic grid and sample data points to origin. From here it is easier to find which part of the sample data are inside. Using dist(cubeGridPoint < SampleDataPoint) i can remove all cubic grid points and save them. This is actually similar to sample data points. But I am unable to figure out how to save the cubic grid points which are outside my sample data and at least 2cm from it. Lornix, if I reverse my condition then it will include all grid point which are outside the sample. I can check it again but i think i have tried this too. – snoze Aug 27 '14 at 16:45
  • MvG, thanks for your feedback. Looks like this problem is similar to convex hull. I found this link http://stackoverflow.com/questions/18416861/how-to-find-convex-hull-in-a-3-dimensional-space How to use this without CGAL library? or any other suggestion – snoze Aug 27 '14 at 16:56

1 Answers1

0

the data looks not too convex to me (more concave like)

  • so the convex hull will create not what you want ...

I would use different approach similar to this find holes in 2D point set

  1. create space for your grid map

    • 3D voxel map for each 2x2x2 cm voxel
    • and clear it with zeroes
  2. loop through all points of your data

    • compute the voxel table coordinate for it
    • and increment its element value in voxel map
    • if you have too many points that also handle increment overflow
    • so you will not go to zero or negative values ...
  3. now

    • all voxels with zero are outside your object
    • or in some local hole of it
  4. filter the anomalies

    • you can use dilatation/erosion for that
    • or count neigbour voxels with zero and if lover then treshold clear it with 1
  5. find the boundary

    • handle table as set of 2D layers
    • in each layer process or horizontal lines
    • detect / replace it like this:

      find                  ->  replace
      ?????0000000000????? ->  ?????0111111110?????
      000000000000000????? ->  111111111111110?????
      ?????000000000000000 ->  ?????011111111111111
      
    • you can do this separate in 3 directions

    • and combine the results together to avoid projection related holes
  6. now all the voxels holding zero are your boundary points

[notes]

  • you can improve this by additional filtering like smooth or whatever
Community
  • 1
  • 1
Spektre
  • 49,595
  • 11
  • 110
  • 380