transformPointsForward and fitgeotrans don't seem to agree

1 Ansicht (letzte 30 Tage)
Kurt Lanes
Kurt Lanes am 11 Dez. 2019
Beantwortet: Kurt Lanes am 11 Dez. 2019
I know this must be something I don't understand but I expected that if if generate a transform using fitgeotrans that I can then translate the moving points and I would get the fixed points. In my code the moving points are the corners of an image that is skewed and scaled and the fixed point the corners of the original image. When I used imwarp on the skewed image I get a perfectly rectangular result but translating the corner points gives me a rombus.
movingPoints = [-5 764;11 6;1069 753;1084 -5];
fixedPoints = [ 1 884;1 1;1161 884;1161 1];
tformGeo = fitgeotrans(movingPoints,fixedPoints,'affine');
translated = transformPointsForward(tformGeo,movingPoints(:,1),movingPoints(:,2))
movingPoints-translated

Antworten (1)

Kurt Lanes
Kurt Lanes am 11 Dez. 2019
probably should include the results:
translated =
1.0e+03 *
0.0007
0.0013
1.1613
1.1607
ans =
1.0e+03 *
-0.0057 0.7633
0.0097 0.0047
-0.0923 -0.4083
-0.0767 -1.1657

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by