Solved

tformfwd() ?

Posted on 2008-10-20
3
609 Views
Last Modified: 2013-11-25
Hi,

I have a set of 3 point pairs. A point is defined like:

    pt = { x, y, scale, rotation }

I want to find the affine transformation that maps the 3 points to their point matches. Is there any way to do this in matlab? I know there is the tformfwd() function which looked promising but I don't know if it can handle a 3rd and 4th parameter attached to each point (scale and rotation). Any thoughts?

Thanks
0
Comment
Question by:DJ_AM_Juicebox
3 Comments
 
LVL 27

Expert Comment

by:aburr
ID: 22792985
I am not really an expert in matlab, but I can try to help. What do you mean by point matches?
0
 
LVL 4

Accepted Solution

by:
SyfAldeen earned 500 total points
ID: 22895724
DJ_AM_Juicebox,
Yes, you are quite right. maketform and tformfwd are the suitable functions to find and validate the affine transformation. However, you can't use them when your points are represented in this form. You can use the function below to convert your points to the proper form.

function [x y] = applytrans(p)

%   applytrans converts points from pt = { x, y, scale, rotation }

%                     to equivalent pt = { x, y}

%   By applying the scale and rotation transformation to original x, y.

%   For example:

%   A =[

%     1.0000    2.0000    3.0000    3.1416;

%     5.0000    6.0000    7.0000    1.5708;

%     4.0000    3.0000    1.0000   -1.5708;

%   ];

% 

%   [x y]=applytrans(A)

%

%   Gives

%   x =

%    -3.0000

%   -42.0001

%     3.0000

%   y =

%    -6.0000

%    34.9998

%    -4.0000

x=p(:,1).*cos(p(:,4))-p(:,2).*sin(p(:,4));

y=p(:,1).*sin(p(:,4))+p(:,2).*cos(p(:,4));

x=p(:,3).*x;

y=p(:,3).*y;

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countClumps  challenge 10 90
Logarithms 2 52
SQL400 max size 5 54
Calculating T-SCORE inside Excel. 3 66
We are taking giant steps in technological advances in the field of wireless telephony. At just 10 years since the advent of smartphones, it is crucial to examine the benefits and disadvantages that have been report to us.
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now