1 | initial version |
There are multiple functions to do it. If you have a list of points, perspectiveTransform() is what you're looking for.
std::vector<cv::Point> inPts, outPts;
inpPts.push_back(cv::Point(3, 5));
perspectiveTransform(inPts, outPts, homography);
// now, you have the x', y' stored in outPts[0];
You may also want to convert an entire picture from one space to another - if you want to match pairs of points in two pictures, this is a common task.
So, given the currentPicture
, and pictureReference
, both declared as cv::Mat
, you can
warpPerspective(currentPicture, pictureReference, homography);
Here you can find docs for warpPerspective