I am trying to find the homography between two sets of points using opencv. I have source src and destination dst and I am computing the homography H a follows.
import numpy as np
import cv2
src = np.array([[-47.59, -57.43, 139.59, 149.43, 46.],
[141.43, 31.03, -1.43, 108.97, 70.],
[579.23, 412.75, 422.55, 589.03, 500.89]])
dst = np.array([[-100, -100, 100, 100, 0],
[-100, 100, 100, -100, 0],
[0, 0, 0, 0, 0]])
H, _ = cv2.findHomography(src.T, dst.T)
print(np.allclose(H@src, dst))
OpenCV is computing the homography but when I try recovering the original dst using the computed H, it doesn't work. np.allclose(H@src, dst) gives False
However, if I take a closer look at the two arrays, the following is what I have.
There is a clear correspondence between the two sets of values. I would be almost be comfortable saying that they are just off by a scaling factor if it wasn't for the last row. Clearly a scaling factor of zero doesn't make sense. What am I missing here?
