I have a 3D point cloud image(.ply format). I need to cut it from center dividing into two. Tried to select only half of the Point cloud using following code but random points are obtained not the desired ones. Using following logic t divide a point cloud in Half(1/2 of original) and save the resultant in a new point cloud. Neither able to correctly slice cloud image from center nor save it in new cloud.
stepSize = 1;
indices = 1:stepSize:(i1.Count)/2;
pt = select(i1, indices);
I also checked following code:
points3d = i1.Location;
points3d_1 = points3d(points3d(:, 1) < 100, :);
points3d_2 = points3d(points3d(:, 1) >= 100, :);
ptCloud1 = pointCloud(points3d_1);
ptCloud2 = pointCloud(points3d_2);
pcshow(ptCloud1);
figure
pcshow(ptCloud2);
Both the snippets are doing same randomly a part is divided and the no matter what range i try in
point3d(:,1)<range
second slice is always full original image. Also the slice image is containing background of original image as shown below. how to get only cloud region stored in new ptCloud1 and ptCloud2.
How can I get new point cloud which is sliced. Using MatalbR2014b
*.ply
file is made from a left to right scan you're going to get useless data points, which you've seen. Even if it was scanned as such, this would be a terribly non-robust methodology. You need to look at your data in 3D space and determine where the midplane is. – excaza*.ply
file in half. Nowhere did I say the process had to be manual, but at some point you have to establish criteria for your midplane. – excaza