"Fossies" - the Fresh Open Source Software Archive

Member "tesseract-ocr/doc/html/makechop_8h.html" (26 Oct 2012, 39539 Bytes) of package /linux/misc/old/tesseract-ocr-3.02.02-doc-html.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the tesseract-ocr-3.02.02-doc-html.tar.gz project site itself.

Tesseract  3.02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
makechop.h File Reference
#include "chop.h"
#include "olutil.h"

Go to the source code of this file.

Macros

#define is_split_outline(outline, split)

Functions

void apply_seam (TBLOB *blob, TBLOB *other_blob, bool italic_blob, SEAM *seam)
void form_two_blobs (TBLOB *blob, TBLOB *other_blob, bool italic_blob, const TPOINT &location)
void make_double_split (TBLOB *blob, TBLOB *other_blob, bool italic_blob, SEAM *seam)
void make_single_split (TESSLINE *outlines, SPLIT *split)
void make_split_blobs (TBLOB *blob, TBLOB *other_blob, bool italic_blob, SEAM *seam)
void make_triple_split (TBLOB *blob, TBLOB *other_blob, bool italic_blob, SEAM *seam)
void undo_seam (TBLOB *blob, TBLOB *other_blob, SEAM *seam)
void undo_single_split (TBLOB *blob, SPLIT *split)

Macro Definition Documentation

#define is_split_outline (   outline,
  split 
)
Value:
(outline->Contains(split->point1->pos) && \
outline->Contains(split->point2->pos)) \

Definition at line 44 of file makechop.h.


Function Documentation

void apply_seam ( TBLOB blob,
TBLOB other_blob,
bool  italic_blob,
SEAM seam 
)

Definition at line 52 of file makechop.cpp.

{
if (seam->split1 == NULL) {
divide_blobs(blob, other_blob, italic_blob, seam->location);
}
else if (seam->split2 == NULL) {
make_split_blobs(blob, other_blob, italic_blob, seam);
}
else if (seam->split3 == NULL) {
make_double_split(blob, other_blob, italic_blob, seam);
}
else {
make_triple_split(blob, other_blob, italic_blob, seam);
}
}
void form_two_blobs ( TBLOB blob,
TBLOB other_blob,
bool  italic_blob,
const TPOINT location 
)

Definition at line 74 of file makechop.cpp.

{
divide_blobs(blob, other_blob, italic_blob, location);
correct_blob_order(blob, other_blob);
}
void make_double_split ( TBLOB blob,
TBLOB other_blob,
bool  italic_blob,
SEAM seam 
)

Definition at line 93 of file makechop.cpp.

{
form_two_blobs(blob, other_blob, italic_blob, seam->location);
}
void make_single_split ( TESSLINE outlines,
SPLIT split 
)

Definition at line 107 of file makechop.cpp.

{
assert (outlines != NULL);
split_outline (split->point1, split->point2);
while (outlines->next != NULL)
outlines = outlines->next;
outlines->next = new TESSLINE;
outlines->next->loop = split->point1;
outlines->next->ComputeBoundingBox();
outlines = outlines->next;
outlines->next = new TESSLINE;
outlines->next->loop = split->point2;
outlines->next->ComputeBoundingBox();
outlines->next->next = NULL;
}
void make_split_blobs ( TBLOB blob,
TBLOB other_blob,
bool  italic_blob,
SEAM seam 
)

Definition at line 135 of file makechop.cpp.

{
form_two_blobs (blob, other_blob, italic_blob, seam->location);
}
void make_triple_split ( TBLOB blob,
TBLOB other_blob,
bool  italic_blob,
SEAM seam 
)

Definition at line 151 of file makechop.cpp.

{
form_two_blobs(blob, other_blob, italic_blob, seam->location);
}
void undo_seam ( TBLOB blob,
TBLOB other_blob,
SEAM seam 
)

Definition at line 168 of file makechop.cpp.

{
TESSLINE *outline;
if (!seam)
return; /* Append other blob outlines */
if (blob->outlines == NULL) {
blob->outlines = other_blob->outlines;
other_blob->outlines = NULL;
}
outline = blob->outlines;
while (outline->next)
outline = outline->next;
outline->next = other_blob->outlines;
other_blob->outlines = NULL;
delete other_blob;
if (seam->split1 == NULL) {
}
else if (seam->split2 == NULL) {
undo_single_split (blob, seam->split1);
}
else if (seam->split3 == NULL) {
undo_single_split (blob, seam->split1);
undo_single_split (blob, seam->split2);
}
else {
undo_single_split (blob, seam->split3);
undo_single_split (blob, seam->split2);
undo_single_split (blob, seam->split1);
}
}
void undo_single_split ( TBLOB blob,
SPLIT split 
)

Definition at line 211 of file makechop.cpp.

{
TESSLINE *outline1;
TESSLINE *outline2;
/* Modify edge points */
unsplit_outlines (split->point1, split->point2);
outline1 = new TESSLINE;
outline1->next = blob->outlines;
blob->outlines = outline1;
outline1->loop = split->point1;
outline2 = new TESSLINE;
outline2->next = blob->outlines;
blob->outlines = outline2;
outline2->loop = split->point2;
}