In [1]:
# Simple things first:
import numpy as np
mat = np.array([
[1, 3, 4],
[6, 9, 8],
[6, 7, 9]])
print(mat)
In [2]:
[U, D, V] = np.linalg.svd(mat)
In [3]:
print(U)
In [4]:
print(D)
In [5]:
print(np.transpose(V))
In [6]:
# Perspective transformation
# pick initial and final coords:
init_coords = [(0, 0), (1,1), (2, 2), (3,3)] # (xi, yi)
final_coords = [(0, 0), (1,1), (2, 2), (3,3)] # (xi',yi') # this should be auto-calculated
In [ ]: