Error when performing imregtform with initial transformation

I performed rigid 2d imregtform registration with initial transformation 'InitialTransformation'. It outputs the error:
'\mathworks\hub\3rdparty\R2022a\7296554\win64\ITK\include\ITK-5.2\itkRigid2DTransform.hxx:79:
Attempt to set a Non-Orthogonal matrix'
The rigid 2d registration is initialized with a transformation from point cloud ICP registration pcregistericp. pcregistericp outputs a rigidtform3d transform but with only 2d components as my point clouds are only 2d. I converted the point cloud rigidtform3d transformation back to rigidtform2d transformation.
Code is (data is attached):
% Pre-register with point cloud ICP registration
tform3d=pcregistericp(moving2dCloudPoint,fixed2dCloudPoint);
% Convert point cloud 3d transformation to 2d transformation
tforminit =rigidtform2d(tform3d.R(1:2,1:2),tform3d.Translation(1:2));
% Register with image registration intialized with 2d converted point cloud 3d transformation
tform2d=imregtform(fixedImage,R,movingImage,R,tformType,optimizer,metric,'InitialTransformation',tforminit);
Thanks for the help,

4 comentarios

I was able to use the imregtform function with some sample data without any errors. Could you provide the data being used in your code, namely moving2dCloudPoint, fixed2dCloudPoint, fixedImage, movingImage, R, tformtype, optimizer and metric, to help in debugging the issue?
Hello Govind KM, Thanks for answering. I could provide the data on tuesday.
@Anatole Jimenez Any updates on the data?
@Govind KM Data are attached.

Iniciar sesión para comentar.

Respuestas (1)

I also faced the same issue at my end using the code and data provided. Please make sure that the rotation matrix in “tforminit” object must be an orthonormal matrix. I defined the “tforminit.R” to be a simple orthonormal matrix (which is also a rotation matrix), and the code ran without any errors as shown below.
load data
% Pre-register with point cloud ICP registration
tform3d=pcregistericp(moving2dCloudPoint,fixed2dCloudPoint);
% Convert point cloud 3d transformation to 2d transformation
tforminit =rigidtform2d(tform3d.R(1:2,1:2),tform3d.Translation(1:2));
tforminit.R=[0 -1;1 0];
% Register with image registration intialized with 2d converted point cloud 3d transformation
tform2d=imregtform(fixedImage,R,movingImage,R,tformType,optimizer,metric,'InitialTransformation',tforminit)
tform2d =
rigidtform2d with properties: Dimensionality: 2 RotationAngle: 59.0440 Translation: [4.5610 -5.6587] R: [2x2 single] A: [0.5144 -0.8576 4.5610 0.8576 0.5144 -5.6587 0 0 1.0000]
For more information on “imregtform” function, please refer to the following documentation link.
Hope you find this information helpful.

1 comentario

Thanks for the answer.
But I need the full transform from pcregistericp.

Iniciar sesión para comentar.

Categorías

Productos

Versión

R2023a

Etiquetas

Preguntada:

el 7 de Nov. de 2024

Comentada:

el 18 de Nov. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by