- Instead of directly multiplying the target plane's parameters with the transformation matrix, you need to extract the rotation matrix from ‘tform.T’ and apply it to the plane parameters to represent the rotation component.
- The translation component of the transformation matrix doesn't affect the plane parameters, hence apply the rotation part to the plane parameters.
- The transformed plane's parameters need to include the translation component (fourth element) from the original target plane parameters.
Visualize Deviation of Fit Plane from Reference Vector
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to replicate the process outlined in normalRotation to visualized deviation from the [0 1 0] plane instead of the [0 0 1] plane. I suspect the issue has to do with mishandling of the tform object for my use case.
% My code
maxDistance = 0.1;
referenceVector = [0 1 0];
target_pc = pointCloud(xyz_data);
targetPlane = pcfitplane(target_pc,maxDistance,referenceVector);
tform = normalRotation(targetPlane,referenceVector);
target_tform = pctransform(target_pc,tform);
planeParams = targetPlane.Parameters * tform.T;
transformedPlane = planeModel(planeParams);
figure;
pcshowpair(target_tform,target_pc);
title(sprintf('target site %i', iSite))
xlabel('x'); ylabel('y'); zlabel('z');
hold on;
plot(targetPlane, 'Color', 'magenta');
plot(transformedPlane, 'Color', 'green');
0 commentaires
Réponses (1)
Sugandhi
le 22 Août 2023
Hi,
I understand that you are trying to visualize the deviation of a point cloud from a reference plane ([0 1 0] plane) instead of the [0 0 1] plane.
One of the possible workarounds could be:
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!