OpenCv中缩放Mat图像上点坐标的计算

use*_*888 5 scaling opencv mat

如果我有一个Mat大小为960*720 的图像对象(OpenCV),我已经计算了一个Point对象的坐标,然后我缩放这个Mat图像,它的新大小是640*480,我怎么能找到新的坐标Point

Bul*_*ull 1

原始矩阵中的点将(x,y)映射到(x',y')新矩阵中

(x',y') = 2*(x,y)/3.
Run Code Online (Sandbox Code Playgroud)

将其简化为 OpenCV 函数,我们有:

cv::Point scale_point(cv::Point p) // p is location in 960*720 Mat
{
    return 2 * p / 3;   // return location in 640*480 Mat
}
Run Code Online (Sandbox Code Playgroud)