Reputation: 372
I wish to use WarpPerspective() on a single point.
Currently I am using it on an image and it's working :
Mat warpMatrix = CvInvoke.GetPerspectiveTransform(_srcCorners, _destCorners);
Image<Bgra, byte> dstImg = new Image<Bgra, byte>(width, height);
CvInvoke.WarpPerspective(img, dstImg, warpMatrix, new System.Drawing.Size(width, height),
Inter.Linear, Warp.Default, BorderType.Transparent);
I wish to do the same on a point (Pointf). I have made some test but everytime I get 0,0 :/. Example :
Mat warpMatrix = CvInvoke.GetPerspectiveTransform(_srcCorners, _destCorners);
VectorOfPointF src = new VectorOfPointF(new PointF[] { point });
VectorOfPointF ret = new VectorOfPointF();
CvInvoke.WarpPerspective(src, ret, warpMatrix, new Size(1,1),
Inter.Linear, Warp.Default, BorderType.Transparent);
Please, can you help me ? :)
Upvotes: 0
Views: 544
Reputation: 878
OpenCV uses a different function for transforming points and/or vectors. See the perspectiveTransform section of the documentation.
Upvotes: 1