transformPointsForward does not support PolynomialTransformation2D
4 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Matt J
on 30 Jan 2025
Edited: Matt J
on 30 Jan 2025
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 Comments
Matt J
on 31 Jan 2025
You're welcome, but please Accept-click the answer if you consider your question resolved.
More Answers (0)
See Also
Categories
Find more on Geometric Transformation and Image Registration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!