If I have a Mat
image object (OpenCV) whose size is 960*720, on which I have calculated the coordinates of a Point
object, and then I scale this Mat image, and its new size is 640*480, how can I find the new coordinates of the Point
?
A point (x,y)
in the original matrix will be mapped to (x',y')
in the new matrix by
(x',y') = 2*(x,y)/3.
Reducing that to an OpenCV function we have:
cv::Point scale_point(cv::Point p) // p is location in 960*720 Mat
{
return 2 * p / 3; // return location in 640*480 Mat
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With