MATLAB: How to track the indexes of a PoinCloud object after downsampling

downsamplingpcdownsamplepoincloud

Is it possible to track the index of the PoinCloud object after downsampling?
ptCloudOut = pcdownsample(ptCloudIn,'random',0.1)
I want to downsample an Mx3 data using pcdownsample(), let's say the index of each point before downsampling is the number of the row.
ptCloudIn has 1000 rows (M=1000), ptCloudOut has 100 rows.

Best Answer

Using pcdownsample you cannot track index you have to follow different approch
lets say if you save all the indices in one variable and in another variable you can select some indices and only select those indices from ptCloudIn you can select.
Like in following code in downsampled variable we can save the indices that you want to track and select those indices from original point cloud
downsampled = [1:5:ptCloudIn.Count]';
ptCloudOut = select(ptCloudIn,downsampled);
figure
pcshow(ptCloudOut)