Ask Your Question


asked 2019-05-25 05:02:33 -0500

kaito gravatar image

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?

Thanks in advance

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-05-25 19:30:46 -0500

Witek gravatar image

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)
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-05-25 05:02:33 -0500

Seen: 2,620 times

Last updated: May 25 '19