tesseract
4.0.0-1-g2a2b
|
Go to the source code of this file.
Classes | |
struct | MFEDGEPT |
Macros | |
#define | NORMAL_X_HEIGHT (0.5) |
#define | NORMAL_BASELINE (0.0) |
#define | AverageOf(A, B) (((A) + (B)) / 2) |
#define | MF_SCALE_FACTOR (NORMAL_X_HEIGHT / kBlnXHeight) |
#define | DegenerateOutline(O) (((O) == NIL_LIST) || ((O) == list_rest(O))) |
#define | PointAt(O) ((MFEDGEPT *) first_node (O)) |
#define | NextPointAfter(E) (list_rest (E)) |
#define | MakeOutlineCircular(O) (set_rest (last (O), (O))) |
#define | ClearMark(P) ((P)->ExtremityMark = FALSE) |
#define | MarkPoint(P) ((P)->ExtremityMark = TRUE) |
Typedefs | |
typedef LIST | MFOUTLINE |
Enumerations | |
enum | DIRECTION { north, south, east, west, northeast, northwest, southeast, southwest } |
enum | OUTLINETYPE { outer, hole } |
enum | NORM_METHOD { baseline, character } |
Functions | |
void | ComputeBlobCenter (TBLOB *Blob, TPOINT *BlobCenter) |
LIST | ConvertBlob (TBLOB *Blob) |
MFOUTLINE | ConvertOutline (TESSLINE *Outline) |
LIST | ConvertOutlines (TESSLINE *Outline, LIST ConvertedOutlines, OUTLINETYPE OutlineType) |
void | FilterEdgeNoise (MFOUTLINE Outline, float NoiseSegmentLength) |
void | FindDirectionChanges (MFOUTLINE Outline, float MinSlope, float MaxSlope) |
void | FreeMFOutline (void *agr) |
void | FreeOutlines (LIST Outlines) |
void | MarkDirectionChanges (MFOUTLINE Outline) |
MFEDGEPT * | NewEdgePoint () |
MFOUTLINE | NextExtremity (MFOUTLINE EdgePoint) |
void | NormalizeOutline (MFOUTLINE Outline, float XOrigin) |
void | ChangeDirection (MFOUTLINE Start, MFOUTLINE End, DIRECTION Direction) |
void | CharNormalizeOutline (MFOUTLINE Outline, const DENORM &cn_denorm) |
void | ComputeDirection (MFEDGEPT *Start, MFEDGEPT *Finish, float MinSlope, float MaxSlope) |
MFOUTLINE | NextDirectionChange (MFOUTLINE EdgePoint) |
#define AverageOf | ( | A, | |
B | |||
) | (((A) + (B)) / 2) |
#define ClearMark | ( | P | ) | ((P)->ExtremityMark = FALSE) |
Definition at line 73 of file mfoutline.h.
Definition at line 67 of file mfoutline.h.
Definition at line 70 of file mfoutline.h.
#define MarkPoint | ( | P | ) | ((P)->ExtremityMark = TRUE) |
Definition at line 74 of file mfoutline.h.
#define MF_SCALE_FACTOR (NORMAL_X_HEIGHT / kBlnXHeight) |
Definition at line 64 of file mfoutline.h.
#define NextPointAfter | ( | E | ) | (list_rest (E)) |
Definition at line 69 of file mfoutline.h.
#define NORMAL_BASELINE (0.0) |
Definition at line 32 of file mfoutline.h.
#define NORMAL_X_HEIGHT (0.5) |
#define PointAt | ( | O | ) | ((MFEDGEPT *) first_node (O)) |
Definition at line 68 of file mfoutline.h.
Definition at line 34 of file mfoutline.h.
enum DIRECTION |
Enumerator | |
---|---|
north | |
south | |
east | |
west | |
northeast | |
northwest | |
southeast | |
southwest |
Definition at line 36 of file mfoutline.h.
enum NORM_METHOD |
Enumerator | |
---|---|
baseline | |
character |
Definition at line 54 of file mfoutline.h.
enum OUTLINETYPE |
Enumerator | |
---|---|
outer | |
hole |
Definition at line 50 of file mfoutline.h.
Change the direction of every vector in the specified outline segment to Direction. The segment to be changed starts at Start and ends at End. Note that the previous direction of End must also be changed to reflect the change in direction of the point before it.
Start,End | defines segment of outline to be modified |
Direction | new direction to assign to segment |
Definition at line 320 of file mfoutline.cpp.
This routine normalizes each point in Outline by translating it to the specified center and scaling it anisotropically according to the given scale factors.
Outline | outline to be character normalized |
cn_denorm |
Definition at line 339 of file mfoutline.cpp.
This routine computes the slope from Start to Finish and and then computes the approximate direction of the line segment from Start to Finish. The direction is quantized into 8 buckets: N, S, E, W, NE, NW, SE, SW Both the slope and the direction are then stored into the appropriate fields of the Start edge point. The direction is also stored into the PreviousDirection field of the Finish edge point.
Start | starting point to compute direction from |
Finish | finishing point to compute direction to |
MinSlope | slope below which lines are horizontal |
MaxSlope | slope above which lines are vertical |
Definition at line 378 of file mfoutline.cpp.
Convert a blob into a list of MFOUTLINEs (float-based microfeature format).
Definition at line 39 of file mfoutline.cpp.
Convert a TESSLINE into the float-based MFOUTLINE micro-feature format.
Definition at line 49 of file mfoutline.cpp.
LIST ConvertOutlines | ( | TESSLINE * | outline, |
LIST | mf_outlines, | ||
OUTLINETYPE | outline_type | ||
) |
Convert a tree of outlines to a list of MFOUTLINEs (lists of MFEDGEPTs).
outline | first outline to be converted |
mf_outlines | list to add converted outlines to |
outline_type | are the outlines outer or holes? |
Definition at line 91 of file mfoutline.cpp.
void FilterEdgeNoise | ( | MFOUTLINE | Outline, |
float | NoiseSegmentLength | ||
) |
void FindDirectionChanges | ( | MFOUTLINE | Outline, |
float | MinSlope, | ||
float | MaxSlope | ||
) |
This routine searches through the specified outline, computes a slope for each vector in the outline, and marks each vector as having one of the following directions: N, S, E, W, NE, NW, SE, SW This information is then stored in the outline and the outline is returned.
Outline | micro-feature outline to analyze |
MinSlope | controls "snapping" of segments to horizontal |
MaxSlope | controls "snapping" of segments to vertical |
Definition at line 118 of file mfoutline.cpp.
void FreeMFOutline | ( | void * | arg | ) |
This routine deallocates all of the memory consumed by a micro-feature outline.
arg | micro-feature outline to be freed |
Definition at line 150 of file mfoutline.cpp.
void FreeOutlines | ( | LIST | Outlines | ) |
Release all memory consumed by the specified list of outlines.
Outlines | list of mf-outlines to be freed |
Definition at line 172 of file mfoutline.cpp.
void MarkDirectionChanges | ( | MFOUTLINE | Outline | ) |
This routine searches through the specified outline and finds the points at which the outline changes direction. These points are then marked as "extremities". This routine is used as an alternative to FindExtremities(). It forces the endpoints of the microfeatures to be at the direction changes rather than at the midpoint between direction changes.
Outline | micro-feature outline to analyze |
Definition at line 190 of file mfoutline.cpp.
MFEDGEPT* NewEdgePoint | ( | ) |
Return a new edge point for a micro-feature outline.
Definition at line 212 of file mfoutline.cpp.
This routine returns the next point in the micro-feature outline that has a direction different than EdgePoint. The routine assumes that the outline being searched is not a degenerate outline (i.e. it must have 2 or more edge points).
EdgePoint | start search from this point |
Definition at line 449 of file mfoutline.cpp.
This routine returns the next point in the micro-feature outline that is an extremity. The search starts after EdgePoint. The routine assumes that the outline being searched is not a degenerate outline (i.e. it must have 2 or more edge points).
EdgePoint | start search from this point |
Definition at line 227 of file mfoutline.cpp.
void NormalizeOutline | ( | MFOUTLINE | Outline, |
float | XOrigin | ||
) |
This routine normalizes the coordinates of the specified outline so that the outline is deskewed down to the baseline, translated so that x=0 is at XOrigin, and scaled so that the height of a character cell from descender to ascender is 1. Of this height, 0.25 is for the descender, 0.25 for the ascender, and 0.5 for the x-height. The y coordinate of the baseline is 0.
Outline | outline to be normalized |
XOrigin | x-origin of text |
Definition at line 251 of file mfoutline.cpp.