$extrastylesheet
Functions | |
template<typename L > | |
object_groups< L > | scribo::filter::object_groups_mean_width (const object_groups< L > &groups, float width) |
template<typename L > | |
object_groups< L > | scribo::filter::object_groups_size_ratio (const object_groups< L > &groups, float max_size_ratio, float max_invalid_ratio_per_group) |
template<typename L > | |
object_groups< L > | scribo::filter::object_groups_small (const object_groups< L > &groups, unsigned n_links) |
template<typename L > | |
object_groups< L > | scribo::filter::object_groups_with_holes (const object_groups< L > &components, unsigned min_size) |
Component groups filtering routines.
object_groups<L> scribo::filter::object_groups_mean_width | ( | const object_groups< L > & | groups, |
float | width | ||
) |
Filter groups having their object mean width too low.
[in] | groups | Object group information. |
[in] | width | Object group mean width must be greater or equal to this value. |
object_groups<L> scribo::filter::object_groups_size_ratio | ( | const object_groups< L > & | groups, |
float | max_size_ratio, | ||
float | max_invalid_ratio_per_group | ||
) |
Invalidates groups with too much thin and high components.
For each components in the group, it computes the height/width ratio. If it is higher or equal to max_size_ratio
, the component is counted as invalid.
If there are max_invalid_ratio_per_group
invalid components, the group is invalidated.
object_groups<L> scribo::filter::object_groups_small | ( | const object_groups< L > & | groups, |
unsigned | n_links | ||
) |
Invalidate groups with few components.
[in] | groups | Information about object groups. |
[in] | n_links | The minimum number of links per group. |
|
inline |
Remove groups not having at least two background components of min_size
pixels.
In order to verify the property of "having two background components", a component group must have at least one component with a hole.
Example: the letter 'o' has two background components: outside and inside the letter.