transformPointsForward does not support Polynomial​Transforma​tion2D

조회 수: 4 (최근 30일)
Juan de Jesus
Juan de Jesus 2025년 1월 30일
댓글: Matt J 2025년 1월 31일
I would like to know why transformPointsForward does not support PolynomialTransformation2D as a transformation object. It is weird because transformPointsInverse does support PolynomialTransformation2D.
So the workaround is simple, instead of using:
tform = fitgeotform2d(movingPoints,fixedPoints,"polynomial",degree)
[x,y] = transformPointsForward(tform,u,v)
I used:
tform = fitgeotform2d(fixedPoints,movingPoints,"polynomial",degree)
[x,y] = transformPointsInverse(tform,u,v)
But it is still counterintuitive and increases the risk of making mistakes later in the code.
Please let me know if there is something I am overlooking or if this is really a missing functionality of the transformPointsForward function.
This is the error I am getting when using transformPointsForward:
Incorrect number or types of inputs or outputs for function transformPointsForward.

채택된 답변

Matt J
Matt J 2025년 1월 30일
편집: Matt J 2025년 1월 30일
Polynomial tforms are generally not invertible, so you can only define them in one direction. I assume fitgeotform2d always fits the inverse transform because it is the inverse, not the forward transform that is need to perform a forward imwarp() from the moving space to the fixed space.
  댓글 수: 2
Juan de Jesus
Juan de Jesus 2025년 1월 31일
Now that I think about it, it makes sense. That is the expected behavior from the polynomial fit. Thank you very much.
Matt J
Matt J 2025년 1월 31일
You're welcome, but please Accept-click the answer if you consider your question resolved.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by