# Get the proportional distance between Aruco markers?

I have a mostly flat rectangular surface with 4 Aruco markers, one at each corner. The markers are rotated so the first point of each marker is at the corner of the rectangle. I detect the markers using ArucoDetector.detectMarkers. Marker id 1 is defined as upper left, 2 upper right, 3 lower left, 4 lower right.

Now what I would like to do is given one additional point, find the U, V coordinates of where that point is, with respect to the 4 markers.

Upper left = 0,0
Upper right = 1,0
Lower left = 0,1
Lower right = 1,1
Middle = .5, .5
Upper middle = .5, 0
Middle left = 0, .5
Etc.

If it makes it more clear explaining with simple math, I have 4 points of a rectangle, and a point inside that rectangle. In this case, U is the proportional projected distance between the upper left and upper right corners. V is the proportional projected distance between the upper left and lower right corners. I want to do this, but in the context of Open CV.

If I understand what you are trying to do, it sounds to me like the perfect candidate for using a planar homography.

-Steve