tesseract-doxygen/wordrec/chop.cpp File Reference

#include "chop.h"
#include "oldheap.h"
#include "seam.h"
#include "blobs.h"
#include "chop.h"
#include <math.h>
#include "tessclas.h"
#include "general.h"
#include "tordvars.h"
#include "callcpp.h"
#include "oldlist.h"
#include "split.h"
#include "const.h"

Defines

length_product

Compute the product of the length of two vectors. The vectors must be of type POINT. This product is used in computing angles.

#define length_product(p1, p2)

Functions

point_priority

Assign a priority to and edge point that might be used as part of a split. The argument should be of type EDGEPT.

PRIORITY point_priority (EDGEPT *point)
add_point_to_list

Add an edge point to a POINT_GROUP containg a list of other points.

void add_point_to_list (POINT_GROUP point_list, EDGEPT *point)
angle_change

Return the change in angle (degrees) of the line segments between points one and two, and two and three.

int angle_change (EDGEPT *point1, EDGEPT *point2, EDGEPT *point3)
is_little_chunk

Return TRUE if one of the pieces resulting from this split would less than some number of edge points.

int is_little_chunk (EDGEPT *point1, EDGEPT *point2)
is_small_area

Test the area defined by a split accross this outline.

int is_small_area (EDGEPT *point1, EDGEPT *point2)
pick_close_point

Choose the edge point that is closest to the critical point. This point may not be exactly vertical from the critical point.

EDGEPTpick_close_point (EDGEPT *critical_point, EDGEPT *vertical_point, int *best_dist)
prioritize_points

Find a list of edge points from the outer outline of this blob. For each of these points assign a priority. Sort these points using a heap structure so that they can be visited in order.

void prioritize_points (TESSLINE *outline, POINT_GROUP points)
new_min_point

Found a new minimum point try to decide whether to save it or not. Return the new value for the local minimum. If a point is saved then the local minimum is reset to NULL.

void new_min_point (EDGEPT *local_min, POINT_GROUP points)
new_max_point

Found a new minimum point try to decide whether to save it or not. Return the new value for the local minimum. If a point is saved then the local minimum is reset to NULL.

void new_max_point (EDGEPT *local_max, POINT_GROUP points)
vertical_projection_point

For one point on the outline, find the corresponding point on the other side of the outline that is a likely projection for a split point. This is done by iterating through the edge points until the X value of the point being looked at is greater than the X value of the split point. Ensure that the point being returned is not right next to the split point. Return the edge point as a result.

void vertical_projection_point (EDGEPT *split_point, EDGEPT *target_point, EDGEPT **best_point)

Variables

int chop_debug = 0
bool chop_enable = 1
bool chop_vertical_creep = 0
int chop_split_length = 10000
int chop_same_distance = 2
int chop_min_outline_points = 6
int chop_inside_angle = -50
int chop_min_outline_area = 2000
double chop_split_dist_knob = 0.5
double chop_overlap_knob = 0.9
double chop_center_knob = 0.15
double chop_sharpness_knob = 0.06
double chop_width_change_knob = 5.0
double chop_ok_split = 100.0
double chop_good_split = 50.0
int chop_x_y_weight = 3

Define Documentation

#define length_product ( p1,
p2   ) 
Value:
(sqrt ((((float) (p1).x * (p1).x + (float) (p1).y * (p1).y) *    \
                        ((float) (p2).x * (p2).x + (float) (p2).y * (p2).y))))

Function Documentation

void add_point_to_list ( POINT_GROUP  point_list,
EDGEPT point 
)
int angle_change ( EDGEPT point1,
EDGEPT point2,
EDGEPT point3 
)
int is_little_chunk ( EDGEPT point1,
EDGEPT point2 
)
int is_small_area ( EDGEPT point1,
EDGEPT point2 
)
void new_max_point ( EDGEPT local_max,
POINT_GROUP  points 
)
void new_min_point ( EDGEPT local_min,
POINT_GROUP  points 
)
EDGEPT* pick_close_point ( EDGEPT critical_point,
EDGEPT vertical_point,
int *  best_dist 
)
PRIORITY point_priority ( EDGEPT point  ) 
void prioritize_points ( TESSLINE outline,
POINT_GROUP  points 
)
void vertical_projection_point ( EDGEPT split_point,
EDGEPT target_point,
EDGEPT **  best_point 
)

Variable Documentation

double chop_center_knob = 0.15

"Split center adjustment"

int chop_debug = 0

"Chop debug"

"Chop enable"

double chop_good_split = 50.0

"Good split limit"

int chop_inside_angle = -50

"Min Inside Angle Bend"

"Min Outline Area"

"Min Number of Points on Outline"

double chop_ok_split = 100.0

"OK split limit"

double chop_overlap_knob = 0.9

"Split overlap adjustment"

"Same distance"

double chop_sharpness_knob = 0.06

"Split sharpness adjustment"

double chop_split_dist_knob = 0.5

"Split length adjustment"

int chop_split_length = 10000

"Split Length"

"Vertical creep"

double chop_width_change_knob = 5.0

"Width change adjustment"

int chop_x_y_weight = 3

"X / Y length weight"

Generated on Sun Jul 18 17:10:52 2010 for Tesseract by  doxygen 1.6.3