Effacer les filtres
Effacer les filtres

How do I apply a fitgeotrans output or similar to points NOT an image?

6 vues (au cours des 30 derniers jours)
Right Grievous
Right Grievous le 18 Juin 2016
Modifié(e) : kuroshiba le 2 Déc 2022
Hi everybody,
I have been using the fitgeotrans function to find the best linear weighted mean transformation between two sets of points.
This works really well when I use the imwarp function to warp an image, however, I also need to perform the same transformation on x,y points - this is proving difficult.
The tform output of fitgeotrans does not seem to have any transformPointsForward method, all it has is a transformPointsInverse method, which is not useful for me.
I think I must be missing something, the fitgeotrans function is using point coordinates to calculate the transformation, so surely it should be as easy to apply this to coordinates as well as images, if not easier?
Thanks for any help,
Rod.

Réponses (1)

Catalina Vajiac
Catalina Vajiac le 24 Juin 2016
There is a transformPointsForward function that you can use on your data points. The issue is that they are then defined in world coordinates, not intrinsic coordinates, so you must also use the worldToIntrinsic function, like this:
[B,RB]=imwarp(A,tform);
[xdataT,ydataT]=transformPointsForward(tform,xdata,ydata);
[xdataI,ydataI]=worldToIntrinsic(RB,xdataT,ydataT);
where tform is the output from fitgeotrans and RB is a spacial referencing object.
  5 commentaires
Sudip Paudel
Sudip Paudel le 27 Mai 2020
Modifié(e) : Sudip Paudel le 27 Mai 2020
I ran into the same issue and tried this method. However, it did not work for me because I am using transformation type 'lwm'. Is there another approach to solve this issue?
kuroshiba
kuroshiba le 2 Déc 2022
Modifié(e) : kuroshiba le 2 Déc 2022
Thank you gentleman! I was helped by you!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by