MATLAB: 3D Point Clouds: “findPointsInROI” and “select” not working

point cloudptcloud

Hi there!
I am working with LiDAR point cloud data and would like to select some points of my point cloud which are located within a region of interest (ROI).
I know that there are the functions findPointsInROI and select, and I used them before for "simple" point clouds (i.e. with only one frame).
However, now I have a more "complex" point cloud, i.e. one where I have put several frames (60 frames) into the same point cloud, see below:
If I try to use the same functions as I did with the "simple" point cloud for this point cloud, they are not working:
roi = [xlimits, ylimits, zlimits];
%Find indices of the points that lie within the cuboid ROI
indices = findPointsInROI(ptCloud,roi);
%put points of interest from original pt Cloud into new pt Cloud
ptCloudB = select(ptCloud,indices);
It is not that there is an error message, but the "indices" vector I get does not make any sense (i.e. it does not contain the number of the points which are within the ROI) and the resulting, selected point cloud "ptCloudB" only contains 1 (instead of 60) frames.
Is there any solution to make those functions work?
Thanks!

Best Answer

Hi,
From the file I can see that the point cloud that is read is essentially an organized point cloud. So, it is a single point cloud only. The selected point cloud ptCloudB that is outputted by findPointsInROI and select is an unorganized ptCloud but contains the points that are there in ROI and original point cloud.
I assume the frames that are mentioned in question are not meant to be different unorganized point clouds otherwise if that is the case, you need to give each point cloud separately to the findPointsInROI. If you are unsure that the original point cloud in the question is organized on not you may view the actual and selected point cloud using an example mentioned here.
Hope it clarifies the queries.