- 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 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Sugandhi
2023-8-22
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Point Cloud Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!