Finding a non-linear transformation matrix (like a fun house mirror)

88 views Asked by At

What is the most efficient way to find a non-linear transformation matrix.

Conceptually, imagine a a normal image of a person and then the funhouse mirror image of the same person. funhouseimage

How do you find 'mirror?' - the matrix you could apply to a normal image that will give you a funhouse mirror image distorted in the same way?

Should be generalizable to higher dimensions. If I have an item with a vector using embedding method 1 and a vector using embedding method 2, how do I find a matrix that will allow me to project a new item with embedding 1 into the embedding method 2 vector space?

I've used the following linear solution using least squares:

M=np.linalg.lstsq(source_mtrx[:n],target_mtrx[:n])[0]

# apply this tranformation to source matrix:
new_mtrx= np.array([np.dot(i, M) for i in source_mtrx])

but I think I need a non-linear solution for better results.

0

There are 0 answers