How to graphicall​y/interact​ively select region of interest from 3D point cloud data

14 views (last 30 days)
I am working with 3d point cloud data and interested in graphically selecting regions of interest from MATLAB figures. A possible scenario could be changing the view to one of the planes (e.g. XY plane) and drawing some contours or geometric shapes using cursor as shown below. Then selected datapoints should be stored in a workspace variable.
I found something similar for images (2d figures) but not sure how to that for 3d point cloud data.
Is something like this can be done in MATLAB?
Thanks.

Accepted Answer

Bjorn Gustavsson
Bjorn Gustavsson on 25 Nov 2019
In newer versions of matlab there seems to be just such a feature, see: ROI.CUBOID
For older versions of matlab (I vaguely recall) there might be versions of ginput with extended 3-D capabilities on the file exchange: ginput-extensions
HTH
  4 Comments
Qasim Nazir
Qasim Nazir on 26 Nov 2019
Edited: Qasim Nazir on 26 Nov 2019
It worked out for me, thanks for your help. Final code is here.
ax = pcshow(ptCloud);
ax.View = [0,90];
%% draw roi
roi = images.roi.Polygon(ax) ;
draw(roi)
pause(3)
%% select points inside roi
x = ptCloud.Location(:,1);
y = ptCloud.Location(:,2);
mask = inROI(roi,x,y);
sub_ptCloud = select(ptCloud,mask);

Sign in to comment.

More Answers (0)

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!