本文整理汇总了C++中AAM_Shape::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ AAM_Shape::resize方法的具体用法?C++ AAM_Shape::resize怎么用?C++ AAM_Shape::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AAM_Shape
的用法示例。
在下文中一共展示了AAM_Shape::resize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitShape
AAM_Shape AAMBody::InitShape(const AAM_Shape& pMeanShape)
{
cv::Size imgSize = imageMessageIn_->GetSize();
AAM_Shape detShape;
AAM_Shape startShape;
detShape.resize(2);
detShape[0].x = param_->boundingBox.x < 0 ? 0 : param_->boundingBox.x;
detShape[0].y = param_->boundingBox.y < 0 ? 0 : param_->boundingBox.y;
if(detShape[0].x > imgSize.width)
detShape[0].x = imgSize.width - param_->boundingBox.width;
if(detShape[0].y > imgSize.height)
detShape[0].y = imgSize.height - param_->boundingBox.height;
detShape[1].x = detShape[0].x + param_->boundingBox.width;
detShape[1].y = detShape[0].y + param_->boundingBox.height;
if(detShape[1].x > imgSize.width)
detShape[1].x = imgSize.width - param_->boundingBox.width;
if(detShape[1].y > imgSize.height)
detShape[1].y = imgSize.height - param_->boundingBox.height;
AdjustShape(detShape);
AlignShape(startShape, detShape, pMeanShape);
return startShape;
}
示例2: CalcMeanShape
//============================================================================
void AAM_PDM::CalcMeanShape(AAM_Shape &MeanShape,
const std::vector<AAM_Shape> &AllShapes)
{
MeanShape.resize(AllShapes[0].NPoints());
MeanShape = 0;
for(int i = 0; i < (int)AllShapes.size(); i++) MeanShape += AllShapes[i];
MeanShape /= AllShapes.size();
}
示例3: ShapeAAMFromASM
static AAM_Shape ShapeAAMFromASM(const asm_shape& shape)
{
AAM_Shape s;
s.resize(shape.NPoints());
for(int i = 0; i < shape.NPoints(); i++)
{
s[i].x = shape[i].x;
s[i].y = shape[i].y;
}
return s;
}
示例4: InitShape
AAM_Shape AAMFit::InitShape( const AAM_Shape& pMeanShape, CvRect *pR, int pType = 0 )
{
AAM_Shape detShape;
AAM_Shape startShape;
detShape.resize(2);
detShape[0].x = pR->x;
detShape[0].y = pR->y;
detShape[1].x = detShape[0].x + pR->width;
detShape[1].y = detShape[0].y + pR->height;
if( pType == AAM_FIT_FACE )
AdjustFaceShape(detShape);
else if( pType == AAM_FIT_MOUTH )
AdjustMouthShape(detShape);
AlignShape(startShape, detShape, pMeanShape);
return startShape;
}