本文整理汇总了C++中BLOBNBOX::ReInit方法的典型用法代码示例。如果您正苦于以下问题:C++ BLOBNBOX::ReInit方法的具体用法?C++ BLOBNBOX::ReInit怎么用?C++ BLOBNBOX::ReInit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BLOBNBOX
的用法示例。
在下文中一共展示了BLOBNBOX::ReInit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SizeFilterBlobs
// Helper function to divide the input blobs over noise, small, medium
// and large lists. Blobs small in height and (small in width or large in width)
// go in the noise list. Dash (-) candidates go in the small list, and
// medium and large are by height.
// SIDE-EFFECT: reset all blobs to initial state by calling Init().
static void SizeFilterBlobs(int min_height, int max_height,
BLOBNBOX_LIST* src_list,
BLOBNBOX_LIST* noise_list,
BLOBNBOX_LIST* small_list,
BLOBNBOX_LIST* medium_list,
BLOBNBOX_LIST* large_list) {
BLOBNBOX_IT noise_it(noise_list);
BLOBNBOX_IT small_it(small_list);
BLOBNBOX_IT medium_it(medium_list);
BLOBNBOX_IT large_it(large_list);
for (BLOBNBOX_IT src_it(src_list); !src_it.empty(); src_it.forward()) {
BLOBNBOX* blob = src_it.extract();
blob->ReInit();
int width = blob->bounding_box().width();
int height = blob->bounding_box().height();
if (height < min_height &&
(width < min_height || width > max_height))
noise_it.add_after_then_move(blob);
else if (height > max_height)
large_it.add_after_then_move(blob);
else if (height < min_height)
small_it.add_after_then_move(blob);
else
medium_it.add_after_then_move(blob);
}
}