Home > Enterprise >  How to convert the OpenCV GetPerpectiveTransform Matrix into a CSS Matrix?
How to convert the OpenCV GetPerpectiveTransform Matrix into a CSS Matrix?

Time:01-17

I have a matrix from the Python Open-CV library:

M = cv2.getPerspectiveTransform(source_points, points)

But it is completely different from the enter image description here

With cv2.getPerspectiveTransform(source, target) I get the matrix:

array([[ 7.45735546e-01, -8.09538161e-02,  1.02930118e 01],
       [-4.69040997e-01,  8.60285055e-01,  7.66245963e 01],
       [-6.90849647e-04, -3.31231543e-04,  1.00000000e 00]])

And finally the cv2.wrapPerspective I get my image:

enter image description here

but if I try that same matrix with CSS transform, using the homogeneous matrix transform: matrix(0.74574, -0.46904, -0.08095, 0.86029, -88.57274000000001, -102.30782) and the same values of the cv2 matrix I get:

enter image description here

I tried to search for the getPerpectiveTransform algorithm but I just found examples on how to use it. What I’m missing?

CodePudding user response:

I solved it using the help of enter image description here

  • Related