tesseract
3.03
|
#include <math.h>
#include "chopper.h"
#include "assert.h"
#include "associate.h"
#include "blobs.h"
#include "callcpp.h"
#include "const.h"
#include "findseam.h"
#include "freelist.h"
#include "globals.h"
#include "makechop.h"
#include "render.h"
#include "pageres.h"
#include "seam.h"
#include "stopper.h"
#include "structures.h"
#include "unicharset.h"
#include "wordrec.h"
Go to the source code of this file.
Namespaces | |
namespace | tesseract |
Functions | |
preserve_outline_tree | |
Copy the list of outlines. | |
void | preserve_outline (EDGEPT *start) |
void | preserve_outline_tree (TESSLINE *srcline) |
restore_outline_tree | |
Copy the list of outlines. | |
EDGEPT * | restore_outline (EDGEPT *start) |
void | restore_outline_tree (TESSLINE *srcline) |
any_shared_split_points | |
Return true if any of the splits share a point with this one. | |
int | any_shared_split_points (const GenericVector< SEAM * > &seams, SEAM *seam) |
check_blob | |
| |
int | check_blob (TBLOB *blob) |
check_seam_order | |
Make sure that each of the splits in this seam match to outlines in this blob. If any of the splits could not correspond to this blob then there is a problem (and FALSE should be returned to the caller). | |
inT16 | check_seam_order (TBLOB *blob, SEAM *seam) |
inT16 | total_containment (TBLOB *blob1, TBLOB *blob2) |
int any_shared_split_points | ( | const GenericVector< SEAM * > & | seams, |
SEAM * | seam | ||
) |
Definition at line 283 of file chopper.cpp.
{ int length; int index; length = seams.size(); for (index = 0; index < length; index++) if (shared_split_points(seams[index], seam)) return TRUE; return FALSE; }
int check_blob | ( | TBLOB * | blob | ) |
Definition at line 300 of file chopper.cpp.
inT16 check_seam_order | ( | TBLOB * | blob, |
SEAM * | seam | ||
) |
Definition at line 397 of file chopper.cpp.
{ TESSLINE *outline; inT8 found_em[3]; if (seam->split1 == NULL || blob == NULL) return (TRUE); found_em[0] = found_em[1] = found_em[2] = FALSE; for (outline = blob->outlines; outline; outline = outline->next) { if (!found_em[0] && ((seam->split1 == NULL) || is_split_outline (outline, seam->split1))) { found_em[0] = TRUE; } if (!found_em[1] && ((seam->split2 == NULL) || is_split_outline (outline, seam->split2))) { found_em[1] = TRUE; } if (!found_em[2] && ((seam->split3 == NULL) || is_split_outline (outline, seam->split3))) { found_em[2] = TRUE; } } if (!found_em[0] || !found_em[1] || !found_em[2]) return (FALSE); else return (TRUE); }
void preserve_outline | ( | EDGEPT * | start | ) |
void preserve_outline_tree | ( | TESSLINE * | srcline | ) |
Definition at line 84 of file chopper.cpp.
{ TESSLINE *outline; for (outline = srcline; outline != NULL; outline = outline->next) { preserve_outline (outline->loop); } }
EDGEPT* restore_outline | ( | EDGEPT * | start | ) |
Definition at line 98 of file chopper.cpp.
{ EDGEPT *srcpt; EDGEPT *real_start; if (start == NULL) return NULL; srcpt = start; do { if (srcpt->flags[1] == 2) break; srcpt = srcpt->next; } while (srcpt != start); real_start = srcpt; do { srcpt = srcpt->next; if (srcpt->prev->flags[1] == 0) { remove_edgept(srcpt->prev); } } while (srcpt != real_start); return real_start; }
void restore_outline_tree | ( | TESSLINE * | srcline | ) |
Definition at line 124 of file chopper.cpp.
inT16 total_containment | ( | TBLOB * | blob1, |
TBLOB * | blob2 | ||
) |
Definition at line 702 of file chopper.cpp.
{ TBOX box1 = blob1->bounding_box(); TBOX box2 = blob2->bounding_box(); return box1.contains(box2) || box2.contains(box1); }