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 "params.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 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 INT_VAR_H (pitsync_linear_version, 0, "Use new fast algorithm");
00087 extern
00088 double_VAR_H (pitsync_joined_edge, 0.75,
00089 "Dist inside big blob for chopping");
00090 extern
00091 double_VAR_H (pitsync_offset_freecut_fraction, 0.25,
00092 "Fraction of cut for free cuts");
00093 extern
00094 INT_VAR_H (pitsync_fake_depth, 1, "Max advance fake generation");
00095 double check_pitch_sync(
00096 BLOBNBOX_IT *blob_it,
00097 inT16 blob_count,
00098 inT16 pitch,
00099 inT16 pitch_error,
00100 STATS *projection,
00101 FPSEGPT_LIST *seg_list
00102 );
00103 void make_illegal_segment(
00104 FPSEGPT_LIST *prev_list,
00105 TBOX blob_box,
00106 BLOBNBOX_IT blob_it,
00107 inT16 region_index,
00108 inT16 pitch,
00109 inT16 pitch_error,
00110 FPSEGPT_LIST *seg_list
00111 );
00112 inT16 vertical_torow_projection(
00113 TO_ROW *row,
00114 STATS *projection
00115 );
00116 void vertical_cblob_projection(
00117 C_BLOB *blob,
00118 STATS *stats
00119 );
00120 void vertical_coutline_projection(
00121 C_OUTLINE *outline,
00122 STATS *stats
00123 );
00124 #endif