How to check whether a given point is contained in a rectangle using the contains() function in Rect_ construct… Please give me the exact function and its parameters. Like when I type this
Point b(2,2);
Rect a(10,10,50,50);
cout<< Rect_::contains(b);
There is a compile error saying 1>c:\users\kaushal\documents\visual studio 2008\projects\test1\test1.cpp(23) : error C2352: 'cv::Rect_<_Tp>::contains' : illegal call of non-static member function
1>c:\opencv2.1\include\opencv\cxcore.hpp(385) : see declaration of 'cv::Rect_<_Tp>::contains'
You want to use the instance of
adefining the area to run the method for decidingacontainsb. The methodcontainsis not static, therefor you cannot call it on the class Rect.