After we get the transformation matrix 'trans_mat' from the 'getPerspectiveTransform', we can transform a point in this way
1 2 3 4 5 | cv::Point2f src = cv::Point2f(123, 456); std::vector<cv::Point2f> in_pts, out_pts; in_pts.push_back(src); cv::perspectiveTransform(in_pts, out_pts, trans_mat); cv::Point2f dst = out_pts.front(); |
refer to:
https://blog.csdn.net/xiaowei_cqu/article/details/26478135