3/22/2018

Check the rect contains point, opencv tip

https://docs.opencv.org/master/d2/d44/classcv_1_1Rect__.html#a367d5be1a40cc9d423f765ebf2721ee8


Use this function "Rect.contains(Point)".
example:

Rect roi(10,10,20,20);
Point pt(14,14);

if (roi.contains(pt))
  cout << "The pt inside in the rect" << endl;


Thank you.

No comments:

Post a Comment