00001
00020 #ifndef PITSYNC1_H
00021 #define PITSYNC1_H
00022
00023 #include "elst.h"
00024 #include "clst.h"
00025 #include "blobbox.h"
00026 #include "varable.h"
00027 #include "statistc.h"
00028 #include "pithsync.h"
00029 #include "notdll.h"
00030 #include "notdll.h"
00031
00032 class FPSEGPT_LIST;
00033
00040 class FPSEGPT:public ELIST_LINK
00041 {
00042 public:
00043 FPSEGPT() {
00044 }
00045 FPSEGPT(
00046 INT16 x);
00047 FPSEGPT(
00048 INT16 x,
00049 BOOL8 faking,
00050 INT16 offset,
00051 INT16 region_index,
00052 INT16 pitch,
00053 INT16 pitch_error,
00054 FPSEGPT_LIST *prev_list);
00055 FPSEGPT(FPCUTPT *cutpt);
00056
00057 INT32 position() {
00058 return xpos;
00059 }
00060 double cost_function() {
00061 return cost;
00062 }
00063 double squares() {
00064 return sq_sum;
00065 }
00066 double sum() {
00067 return mean_sum;
00068 }
00069 FPSEGPT *previous() {
00070 return pred;
00071 }
00072 INT16 cheap_cuts() const {
00073 return mid_cuts;
00074 }
00075
00076
00077 NEWDELETE2 (FPSEGPT) BOOL8 faked;
00078 BOOL8 terminal;
00079 INT16 fake_count;
00080
00081 private:
00082 INT16 mid_cuts;
00083 INT32 xpos;
00084 FPSEGPT *pred;
00085 double mean_sum;
00086 double sq_sum;
00087 double cost;
00088 };
00089
00090 ELISTIZEH (FPSEGPT) CLISTIZEH (FPSEGPT_LIST)
00091
00114 extern BOOL_VAR_H (pitsync_projection_fix, FALSE,
00115 "Fix bug in projection profile");
00116 extern INT_VAR_H (pitsync_linear_version, 0, "Use new fast algorithm");
00117 extern double_VAR_H (pitsync_joined_edge, 0.75,
00118 "Dist inside big blob for chopping");
00119 extern double_VAR_H (pitsync_offset_freecut_fraction, 0.25,
00120 "Fraction of cut for free cuts");
00121 extern INT_VAR_H (pitsync_fake_depth, 1, "Max advance fake generation");
00124 double check_pitch_sync(
00125 BLOBNBOX_IT *blob_it,
00126 INT16 blob_count,
00127 INT16 pitch,
00128 INT16 pitch_error,
00129 STATS *projection,
00130 FPSEGPT_LIST *seg_list
00131 );
00132 void make_illegal_segment(
00133 FPSEGPT_LIST *prev_list,
00134 BOX blob_box,
00135 BLOBNBOX_IT blob_it,
00136 INT16 region_index,
00137 INT16 pitch,
00138 INT16 pitch_error,
00139 FPSEGPT_LIST *seg_list
00140 );
00141 INT16 vertical_torow_projection(
00142 TO_ROW *row,
00143 STATS *projection
00144 );
00145 void vertical_blob_projection(
00146 PBLOB *blob,
00147 STATS *stats
00148 );
00149 void vertical_outline_projection(
00150 OUTLINE *outline,
00151 STATS *stats
00152 );
00153 void vertical_cblob_projection(
00154 C_BLOB *blob,
00155 STATS *stats
00156 );
00157 void vertical_coutline_projection(
00158 C_OUTLINE *outline,
00159 STATS *stats
00160 );
00161 #endif