I try to test the new function "pcsegdist" in Matlab R2018b. However, the result is wrong for Segment point cloud into clusters based on Euclidean distance
Example: I test with 3D data points- 1797 points (please see attached test.txt file). It is noted that the smallest distance between 2 neighbor points is 0.3736
tic
clear;clc;filename = 'test.txt'; load('test.txt');P = test(:,1:3);
ptCloud = pointCloud(P);
minDistance = 0.71;
[labels,numClusters] = pcsegdist(ptCloud,minDistance);
toc
cell_cluster={};x=P(:,1);y=P(:,2);z=P(:,3);
for i=1:numClusters
cluster_i=[x(labels==i),y(labels==i),z(labels==i)];
cell_cluster{end+1} = cluster_i;
end
figure;Plot_cell(cell_cluster);view(3);
But when I verify by using manually method (ground truth data), the result should as below figure:
Thus, I wonder about the result of new function "pcsegdist" in Matlab R2018b, Or I misunderstand or I wrong somewhere ?
3 Comments
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/447808-miscalculation-of-new-function-pcsegdist-in-matlab-r2018b#comment_695668
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/447808-miscalculation-of-new-function-pcsegdist-in-matlab-r2018b#comment_695668
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/447808-miscalculation-of-new-function-pcsegdist-in-matlab-r2018b#comment_930860
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/447808-miscalculation-of-new-function-pcsegdist-in-matlab-r2018b#comment_930860
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/447808-miscalculation-of-new-function-pcsegdist-in-matlab-r2018b#comment_930983
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/447808-miscalculation-of-new-function-pcsegdist-in-matlab-r2018b#comment_930983
Sign in to comment.