Hello,

I have a problem understanding how the tform (transformation matrix) from the function pcregistercpd works.

First of all, what I have and have done:

I have two point clouds, let's call them reference_pc and query_pc.

I use pcregistercpd to make an affine transformation to align reference_pc and query_pc. It works very nicely.

Now comes my problem:

I'd like to manually use the transformation matrix tform and align query_pc to reference_pc.

What is tform? This is the documentation for it. It's a 4×4 matrix, where (I'm assuming) the first rows are the rotation components and the fourth row is the translation component. So, for me to use it manually I'll have to make a matrix multiplication. Like this:

`aligned_query_pc = reference_pc * tform`

The problem with thtis is that my point clouds are just nx3 matrices. So I just put a zero column on the back of both point clouds' matrices.

This doesn't work. When I plot the point clouds, they are not aligned.

Can you help me understand this?

I have uploaded a workspace, in case you want to try it out.

You can use these lines to plot them:

`figureaxis equalscatter3(AAA_reference(:,1),AAA_reference(:,2),AAA_reference(:,3),10,'MarkerEdgeColor','k', 'MarkerFaceColor','g')hold onscatter3(AAA_query_zeros(:,1),AAA_query_zeros(:,2),AAA_query_zeros(:,3),10,'MarkerEdgeColor','k', 'MarkerFaceColor','m')hold onscatter3(aligned_query_pc(:,1),aligned_query_pc(:,2),aligned_query_pc(:,3),10,'MarkerEdgeColor','k', 'MarkerFaceColor','b')`

## Best Answer