how to extract features from 350 clusters | extractEigenFeatures

조회 수: 2 (최근 30일)
Pavan Kumar B N
Pavan Kumar B N 2021년 10월 10일
편집: Pavan Kumar B N 2021년 10월 11일
Hello All,
I have around 350 clusters and I am trying to retain only matching clusters and remove unmatched ones. How to use this example in this case https://www.mathworks.com/help/lidar/ref/pcshowmatchedfeatures.html
  댓글 수: 2
Venkata Ram Prasad Vanguri
Venkata Ram Prasad Vanguri 2021년 10월 11일
Hi,
We can extract matched cluster segments and corresponding features from the matched index pairs as below:
matchedSegments1 = segments1(indexPairs(:,1));
matchedSegments2 = segments2(indexPairs(:,2));
matchedFeatures1 = eigFeatures1(indexPairs(:,1));
matchedFeatures2 = eigFeatures2(indexPairs(:,2));
Pavan Kumar B N
Pavan Kumar B N 2021년 10월 11일
편집: Pavan Kumar B N 2021년 10월 11일
@Venkata Ram Prasad Vanguri Thank you so much for your response.
I tried as you suggested on pcap data. When I run the following code it is generating 50 figures of matched segments. I tired visualize these results using pcplayer. But it is giving a error like "Too many input arguments". Could you please help on how to visulize these matching features using pcplayer.?
Eagerly looking forward for your kind help.
veloReader = velodyneFileReader('test.pcap', 'VLP16');
for i = 1:50
ptCloud1 = veloReader.readFrame(i);
ptCloud2 = veloReader.readFrame(i+1);
%remove the ground plane from the scans
maxDistance = 1;
referenceVector = [0 0 1];
[~,~,selectIdx] = pcfitplane(ptCloud1, maxDistance, referenceVector);
ptCloud1 = select(ptCloud1,selectIdx, 'OutputSize', 'full');
[~,~,selectIdx] = pcfitplane(ptCloud2, maxDistance, referenceVector);
ptCloud2 = select(ptCloud2,selectIdx, 'OutputSize', 'full');
%cluster the point cloud with 10 points per cluster
minDistance = 2;
minPoints = 10;
lables1 = pcsegdist(ptCloud1, minDistance, 'NumClusterPoints', minPoints);
lables2 = pcsegdist(ptCloud2, minDistance, 'NumClusterPoints', minPoints);
[eigFeatures1, segments1] = extractEigenFeatures(ptCloud1,lables1);
[eigFeatures2, segments2] = extractEigenFeatures(ptCloud2,lables2);
%create matrices of the features and centroids extracted from each point
%cloud
features1 = vertcat(eigFeatures1.Feature);
features2 = vertcat(eigFeatures2.Feature);
centroids1 = vertcat(eigFeatures1.Centroid);
centroids2 = vertcat(eigFeatures2.Centroid);
%find future matches
indexPairs = pcmatchfeatures(features1,features2, pointCloud(centroids1),pointCloud(centroids2),'MatchThreshold',0.1,'RejectRatio',0.9);
matchedSegments1 = segments1(indexPairs(:,1));
matchedSegments2 = segments2(indexPairs(:,2));
matchedFeatures1 = eigFeatures1(indexPairs(:,1));
matchedFeatures2 = eigFeatures2(indexPairs(:,2));
figure
pcshowMatchedFeatures(matchedSegments1,matchedSegments2,matchedFeatures1,matchedFeatures2)
title('Matched Segments')
xlimits = [-35 118];
ylimits = [-55 75];
zlimits = [-10 10];
player = pcplayer(xlimits,ylimits,zlimits);
%while(hasFrame(ptCloudPlayer))
% ptCloudObj = readFrame(ptCloudPlayer);
view(player,matchedSegments2.Location,matchedSegments2.Intensity);
%end
end

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Preprocessing에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by