How can I draw boundary around data points plotted using scatter3 function?

10 views (last 30 days)
Hello all,
You may please see the data plotted using scatter function here followed by data in excel sheet here. We can just see a single object here but there may be hundred of such in a single figure. My task is to draw tight/collapsed boundary around these block of points. One solution is to fill 3x3 neighborhood around each pixel point, I can get a shape and can find the edges using canny edge detector. In this case, edges are zigzagged and couldn't find a straight longest line or a single continuous line around such shapes. Line may be straight enough to represent a boundary of this shape. I'm anxiously waiting for your help. Thanks!
  1 Comment
Ali Gilani
Ali Gilani on 24 May 2014
Edited: Image Analyst on 24 May 2014
Any ideas how to address the above said task efficient ? I'm stuck. How can I find the corners of of this shape? Seeking for some help. Thanks!
Explaination about data:
1st and second column are the x and y values and we just plotted them. It turns out be a building's roof. Now I have to find the trace a boundary around this shape (around whole points, that are grouped together).
I'd really appreciate your assistance. Thank!

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 24 May 2014
You can try convhull() or in 3D convhulln(). If you have an image, use bwconvhull().
  7 Comments
Syed Ali Naqi Gilani
Syed Ali Naqi Gilani on 25 May 2014
It worked... Thank you dear! Can you please guide me, how can I smooth the boundary to make a longest edge and merge these small edges like best fitting line (to remove zigzag effect). So that instead of small many edges, I can use the longest edges only. One such morphed exemplary image attached Best fit lines.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!