本文整理汇总了C++中Segmentation::GetLabelTopLeft方法的典型用法代码示例。如果您正苦于以下问题:C++ Segmentation::GetLabelTopLeft方法的具体用法?C++ Segmentation::GetLabelTopLeft怎么用?C++ Segmentation::GetLabelTopLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Segmentation
的用法示例。
在下文中一共展示了Segmentation::GetLabelTopLeft方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: print_area_center
void print_area_center(Segmentation& seg, const std::string& name, int label, Image& output) {
int area; Coordinate center;
seg.GetCenterAndArea(label, center, area);
std::cout << name << " is located at " << center.GetX() << ", " << center.GetY() << " with area " << area << std::endl;
Coordinate point(seg.GetLabelTopLeft(label));
std::vector<int> freeman_code;
seg.GetFreemanCode(label, point, freeman_code);
seg.DrawContourFreeman(point, freeman_code, Color::red(), output);
const float circumference = seg.GetCircumference(freeman_code);
const float roundness = seg.GetRoundness(area, circumference);
std::cout << " Object has roundness of " << roundness << std::endl;
if (rint(roundness) >= 45) {
std::cout << " Object is a tree" << std::endl;
} else if (rint(roundness) >= 16) {
std::cout << " Object is a rectangle" << std::endl;
} else {
std::cout << " Object is a circle" << std::endl;
}
}