本文整理汇总了C++中VO_Shape::GetShapeRect方法的典型用法代码示例。如果您正苦于以下问题:C++ VO_Shape::GetShapeRect方法的具体用法?C++ VO_Shape::GetShapeRect怎么用?C++ VO_Shape::GetShapeRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VO_Shape
的用法示例。
在下文中一共展示了VO_Shape::GetShapeRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: translation
/**
* @brief First Estimation of the fitted shape by scaling only
* @param iShape -- input shape
* @param rect -- the rectangle to calculate the scalar
* @return VO_Shape -- the scaled shape
*/
VO_Shape VO_Fitting2DSM::VO_FirstEstimationByScaling( const VO_Shape& iShape,
const cv::Rect& rect )
{
VO_Shape res = iShape;
cv::Rect_<float> rect0 = iShape.GetShapeRect();
float fScaleX = (float)rect.width/rect0.width *0.80;
float fScaleY = (float)rect.height/rect0.height *0.80;
res.ScaleX(fScaleX);
res.ScaleY(fScaleY);
rect0 = iShape.GetShapeBoundRect();
cv::Mat_<float> translation = cv::Mat_<float>::zeros(2, 1);
float centerX = (float)rect.x + (float)rect.width/2.0f;
float centerY = (float)rect.y + (float)rect.height/2.0f;
float center0X = (float)rect0.x + (float)rect0.width/2.0f;
float center0Y = (float)rect0.x + (float)rect0.height/2.0f;
translation(0,0) = centerX - center0X;
translation(1,0) = centerY - center0Y;
res.Translate( translation );
return res;
}