00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00034 class FPSEGPT:public ELIST_LINK
00035 {
00036 public:
00037 FPSEGPT() {
00038 }
00039 FPSEGPT(
00040 inT16 x);
00041 FPSEGPT(
00042 inT16 x,
00043 BOOL8 faking,
00044 inT16 offset,
00045 inT16 region_index,
00046 inT16 pitch,
00047 inT16 pitch_error,
00048 FPSEGPT_LIST *prev_list);
00049 FPSEGPT(FPCUTPT *cutpt);
00050
00051 inT32 position() {
00052 return xpos;
00053 }
00054 double cost_function() {
00055 return cost;
00056 }
00057 double squares() {
00058 return sq_sum;
00059 }
00060 double sum() {
00061 return mean_sum;
00062 }
00063 FPSEGPT *previous() {
00064 return pred;
00065 }
00066 inT16 cheap_cuts() const {
00067 return mid_cuts;
00068 }
00069
00070
00071 NEWDELETE2 (FPSEGPT) BOOL8 faked;
00072 BOOL8 terminal;
00073 inT16 fake_count;
00074
00075 private:
00076 inT16 mid_cuts;
00077 inT32 xpos;
00078 FPSEGPT *pred;
00079 double mean_sum;
00080 double sq_sum;
00081 double cost;
00082 };
00083
00084 ELISTIZEH (FPSEGPT) CLISTIZEH (FPSEGPT_LIST)
00085 extern
00086 BOOL_VAR_H (pitsync_projection_fix, FALSE,
00087 "Fix bug in projection profile");
00088 extern
00089 INT_VAR_H (pitsync_linear_version, 0, "Use new fast algorithm");
00090 extern
00091 double_VAR_H (pitsync_joined_edge, 0.75,
00092 "Dist inside big blob for chopping");
00093 extern
00094 double_VAR_H (pitsync_offset_freecut_fraction, 0.25,
00095 "Fraction of cut for free cuts");
00096 extern
00097 INT_VAR_H (pitsync_fake_depth, 1, "Max advance fake generation");
00098 double check_pitch_sync(
00099 BLOBNBOX_IT *blob_it,
00100 inT16 blob_count,
00101 inT16 pitch,
00102 inT16 pitch_error,
00103 STATS *projection,
00104 FPSEGPT_LIST *seg_list
00105 );
00106 void make_illegal_segment(
00107 FPSEGPT_LIST *prev_list,
00108 TBOX blob_box,
00109 BLOBNBOX_IT blob_it,
00110 inT16 region_index,
00111 inT16 pitch,
00112 inT16 pitch_error,
00113 FPSEGPT_LIST *seg_list
00114 );
00115 inT16 vertical_torow_projection(
00116 TO_ROW *row,
00117 STATS *projection
00118 );
00119 void vertical_blob_projection(
00120 PBLOB *blob,
00121 STATS *stats
00122 );
00123 void vertical_outline_projection(
00124 OUTLINE *outline,
00125 STATS *stats
00126 );
00127 void vertical_cblob_projection(
00128 C_BLOB *blob,
00129 STATS *stats
00130 );
00131 void vertical_coutline_projection(
00132 C_OUTLINE *outline,
00133 STATS *stats
00134 );
00135 #endif