필터 지우기
필터 지우기

segment point cloud data into clusters | The input point cloud must be organized (M-by-N-by-3)

조회 수: 16 (최근 30일)
Hello All,
I am trying to segment 3D point cloud into clusters using pcap file. When I give pcdenoised cloud as a Input it throwing "The input point cloud must be organized (M-by-N-by-3)" . How to fix this problem?
veloReader = velodyneFileReader('data.pcap','VLP16');
xlimits = [-35 118];
ylimits = [-55 75];
zlimits = [-10 10];
player = pcplayer(xlimits,ylimits,zlimits);
for i = 1 : 600
ptCloud = veloReader.readFrame(i);
ptCloudIn = removeInvalidPoints(ptCloud);
ptcloudFil = pcdenoise(ptCloudIn);
groundPtsIdx = segmentGroundFromLidarData(ptCloudFil);
ptCloudWithoutGround = select(ptCloudFil,~groundPtsIdx,'OutputSize','full');
distThreshold =500;
[labels,numClusters] = segmentLidarData(ptCloudWithoutGround,distThreshold);
numClusters = numClusters+1;
labels(groundPtsIdx) = numClusters;
labelColorIndex = labels+1;
%colormap([hsv(numClusters);[0 0 0]]);
view(player,ptCloudFil.Location,labelColorIndex);
end

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 18일
Probably, you'd need to generate meshes using meshgrid()
  댓글 수: 5
Pavan Kumar B N
Pavan Kumar B N 2021년 6월 18일
@Stephen Cobeldick Still I am facing the same problem. I am able to create the grid. When I assign 11776 x 3 values to to X,Y, Z. It is giving error. Please guide me to fix this issue.
Please correct me.
t = ptCloudFil.Location(:,1);
y = ptCloudFil.Location(:,2);
u = ptCloudFil.Location(:,3);
[X,Y,Z] = ndgrid(t,y,u);
ptCloud =
pointCloud with properties:
Location: [16×1810×3 single]
Count: 28960
XLimits: [-35.7891 117.1103]
YLimits: [-65.8583 70.7026]
ZLimits: [-7.6524 7.0585]
Color: []
Normal: []
Intensity: [16×1810 uint8]
>> ptCloudFil
ptCloudFil =
pointCloud with properties:
Location: [11776×3 single]
Count: 11776
XLimits: [-34.8347 115.3167]
YLimits: [-58.5607 62.0888]
ZLimits: [-7.6524 7.0585]
Color: []
Normal: []
Intensity: [11776×1 uint8]

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by