Search code examples
pythonopencvimage-processingmatrixhomography

How does perspective transformation work? [OpenCV python]


Part of my dissertation involves rectifying a section of an image that is not in perfect frontal perspective. I can't add images because of my low score, but it's essentially this python code (with images).

I've already built the program and it works, but I don't understand the math behind it. I've looked into matrix image rectification and homography, but there is a huge skill gap to the point I can't understand any of it. I'm not sure where to start learning the math. I know the basics of matrices and that's about it. I want to get to the point where I can code the matrix transformation function myself.

In an nutshell, what do I need to "study" to understand the math?

Thank you.


Solution

  • I'm sure it's impossible, but you can try. In fact, projective geometry is a deep mathematical concept that is studied in mathematical specialties of universities. If you really want to understand it well, you have to become a bit of a mathematician. Projective geometry is studied after linear algebra, analytic geometry and affine geometry, in this sequence. But I doubt you need it all. You can consider a simplified approach focused on image processing, such as here and here