当前位置: 首页>>代码示例>>C++>>正文


C++ AAM_Shape::resize方法代码示例

本文整理汇总了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;
    }
开发者ID:aodkrisda,项目名称:face-gesture-api,代码行数:29,代码来源:AAMBody.cpp

示例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();
}
开发者ID:Belial2010,项目名称:pkmFace,代码行数:9,代码来源:AAM_PDM.cpp

示例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;
}
开发者ID:a543589796,项目名称:asmlibrary-android,代码行数:11,代码来源:DemoFit.cpp

示例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;
}
开发者ID:aodkrisda,项目名称:face-gesture-api,代码行数:20,代码来源:AAMFit.cpp


注:本文中的AAM_Shape::resize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。