Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. function [a1,b1,a0,b0] = Conformal_2D(x_input,y_input,X_output,Y_output)
  2. %%
  3. % Calculates parameters $a,b,a_0,b_0$ in the following equation using least
  4. % squares
  5. %%
  6. %
  7. % $$X=a_1x+b_1y+a_0$$
  8. %
  9. % $$X=-b_1x+a_1y+b_0$$
  10. %%
  11. % *Arguments:*
  12. %
  13. % x_input is a $ntimes 1$ matrix containing x coordinate of control points
  14. % in the input space
  15. %
  16. % y_input is a $ntimes 1$ matrix containing y coordinate of control points
  17. % in the input space
  18. %
  19. % x_output is a $ntimes 1$ matrix containing x coordinate of control points
  20. % in the output space
  21. %
  22. % y_output is a $ntimes 1$ matrix containing y coordinate of control points
  23. % in the output space
  24. %%
  25. NumberOfPoints = size(x_input,1);
  26. A = zeros(2*NumberOfPoints,1); % Coefficient matrix in AX = L
  27. L = zeros(2*NumberOfPoints,1); % Right-hand matrix in AX = L
  28. for i = 1:NumberOfPoints
  29. A(2*i-1,1:4) = [x_input(i,1) y_input(i,1) 1 0];
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement