
--- scribo/sandbox/raphael/code/my/document/clean.hh | 5 +++- .../sandbox/raphael/code/my/document/document.hh | 26 +++++++++++++++++-- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/scribo/sandbox/raphael/code/my/document/clean.hh b/scribo/sandbox/raphael/code/my/document/clean.hh index 66b0c93..335a575 100644 --- a/scribo/sandbox/raphael/code/my/document/clean.hh +++ b/scribo/sandbox/raphael/code/my/document/clean.hh @@ -139,10 +139,13 @@ namespace mymln { draw::line(out, q,v, mln::literal::green); doc.add_to_line_link(v, q); + doc.add_letter_coerce(q); } - else if (doc.allign_H(q, v) && doc.allign_top(q, v)) //ORDRE DESPARAMETRE ETRANGE A CHECK + else if (doc.allign_H_Large(v, q) && doc.allign_top(v, q)) { draw::line(out, q,v, mln::literal::magenta); + doc.add_to_line_link(v, q); + doc.add_letter_coerce(q); } } } diff --git a/scribo/sandbox/raphael/code/my/document/document.hh b/scribo/sandbox/raphael/code/my/document/document.hh index e898111..1bd44ac 100644 --- a/scribo/sandbox/raphael/code/my/document/document.hh +++ b/scribo/sandbox/raphael/code/my/document/document.hh @@ -189,6 +189,8 @@ namespace mymln {containers_mask(lbl) = false;} void inline add_letter(const point2d& point) {add_letter(img_influ(point)); } + void inline add_letter_coerce(const point2d& point) + {add_letter_coerce(img_influ(point)); } void add_alone_letter(const point2d& point) {add_alone_letter(img_influ(point));} void add_alone_letter(const Label lbl) @@ -201,7 +203,17 @@ namespace mymln alone_letters_mask(lbl) = true; noise_mask(lbl) = false; } - + void add_letter_coerce(const Label lbl) + { + + letters_mask(lbl) = true; + separators_mask(lbl) = false; + containers_mask(lbl) = false; + Vseparator_mask(lbl) = false; + Hseparator_mask(lbl) = false; + alone_letters_mask(lbl) = false; + noise_mask(lbl) = false; + } void add_letter(const Label lbl) { CLet++; @@ -320,10 +332,18 @@ namespace mymln inline bool allign_top( const Label Left, const Label Right) { - short int allignV = label_allign_(0, Left, Right) * 1.5f; - return _bboxgp[Left].pcenter()[0] < _bboxgp[Right].pcenter()[0]; + short int allignV = label_allign_(0, Left, Right); + return allignV < label_size_(0, Left) && (_bboxgp[Left].pcenter()[0]) > (_bboxgp[Right].pcenter()[0]); } + inline bool allign_H_Large( const point2d& Left, const point2d& Right) + {return allign_H_Large(img_influ(Left), img_influ(Right));} + + inline bool allign_H_Large( const Label Left, const Label Right) + { + short int allignV = label_allign_(1, Left, Right) * 1.5f; + return allignV < label_size_(1, Left); + } inline bool allign_H( const point2d& Left, const point2d& Right) {return allign_H(img_influ(Left), img_influ(Right));} -- 1.7.2.5