# SINGLE POINT PERSPECTIVE TRANSFORM

Hi, I am new at this forum. I am using python with raspebrry pi3 to capture images (source images) from video (frames) and my camera is not perpendicular to planar object interesting for me. As I know coordinates relationship between 4 points coming from image source and the same 4 points in the final orthogonalized image, I use getPerspectiveTransform to obtain transformation matrix H and then I use warpPerspective to obtain orthogonalized image. It works perfect when I work with complete source and final images !!

The problem is that, due to limited raspberry capacity proccesor, I just want to use single point (x1,y1) from source image and obtain its correspondant transformed single point (x2,y2) in the orthogonalized image. I calculate (x2,y2) = matrix H x (x1,y1) and result is not correct.

Is there any function to obtain single point transformation once you know transformation matrix H between source and final orthogonalized image?

edit retag close merge delete

Sort by » oldest newest most voted

You're doing it almost right. Use homogeneous coordinates and it should work - at least it works for me.

Point3d p1(x1, y1, 1);
Point3d p2 = Point3d(Mat(H*Mat(p1))); //this is a complicated way to do: H*p1 - perhaps it can be done in a simpler way?
p2 /= p2.z; //normalize the output to get the right (x2, y2, 1)

more

Official site

GitHub

Wiki

Documentation