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


C++ ModelPtr::Size方法代码示例

本文整理汇总了C++中ModelPtr::Size方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelPtr::Size方法的具体用法?C++ ModelPtr::Size怎么用?C++ ModelPtr::Size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModelPtr的用法示例。


在下文中一共展示了ModelPtr::Size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ShowSegmentPoints

void Optimizer::ShowSegmentPoints(InputPtr input, ModelPtr model, Parameter* para) const
{
	int num = 0;

	model->EnableIterator(ModelImage::NOSE);
	num = model->Size(ModelImage::NOSE);

	for (int i = 0; i < num; ++i)
	{
		ivec2 pos = para->ComputePosition(i);
		vec3 rgb = para->ComputeColor(i);
		//vec3 rgb = input_image->GetColor(Point(pos[0], pos[1]));
		//Vec3b color(static_cast<uchar>(rgb[2]), static_cast<uchar>(rgb[1]), static_cast<uchar>(rgb[0]));
		Vec3b color(0, 0, 255);
		model->WriteColor(pos[0], pos[1], color);
	}


	model->EnableIterator(ModelImage::EYE);
	num = model->Size(ModelImage::EYE);

	for (int i = 0; i < num; ++i)
	{
		ivec2 pos = para->ComputePosition(i);
		vec3 rgb = para->ComputeColor(i);
		//vec3 rgb = input_image->GetColor(Point(pos[0], pos[1]));
		//Vec3b color(static_cast<uchar>(rgb[2]), static_cast<uchar>(rgb[1]), static_cast<uchar>(rgb[0]));
		Vec3b color(0, 255, 0);
		model->WriteColor(pos[0], pos[1], color);
	}


	model->EnableIterator(ModelImage::MOUTH);
	num = model->Size(ModelImage::MOUTH);

	for (int i = 0; i < num; ++i)
	{
		ivec2 pos = para->ComputePosition(i);
		vec3 rgb = para->ComputeColor(i);
		//vec3 rgb = input_image->GetColor(Point(pos[0], pos[1]));
		//Vec3b color(static_cast<uchar>(rgb[2]), static_cast<uchar>(rgb[1]), static_cast<uchar>(rgb[0]));
		Vec3b color(0, 255, 255);
		model->WriteColor(pos[0], pos[1], color);
	}


	model->EnableIterator(ModelImage::REST);
	num = model->Size(ModelImage::REST);

	for (int i = 0; i < num; ++i)
	{
		ivec2 pos = para->ComputePosition(i);
		vec3 rgb = para->ComputeColor(i);
		//vec3 rgb = input_image->GetColor(Point(pos[0], pos[1]));
		//Vec3b color(static_cast<uchar>(rgb[2]), static_cast<uchar>(rgb[1]), static_cast<uchar>(rgb[0]));
		Vec3b color(255, 0, 0);
		model->WriteColor(pos[0], pos[1], color);
	}

}
开发者ID:tpys,项目名称:face-reconstruction-from-one-frontal-image,代码行数:60,代码来源:optimizer.cpp

示例2: ShowVisiblePoints

void Optimizer::ShowVisiblePoints(InputPtr input, ModelPtr model, Parameter* para) const
{
	int num = model->Size();
	for (int i = 0; i<num;++i)
	{
		ivec2 pos = para->ComputePosition(i);
		vec3 rgb = para->ComputeColor(i);
		//vec3 rgb = input_image->GetColor(Point(pos[0], pos[1]));
		//Vec3b color(static_cast<uchar>(rgb[2]), static_cast<uchar>(rgb[1]), static_cast<uchar>(rgb[0]));
		Vec3b color(0, 0, 255);
		model->WriteColor(pos[0], pos[1], color);
	}
	cout << "visible triangle number = " << num << endl;
}
开发者ID:tpys,项目名称:face-reconstruction-from-one-frontal-image,代码行数:14,代码来源:optimizer.cpp

示例3: ShowShadowPoints

void Optimizer::ShowShadowPoints(InputPtr input, ModelPtr model, Parameter* para) const
{
	int num = model->Size();
	int shadow_counter = 0;
	for (int i = 0; i< num; ++i)
	{
		
		if (model->visible_triangles_[i].cast_shadow)
		{
			++shadow_counter;
			ivec2 pos = para->ComputePosition(i);
			vec3 rgb = para->ComputeColor(i);
			//vec3 rgb = input_image->GetColor(Point(pos[0], pos[1]));
		//	Vec3b color(static_cast<uchar>(rgb[2]), static_cast<uchar>(rgb[1]), static_cast<uchar>(rgb[0]));
			Vec3b color(0, 0, 255);
			model->WriteColor(pos[0], pos[1], color);
		}
	}
	cout << "shadow triangle number = " << shadow_counter << endl;

}
开发者ID:tpys,项目名称:face-reconstruction-from-one-frontal-image,代码行数:21,代码来源:optimizer.cpp


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