How to remove points of a specific color from a point cloud? (Comp Vis Toolbox)
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I'm using the Computer Vision toolbox to track several objects for which I have point cloud data of their shapes.
In segmenting each object out of their frame, I set all other color to NaN as rectifyStereoImages requires the two images to be of equal size. When reconstructing scene however, the NaN point are also rectified and reconstructed into the point cloud.
Is there a simple way, once I have the point cloud, to identify points with NaN color and remove them from the cloud?
My first solution was to use isnan for the pointCloud.Color array but that only sets color to zero rather than removes the point.
0 commentaires
Réponses (1)
Prateek Rai
le 19 Juin 2020
As per my understanding, you are having a point cloud and you want to identify points with point.Color as NaNs and remove them from the point cloud.
To solve this problem efficiently you can use “find” along with “isnan”.
Here is a sample code which performs similar task :
A=[1 1 1;2 2 3;3 3 3;NaN NaN NaN;4 4 4;5 5 5;NaN NaN NaN;NaN NaN NaN]
B=isnan(A(:,1))
idx=find(B)
A(idx,:)=[]
You can refer the following MATLAB documentation links on “isnan” and “find” respectively for more details.
0 commentaires
Voir également
Catégories
En savoir plus sur Point Cloud Processing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!