$extrastylesheet
Olena  User documentation 2.1
An Image Processing Platform
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
scribo::primitive::link Namespace Reference

Functions

template<typename F >
object_links< scribo_support(F)> compute (Link_Functor< F > &functor, anchor::Type anchor)
template<typename F >
object_links< scribo_support(F)> compute (Link_Functor< F > &functor)
template<typename F >
object_links< scribo_support(F)> compute_several (Link_Functor< F > &functor)
template<typename L >
object_links< L > left (const component_set< L > &components, unsigned dmax)
template<typename L >
mln::util::couple
< object_links< L >
, object_links< L > > 
left_right (const component_set< L > &components)
template<typename L >
object_links< L > merge_double_link (const object_links< L > &left_link, const object_links< L > &right_link)
template<typename L >
object_links< L > merge_double_link_closest_aligned (const object_links< L > &left, const object_links< L > &right, anchor::Type anchor_angle)
template<typename L >
mln::util::graph with_graph (const component_set< L > &comps, unsigned neighb_max_distance)
template<typename L , typename N >
util::couple< mln::util::graph,
typename mln::trait::concrete
< L >::ret
with_rag (const component_set< L > &comps, const Neighborhood< N > &nbh)
template<typename L >
mln::util::graph with_several_graphes (const component_set< L > &comps, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_several_left_links (const component_set< L > &objects, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_several_left_links (const component_set< L > &comps)
template<typename L >
object_links< L > with_several_right_closest_links (const component_set< L > &comps, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_several_right_closest_links (const component_set< L > &comps)
template<typename L >
object_links< L > with_several_right_links (const component_set< L > &comps, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_several_right_links (const component_set< L > &comps)
template<typename L >
object_links< L > with_several_right_links_overlap (const object_image(L)&objects, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_several_right_links_overlap (const object_image(L)&objects)
template<typename L >
object_links< L > with_single_down_link (const component_set< L > &comps, unsigned neighb_max_distance, anchor::Type anchor)
template<typename L >
object_links< L > with_single_down_link (const component_set< L > &comps, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_single_down_link (const component_set< L > &comps)
template<typename L >
object_links< L > with_single_left_link (const component_set< L > &components, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_single_left_link (const component_set< L > &components)
template<typename L , typename F >
object_links< L > with_single_left_link_dmax_ratio (const component_set< L > &components, const DMax_Functor< F > &dmax_f, anchor::Type anchor)
template<typename L , typename F >
object_links< L > with_single_left_link_dmax_ratio (const component_set< L > &components, float dmax_ratio, anchor::Type anchor)
template<typename L >
object_links< L > with_single_left_link_dmax_ratio (const component_set< L > &components, float dmax_ratio)
template<typename L , typename F >
object_links< L > with_single_left_link_dmax_ratio (const component_set< L > &components)
template<typename L , typename F >
object_links< L > with_single_left_link_dmax_ratio_aligned (const component_set< L > &components, const DMax_Functor< F > &dmax_f, float min_angle, float max_angle, anchor::Type anchor)
template<typename L >
object_links< L > with_single_left_link_dmax_ratio_aligned (const component_set< L > &components, float dmax_ratio, float min_angle, float max_angle)
template<typename L >
object_links< L > with_single_left_link_dmax_ratio_aligned (const component_set< L > &components)
template<typename L >
object_links< L > with_single_right_link (const component_set< L > &components, unsigned neighb_max_distance, anchor::Type anchor=anchor::MassCenter)
template<typename L >
object_links< L > with_single_right_link (const component_set< L > &components)
template<typename L >
object_links< L > with_single_right_link_bottom (const component_set< L > &components, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_single_right_link_bottom (const component_set< L > &components)
template<typename L , typename F >
object_links< L > with_single_right_link_dmax_ratio (const component_set< L > &components, const DMax_Functor< F > &dmax_f, anchor::Type anchor)
template<typename L >
object_links< L > with_single_right_link_dmax_ratio (const component_set< L > &components, float dmax_ratio, anchor::Type anchor)
template<typename L >
object_links< L > with_single_right_link_dmax_ratio (const component_set< L > &components, float dmax_ratio)
template<typename L >
object_links< L > with_single_right_link_dmax_ratio (const component_set< L > &components)
template<typename L >
object_links< L > with_single_right_link_dmax_ratio_aligned (const component_set< L > &components, float dmax_ratio, float min_angle, float max_angle, anchor::Type anchor)
template<typename L >
object_links< L > with_single_right_link_dmax_ratio_aligned (const component_set< L > &components, float dmax_ratio, float min_angle, float max_angle)
template<typename L >
object_links< L > with_single_right_link_dmax_ratio_aligned (const component_set< L > &components)
template<typename L >
object_links< L > with_single_right_link_top (const component_set< L > &components, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_single_right_link_top (const component_set< L > &components)
template<typename L >
object_links< L > with_single_up_link (const component_set< L > &comps, unsigned neighb_max_distance, anchor::Type anchor)
template<typename L >
object_links< L > with_single_up_link (const component_set< L > &comps, unsigned neighb_max_distance)
template<typename L >
object_links< L > with_single_up_link (const component_set< L > &comps)

Detailed Description

Namespace of primitive linking related routines.

Function Documentation

template<typename F >
object_links<scribo_support(F)> scribo::primitive::link::compute ( Link_Functor< F > &  functor,
anchor::Type  anchor 
)

Compute links between objects according a given functor.

Parameters
[in,out]functorLinking policy.
[in]anchorLookup anchor. Starts looking for neighbors from there.
Returns
Object links.

Functors must implement the following interface :

bool is_potential_link_(unsigned current_object, const P& start_point, const P& p) const

bool valid_link_(unsigned current_object, const P& start_point, const P& p)

bool verify_link_criterion_(unsigned current_object, const P& start_point, const P& p)

void validate_link_(unsigned current_object, const P& start_point, const P& p, unsigned anchor)

void invalidate_link_(unsigned current_object, const P& start_point, const P& p, unsigned anchor)

void compute_next_site_(P& p)

const mln_site(L)& start_point_(unsigned current_object, unsigned anchor)

void start_processing_object_(unsigned current_object)

template<typename F >
object_links<scribo_support(F)> scribo::primitive::link::compute ( Link_Functor< F > &  functor)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.The default anchor is set to anchor::MassCenter.

template<typename F >
object_links<scribo_support(F)> scribo::primitive::link::compute_several ( Link_Functor< F > &  functor)

Compute_Several links between objects according a given functor.

Parameters
[in,out]functorLinking policy.
Returns
Object links.

Functors must implement the following interface :

bool verify_link_criterion_(unsigned current_object, const P& start_point, const P& p) const;

void start_processing_object_(unsigned current_object);

mln_site(L) start_point_(unsigned current_object, unsigned anchor);

void validate_link_(unsigned current_object, const P& start_point, const P& p, unsigned anchor); void invalidate_link_(unsigned current_object, const P& start_point, const P& p, unsigned anchor);

void initialize_link_(unsigned current_object); void finalize_link_(unsigned current_object);

bool is_potential_link(unsigned current_object, const P& start_point, const P& p) const

void compute_next_site(P& p)

template<typename L >
object_links<L> scribo::primitive::link::merge_double_link ( const object_links< L > &  left_link,
const object_links< L > &  right_link 
)

Validate and merge double link information. A link must exist in both ways to be validated.

Parameters
[in]left_linkThe left neighbor of each line of text.
[in]right_linkThe right neighbor of each line of text.
Returns
The merge of left_link and right_link.
template<typename L >
object_links<L> scribo::primitive::link::merge_double_link_closest_aligned ( const object_links< L > &  left,
const object_links< L > &  right,
anchor::Type  anchor_angle 
)

Merge two object links data based on distance and angle.

Performs an 'OR' operation on the links according distance and angle criterion.

If a component has several incoming links, only the link for which the the object is the closest or the angle performed between the two bboxes is the lower, will be preserved.

template<typename L >
mln::util::graph scribo::primitive::link::with_graph ( const component_set< L > &  comps,
unsigned  neighb_max_distance 
)

Construct the links between each line of text and store it as a graph. Look up for neighbors on the right of each box.

Parameters
[in]compsA component set.
[in]neighb_max_distanceThe maximum distance allowed to look for a neighbor.
Returns
A graph of relationship.
template<typename L , typename N >
util::couple<mln::util::graph, typename mln::trait::concrete< L >::ret> scribo::primitive::link::with_rag ( const component_set< L > &  comps,
const Neighborhood< N > &  nbh 
)

Link components with a region adjacency graph.

template<typename L >
mln::util::graph scribo::primitive::link::with_several_graphes ( const component_set< L > &  comps,
unsigned  neighb_max_distance 
)

Link character bounding boxes with several graphes.

Look up for neighbors on the left of each box.

template<typename L >
object_links<L> scribo::primitive::link::with_several_left_links ( const component_set< L > &  objects,
unsigned  neighb_max_distance 
)
inline

Map each character bounding box to its left bounding box neighbor if possible.

Iterate to the right but link boxes to the left.

Returns
object links data.
template<typename L >
object_links<L> scribo::primitive::link::with_several_left_links ( const component_set< L > &  comps)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename L >
object_links<L> scribo::primitive::link::with_several_right_closest_links ( const component_set< L > &  comps,
unsigned  neighb_max_distance 
)
inline

Map each character bounding box to its right bounding box neighbor if possible.

If there are several right neighbor, the closest one is chosen.

Returns
an mln::util::array. Map a bounding box to its right neighbor.
template<typename L >
object_links<L> scribo::primitive::link::with_several_right_closest_links ( const component_set< L > &  comps)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename L >
object_links<L> scribo::primitive::link::with_several_right_links ( const component_set< L > &  comps,
unsigned  neighb_max_distance 
)
inline

Map each character bounding box to its right bounding box neighbor if possible.

Iterate to the right but link boxes to the right.

Returns
Object links.
template<typename L >
object_links<L> scribo::primitive::link::with_several_right_links ( const component_set< L > &  comps)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename L >
object_links<L> scribo::primitive::link::with_several_right_links_overlap ( const object_image(L)&  objects,
unsigned  neighb_max_distance 
)
inline

Map each character bounding box to its right bounding box neighbor if possible.

Iterate to the right but link boxes to the right.

Returns
an mln::util::array. Map a bounding box to its right neighbor.
template<typename L >
object_links<L> scribo::primitive::link::with_several_right_links_overlap ( const object_image(L)&  objects)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<typename L >
object_links<L> scribo::primitive::link::with_single_down_link ( const component_set< L > &  comps,
unsigned  neighb_max_distance,
anchor::Type  anchor 
)
inline

Link objects with their down neighbor if exists.

Parameters
[in]compsA component set.
[in]neighb_max_distanceThe maximum distance allowed to seach a neighbor object.
[in]anchorThe neighborhod lookup start point.
Returns
Object links data.
template<typename L >
object_links<L> scribo::primitive::link::with_single_down_link ( const component_set< L > &  comps,
unsigned  neighb_max_distance 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Anchor type is set to anchor::MassCenter.

template<typename L >
object_links<L> scribo::primitive::link::with_single_down_link ( const component_set< L > &  comps)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Max distance is set to mln_max(unsigned).

template<typename L >
object_links<L> scribo::primitive::link::with_single_left_link ( const component_set< L > &  components,
unsigned  neighb_max_distance 
)
inline

Link components with their left neighbor if exists.

Parameters
[in]componentsA component set.
[in]neighb_max_distanceThe maximum distance allowed to seach a neighbor object.
Returns
Object links data.
template<typename L >
object_links<L> scribo::primitive::link::with_single_left_link ( const component_set< L > &  components)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Max distance is set to mln_max(unsigned).

template<typename L , typename F >
object_links<L> scribo::primitive::link::with_single_left_link_dmax_ratio ( const component_set< L > &  components,
const DMax_Functor< F > &  dmax_f,
anchor::Type  anchor 
)
inline

Link components with their left neighbor if exists.

Parameters
[in]componentsA component set.
[in]anchorStarting point for the neighbor lookup.
[in]dmax_fDMax functor defining the maximum lookup distance.
Returns
Object links data.

Look for a neighbor until a maximum distance is reached. The maximum distance is defined thanks to a functor dmax_f.

template<typename L , typename F >
object_links<L> scribo::primitive::link::with_single_left_link_dmax_ratio ( const component_set< L > &  components,
float  dmax_ratio,
anchor::Type  anchor 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The default dmax functor is used (internal::dmax_default).

template<typename L >
object_links<L> scribo::primitive::link::with_single_left_link_dmax_ratio ( const component_set< L > &  components,
float  dmax_ratio 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.anchor is set to anchor::MassCenter.

template<typename L , typename F >
object_links<L> scribo::primitive::link::with_single_left_link_dmax_ratio ( const component_set< L > &  components)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The default dmax functor is used (internal::dmax_default) with dmax_ratio set to 3.

anchor is set to anchor::MassCenter.

template<typename L , typename F >
object_links<L> scribo::primitive::link::with_single_left_link_dmax_ratio_aligned ( const component_set< L > &  components,
const DMax_Functor< F > &  dmax_f,
float  min_angle,
float  max_angle,
anchor::Type  anchor 
)
inline

Link objects with their left neighbor if exists.

Parameters
[in]componentsA component set.
[in]dmax_fA function defining the maximum lookup distance.
[in]min_angleMinimum difference allowed for alignement angle.
[in]max_angleMaximum difference allowed for alignement angle.
[in]anchorStarting point for the neighbor lookup.
Returns
Object links data.

Look for a neighbor until a maximum distance defined by :

dmax = w / 2 + dmax_ratio * max(h, w)

where w is the bounding box width and h the bounding box height.

template<typename L >
object_links<L> scribo::primitive::link::with_single_left_link_dmax_ratio_aligned ( const component_set< L > &  components,
float  dmax_ratio,
float  min_angle,
float  max_angle 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.anchor is set to MassCenter.

dmax_f functor is set to internal::dmax_default.

template<typename L >
object_links<L> scribo::primitive::link::with_single_left_link_dmax_ratio_aligned ( const component_set< L > &  components)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.dmax_ratio is set to 3.

anchor is set to MassCenter.

template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link ( const component_set< L > &  components,
unsigned  neighb_max_distance,
anchor::Type  anchor = anchor::MassCenter 
)
inline

Link components with their right neighbor if exists.

Lookup startup point is the object mass center.

Parameters
[in]componentsAn object image.
[in]neighb_max_distanceThe maximum distance allowed to seach a neighbor object.
[in]anchorAnchor from where the neighbor lookup is performed.
Returns
Object links data.
template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link ( const component_set< L > &  components)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Max distance is set to mln_max(unsigned).

template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_bottom ( const component_set< L > &  components,
unsigned  neighb_max_distance 
)
inline

Link components with their right neighbor if exists.

Lookup startup point is the object bottom center.

Parameters
[in]componentsA component set.
[in]neighb_max_distanceThe maximum distance allowed to seach a neighbor object.
Returns
Object links data.
template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_bottom ( const component_set< L > &  components)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Max distance is set to mln_max(unsigned).

template<typename L , typename F >
object_links<L> scribo::primitive::link::with_single_right_link_dmax_ratio ( const component_set< L > &  components,
const DMax_Functor< F > &  dmax_f,
anchor::Type  anchor 
)
inline

Link objects with their right neighbor if exists.

Parameters
[in]componentsA component set.
[in]anchorStarting point for the neighbor lookup.
[in]dmax_fDMax functor defining the maximum lookup distance.
Returns
Object links data.

Look for a neighbor until a maximum distance is reached. The maximum distance is defined thanks to a functor dmax_f.

template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_dmax_ratio ( const component_set< L > &  components,
float  dmax_ratio,
anchor::Type  anchor 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.dmax_f is set to internal::dmax_default.

template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_dmax_ratio ( const component_set< L > &  components,
float  dmax_ratio 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.anchor is set to MassCenter.

template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_dmax_ratio ( const component_set< L > &  components)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.dmax_ratio is set to 3.

anchor is set to MassCenter.

template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_dmax_ratio_aligned ( const component_set< L > &  components,
float  dmax_ratio,
float  min_angle,
float  max_angle,
anchor::Type  anchor 
)
inline

Link objects with their right neighbor if exists.

Parameters
[in]componentsA component set.
[in]dmax_ratioSize ratio defining the maximum lookup distance.
[in]min_angleMinimum difference allowed for alignement angle.
[in]max_angleMaximum difference allowed for alignement angle.
[in]anchorStarting point for the neighbor lookup.
Returns
Object links data.

Look for a neighbor until a maximum distance defined by :

dmax = w / 2 + dmax_ratio * max(h, w)

where w is the bounding box width and h the bounding box height.

template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_dmax_ratio_aligned ( const component_set< L > &  components,
float  dmax_ratio,
float  min_angle,
float  max_angle 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.anchor is set to MassCenter.

template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_dmax_ratio_aligned ( const component_set< L > &  components)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.dmax_ratio is set to 3.

anchor is set to MassCenter.

template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_top ( const component_set< L > &  components,
unsigned  neighb_max_distance 
)
inline

Link components with their right neighbor if exists.

Lookup startup point is the object top center.

Parameters
[in]componentsA component set.
[in]neighb_max_distanceThe maximum distance allowed to seach a neighbor object.
Returns
Object links data.
template<typename L >
object_links<L> scribo::primitive::link::with_single_right_link_top ( const component_set< L > &  components)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Max distance is set to mln_max(unsigned).

template<typename L >
object_links<L> scribo::primitive::link::with_single_up_link ( const component_set< L > &  comps,
unsigned  neighb_max_distance,
anchor::Type  anchor 
)
inline

Link components with their up neighbor if exists.

Parameters
[in]compsA component set.
[in]neighb_max_distanceThe maximum distance allowed to seach a neighbor object.
[in]anchorThe neighborhod lookup start point.
Returns
Object links data.
template<typename L >
object_links<L> scribo::primitive::link::with_single_up_link ( const component_set< L > &  comps,
unsigned  neighb_max_distance 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Anchor type is set to anchor::Center.

template<typename L >
object_links<L> scribo::primitive::link::with_single_up_link ( const component_set< L > &  comps)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Max distance is set to mln_max(unsigned).