Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [a1,b1,a0,b0] = Conformal_2D(x_input,y_input,X_output,Y_output)
- %%
- % Calculates parameters $a,b,a_0,b_0$ in the following equation using least
- % squares
- %%
- %
- % $$X=a_1x+b_1y+a_0$$
- %
- % $$X=-b_1x+a_1y+b_0$$
- %%
- % *Arguments:*
- %
- % x_input is a $ntimes 1$ matrix containing x coordinate of control points
- % in the input space
- %
- % y_input is a $ntimes 1$ matrix containing y coordinate of control points
- % in the input space
- %
- % x_output is a $ntimes 1$ matrix containing x coordinate of control points
- % in the output space
- %
- % y_output is a $ntimes 1$ matrix containing y coordinate of control points
- % in the output space
- %%
- NumberOfPoints = size(x_input,1);
- A = zeros(2*NumberOfPoints,1); % Coefficient matrix in AX = L
- L = zeros(2*NumberOfPoints,1); % Right-hand matrix in AX = L
- for i = 1:NumberOfPoints
- A(2*i-1,1:4) = [x_input(i,1) y_input(i,1) 1 0];
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement