I am trying to make a tform transformation matric, but I am getting below error once , can you please assit me to fix it?

36 ビュー (過去 30 日間)
Abb
Abb 2022 年 11 月 2 日
回答済み: Sakshay 2022 年 12 月 1 日
I'm gonna project a point cloud on an image which I have transformation elements such as rotation and translation matrices as below:
Rotation =
0.0499 0.999 -0.0213
-0.0283 0.0228 0.999
0.998 -0.0493 0.0294
Translation =
2.489e+06 7.4404e+06 9.58
tform = rigidtform3d(Rotation,Translation)
Error using images.geotrans.internal.rigidtform3dImpl
Invalid rotation matrix.
Error in rigidtform3d (line 8)
self = self@images.geotrans.internal.rigidtform3dImpl(varargin{:});

回答 (1 件)

Sakshay
Sakshay 2022 年 12 月 1 日
Hello Abbas,
As per my understanding you are trying to create the "rigidtform3d" object using the Rotation Matrix and Translation Vector. But, you are getting an error indicating an incorrect Rotation Matrix.
A valid rotation matrix should satisfy the following constraints:
MATLAB does these internal checks before assigning the Rotation Matrix. For your case, the rotation matrix does not seem to satisfy the constraints (accuracy upto ), as in the following code:
% Assign Rotation Matrix
R = [0.0499, 0.9990, -0.0213; -0.0283, 0.0228, 0.9990; 0.9980, -0.0493, 0.0294];
% Test 1
R' * R
ans = 3×3
0.9993 0.0000 0.0000 0.0000 1.0010 0.0000 0.0000 0.0000 0.9993
R * R'
ans = 3×3
1.0009 0.0001 -0.0001 0.0001 0.9993 0.0000 -0.0001 0.0000 0.9993
% Test 2
det(R)
ans = 0.9998
You can try to generate a rotation matrix from euler angles, using the "eul2rotm" function. Please refer to the following documentation for more information on the same:

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by