필터 지우기
필터 지우기

How can I do a homogeneous transform of data to a different coordinate system?

조회 수: 2 (최근 30일)
Hello
I have two 3D data arrays, A and B, that contain spatial measurement data of the same real world object. A and B are not the same size. There are XYZ coordinate systems attached to both arrays. In array B the object is rotated, scaled and translated relative to the data in array A. I do have the transformation matrix for the affine transformation between the two coordinate systems, thanks to fiduciary points in the object which show up in the data.
I would like to interpolate the data in the B array into the coordinate system for the A array, but I am unsure how to do this?
The end result would be a new array, C, that contains the interpolated data from the B array, but with the same size as the A array.
Thank you for your help.

채택된 답변

Nicolai Sanders
Nicolai Sanders 2017년 3월 10일
To answer my own question: I ended up using imwarp when i realized it can handle 3D arrays.
I defined spatial references for the A and B coordinate systems with
RA = imref3d(size(A),[min(xA), max(xA)],[min(yA), max(yA)],[min(zA), max(zA)]);
RB = imref3d(size(B),[min(xB), max(xB)],[min(yB), max(yB)],[min(zB), max(zB)]);
Then i defined an affine transformation AT with my transformation matrix TM
AT=affine3d(TM);
Now i could transform B into the coordinate system of A with
[C,RC]=imwarp(B,RB,AT,'OutputView',RA);
On a sidenote, i acquired the transformation matrix with absor
[rp,Bfit,ErrorStats]=absor(PA,PB,'DoScale',1);
TM=rp.M.';
  댓글 수: 1
GAldos
GAldos 2018년 7월 26일
Thanks for posting your solution! Just wondering why did you take the transpose of the rotation matrix to get the transformation matrix with absor? i.e. TM=rp.M.' ?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by