Point Cloud Comparison to Detect Changes in Scene
Show older comments
Hello, I am using Kinect with Matlab to extract point two point clouds. Once aligned the point clouds are compared for differences. The difference is found by finding the nearest neighbor and comparing it to a threshold distance. If the distance is greater than the threshold, the point will be stored in a different point cloud. Please see attached script:
function [PCDifference,Indices] = ComparePC(pc1,pc2) %Compares two aligned point clouds [pc1r,~]=removeInvalidPoints(pc1); [pc2r,~]=removeInvalidPoints(pc2); minDist = 0.5; x=0;
%for each point in pc1 find nearest neighbor distance - if greater then %threshold distance store point cloud in PCDifference for i =1:pc1r.Count point=pc1r.Location(i,:); [~,dist]=findNearestNeighbors(pc2r,point,1); if dist > minDist %Store point cloud in indices x=x+1; Indices(x,1)=i end end %plotting difference in point clouds PCDifference=select(pc1r,Indices); figure pcshow(PCDifference)
2 Comments
Vaidyanathan Thiagarajan
on 29 Aug 2017
Hello Michael,
Can you please elaborate on what is the issue you are facing in comparing the two point clouds?
Vaidyanathan
John D'Errico
on 29 Aug 2017
What is the problem? There must be some reason you are asking a question.
Answers (0)
Categories
Find more on Kinect For Windows Sensor in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!