本文整理汇总了C++中ModelPtr::WriteColor方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelPtr::WriteColor方法的具体用法?C++ ModelPtr::WriteColor怎么用?C++ ModelPtr::WriteColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelPtr
的用法示例。
在下文中一共展示了ModelPtr::WriteColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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;
}
示例3: ShowRandomPoints
void Optimizer::ShowRandomPoints(InputPtr input, ModelPtr model, Parameter* para) const
{
int num = random_points_.size();
for (int t = 0; t < num; ++t)
{
int id = random_points_[t];
ivec2 pos = para->ComputePosition(id);
//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, 0);
model->WriteColor(pos[0], pos[1], color);
}
}
示例4: 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;
}