本文整理汇总了C++中Rect::Area方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect::Area方法的具体用法?C++ Rect::Area怎么用?C++ Rect::Area使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect::Area方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Estimate
/*!
Estimates shift of current image relative to background image.
\param [in] current - current image.
\param [in] region - a region at the background where the algorithm start to search current image. Estimated shift is taken relative of the region.
\param [in] maxShift - a 2D-point which characterizes maximal possible shift of the region (along X and Y axes).
\param [in] hiddenAreaPenalty - a parameter used to restrict searching of the shift at the border of background image.
\param [in] regionAreaMin - a parameter used to set minimal area of region use for shift estimation. By default is equal to 25.
\return a result of shift estimation.
*/
bool Estimate(const View & current, const Rect & region, const Point & maxShift, double hiddenAreaPenalty = 0, ptrdiff_t regionAreaMin = REGION_CORRELATION_AREA_MIN)
{
assert(current.Size() == region.Size() && region.Area() > 0);
assert(_current.Size() && _current[0].width >= current.width && _current[0].height >= current.height);
if (region.Area() < regionAreaMin)
return false;
InitLevels(region, maxShift, regionAreaMin);
SetCurrent(current, region);
Point shift;
for (ptrdiff_t i = _levels.size() - 1; i >= 0; i--)
{
shift.x *= 2;
shift.y *= 2;
if (!SearchLocalMin(_levels[i], shift, hiddenAreaPenalty))
return false;
shift = _levels[i].shift;
}
return true;
}
示例2: CompareRect
bool CompareRect(const Rect first,const Rect second){
if(first.Area() < second.Area())
return true;
else return false;
}
示例3: Area
bool Rect::operator<(const Rect &other) const
{
return Area() < other.Area();
}