wordrec/chop.h

Go to the documentation of this file.
00001 
00021 #ifndef CHOP_H
00022 #define CHOP_H
00023 
00024 /*----------------------------------------------------------------------
00025               I n c l u d e s
00026 ----------------------------------------------------------------------*/
00027 #include "oldheap.h"
00028 #include "seam.h"
00029 
00030 /*----------------------------------------------------------------------
00031               T y p e s
00032 ---------------------------------------------------------------------*/
00034 #define MAX_NUM_POINTS 50
00035 
00040 typedef HEAP *POINT_GROUP;
00045 typedef HEAP *SPLIT_GROUP;
00046 
00047 /*----------------------------------------------------------------------
00048               V a r i a b l e s
00049 ----------------------------------------------------------------------*/
00050 extern int chop_enable;
00051 extern int chop_debug;
00052 extern int same_distance;
00053 extern int split_length;
00054 extern float center_knob;
00055 extern float overlap_knob;
00056 extern float split_dist_knob;
00057 extern float width_change_knob;
00058 extern float sharpness_knob;
00059 extern int min_outline_area;
00060 extern int min_outline_points;
00061 extern float good_split;
00062 extern float ok_split;
00063 extern int chop_enable;
00064 
00065 /*----------------------------------------------------------------------
00066               M a c r o s
00067 ----------------------------------------------------------------------*/
00068 /* ================== */
00074 #define point_bend_angle(point) \
00075 (angle_change ((point)->prev, (point), (point)->next))
00076 
00077 /*----------------------------------------------------------------------
00078               F u n c t i o n s
00079 ----------------------------------------------------------------------*/
00080 PRIORITY point_priority(EDGEPT *point);
00081 
00082 void add_point_to_list(POINT_GROUP point_list, EDGEPT *point);
00083 
00084 int angle_change(EDGEPT *point1, EDGEPT *point2, EDGEPT *point3);
00085 
00086 void init_chop();
00087 
00088 int is_little_chunk(EDGEPT *point1, EDGEPT *point2);
00089 
00090 int is_small_area(EDGEPT *point1, EDGEPT *point2);
00091 
00092 EDGEPT *pick_close_point(EDGEPT *critical_point,
00093                          EDGEPT *vertical_point,
00094                          int *best_dist);
00095 
00096 void prioritize_points(TESSLINE *outline, POINT_GROUP points);
00097 
00098 void new_min_point(EDGEPT *local_min, POINT_GROUP points);
00099 
00100 void new_max_point(EDGEPT *local_max, POINT_GROUP points);
00101 
00102 // Changed from returning EDGEPT * and added best_point parameter
00103 void vertical_projection_point(EDGEPT *split_point, EDGEPT *target_point,
00104                                EDGEPT** best_point);
00105 
00106 /*
00107 #if defined(__STDC__) || defined(__cplusplus)
00108 # define _ARGS(s) s
00109 #else
00110 # define _ARGS(s) ()
00111 #endif*/
00112 
00113 /* chop.c
00114 PRIORITY point_priority
00115   _ARGS((EDGEPT *point));
00116 
00117 void add_point_to_list
00118   _ARGS((POINT_GROUP point_list,
00119   EDGEPT *point));
00120 
00121 SEAM *create_split
00122   _ARGS((BLOB *blob,
00123   POINT_GROUP points));
00124 
00125 SPLIT *extended_split
00126   _ARGS((INT32 location,
00127   EDGEPT *starting_point));
00128 
00129 SEAM *get_best_pair
00130   _ARGS((SPLIT_GROUP split_queue,
00131   BLOB *blob));
00132 
00133 void init_chop
00134   _ARGS((void));
00135 
00136 EDGEPT *pick_close_point
00137   _ARGS((EDGEPT *critical_point,
00138   EDGEPT *vertical_point,
00139   int *best_dist));
00140 
00141 void prioritize_points
00142   _ARGS((TESSLINE *outline,
00143   POINT_GROUP points));
00144 
00145 void new_min_point
00146   _ARGS((EDGEPT *local_min,
00147   POINT_GROUP points));
00148 
00149 void new_max_point
00150   _ARGS((EDGEPT *local_max,
00151   POINT_GROUP points));
00152 
00153 EDGEPT *vertical_projection_point
00154   _ARGS((EDGEPT *split_point,
00155   EDGEPT *target_point));
00156 
00157 #undef _ARGS
00158 */
00159 #endif

Generated on Wed Feb 28 19:49:13 2007 for Tesseract by  doxygen 1.5.1