Permalink
Browse files

change cli defaults

git-svn-id: http://svn.berlios.de/svnroot/repos/hocr/trunk@437 49e73cb6-26fe-0310-acd5-9921f42b7f61
  • Loading branch information...
1 parent e19f0fb commit cb55b4233088dd77dae4a1eb2d3175a9be7a8526 kzamir committed Jun 26, 2008
View
@@ -1,3 +1,10 @@
+libhocr (0.10.11)
+
+ * Change default values in hocr command line utility
+
+
+ -- Yaacov Zamir <kzamir_at_walla.co.il> Thursday, 26 June 2008 09:04
+
libhocr (0.10.10)
* Fix hocr-gtk example remember window size
View
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([libhocr], [0.10.10], [Yaacov Zamir <kzamir@walla.co.il>])
+AC_INIT([libhocr], [0.10.11], [Yaacov Zamir <kzamir@walla.co.il>])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([1.9 foreign])
@@ -53,13 +53,13 @@ gboolean no_gtk = TRUE;
gint threshold = 0;
gint adaptive_threshold = 0;
-gint adaptive_threshold_type = 0;
+gint adaptive_threshold_type = 1;
gint scale_by = 0;
gboolean do_not_auto_scale = FALSE;
gdouble rotate_angle = 0.0;
gboolean do_not_auto_rotate = FALSE;
-gint paragraph_setup = 0;
+gint paragraph_setup = 1;
gint slicing_threshold = 0;
gint slicing_width = 0;
gint font_spacing_code = 0;
@@ -503,7 +503,7 @@ hocr_image_processing_with_debug (ho_pixbuf * pix)
/* if fonts are too small and user wants auto scale, re-scale image */
if (m_bw->font_height < 10)
- scale_by = 4;
+ scale_by = 3;
else if (m_bw->font_height < 20)
scale_by = 2;
else
@@ -282,6 +282,8 @@ ho_recognize_font_1_open (const double *array_in)
return_value -= 0.2;
if (COMMA_PART)
return_value -= 0.2;
+ if (MID_LEFT > 0.25)
+ return_value -= 0.2;
return return_value;
}
@@ -322,6 +324,8 @@ ho_recognize_font_1_close (const double *array_in)
return_value -= 0.2;
if (COMMA_PART)
return_value -= 0.2;
+ if (MID_RIGHT > 0.25)
+ return_value -= 0.2;
return return_value;
}
@@ -417,6 +421,8 @@ ho_recognize_font_1_question (const double *array_in)
if (MID_RIGHT_END || TOP_MID_END)
return_value -= 0.2;
+ if (BOTTOM_HBAR)
+ return_value -= 0.2;
if (!DOT_PART)
return_value -= 0.1;
if (BOTTOM < 0.45 || BOTTOM > 0.60)
@@ -618,7 +624,9 @@ ho_recognize_font_1_gimal (const double *array_in)
return_value -= 0.2;
if (WIDTH_BY_HEIGHT > 0.8)
return_value -= 0.2;
-
+ if (HEIGHT < 0.3)
+ return_value -= 0.3;
+
return return_value;
}
@@ -751,7 +759,7 @@ ho_recognize_font_1_vav (const double *array_in)
if (!BOTTOM_MID_END && !BOTTOM_RIGHT_END)
return_value -= 0.2;
if (HEIGHT < 0.35)
- return_value -= 0.2;
+ return_value -= 0.3;
if (WIDTH_BY_HEIGHT > 0.55)
return_value -= 0.2;
if (ONE_HOLE)
@@ -812,6 +820,8 @@ ho_recognize_font_1_zayin (const double *array_in)
return_value -= 0.2;
if (TOP_MID_CROSS < 0.1 && TOP_RIGHT_CROSS < 0.1)
return_value -= 0.1;
+ if (HEIGHT < 0.3)
+ return_value -= 0.2;
return return_value;
}
@@ -927,9 +937,11 @@ ho_recognize_font_1_tet (const double *array_in)
return_value -= 0.2;
if (ONE_HOLE && HOLE_BOTTOM_LEFT_EDGE)
return_value -= 0.2;
- if (BOTTOM_LEFT_CROSS || BOTTOM_MID_CROSS)
+ /*if (BOTTOM_LEFT_CROSS || BOTTOM_MID_CROSS)
+ return_value -= 0.2;*/
+ if (MID_LEFT > 0.5)
return_value -= 0.2;
-
+
return return_value;
}
@@ -1133,7 +1145,7 @@ ho_recognize_font_1_mem (const double *array_in)
if (MID_RIGHT_NOTCH || BOTTOM_RIGHT_NOTCH)
return_value -= 0.2;
if (BOTTOM_RIGHT_END)
- return_value -= 0.1;
+ return_value -= 0.2;
if (BOTTOM > 0.60)
return_value -= 0.2;
if (BOTTOM_RIGHT > 0.35)
@@ -1154,7 +1166,7 @@ ho_recognize_font_1_mem_sofit (const double *array_in)
if (TOP_HBAR)
return_value += 0.1;
if (BOTTOM_HBAR)
- return_value += 0.1;
+ return_value += 0.2;
if (LEFT_VBAR)
return_value += 0.1;
if (RIGHT_VBAR)
@@ -1178,7 +1190,7 @@ ho_recognize_font_1_mem_sofit (const double *array_in)
return_value -= 0.1;
if (BOTTOM_LEFT > 0.45 || BOTTOM_RIGHT > 0.45)
return_value -= 0.2;
- if (BOTTOM_RIGHT > 0.32)
+ if (BOTTOM_RIGHT > 0.42)
return_value -= 0.1;
if (BOTTOM > 0.57 || BOTTOM < 43)
return_value -= 0.10;
@@ -1227,6 +1239,8 @@ ho_recognize_font_1_nun (const double *array_in)
return_value -= 0.2;
if (MID_LEFT_EDGE)
return_value -= 0.2;
+ if (BIG_TOP_RIGTH_EDGE)
+ return_value -= 0.2;
if (WIDTH > 0.33 && (TOP_LEFT < (BOTTOM_LEFT + 0.2)))
return_value -= 0.35;
if (TOP_LEFT < (BOTTOM_LEFT))
@@ -1243,6 +1257,8 @@ ho_recognize_font_1_nun (const double *array_in)
return_value -= 0.3;
if (HEIGHT > 0.55)
return_value -= 0.2;
+ if (HEIGHT < 0.3)
+ return_value -= 0.2;
if (MID_RIGHT > 0.9)
return_value -= 0.3;
@@ -1308,11 +1324,11 @@ ho_recognize_font_1_samech (const double *array_in)
return_value += 0.1;
if (RIGHT_VBAR)
return_value += 0.1;
- if (BOTTOM_RIGHT > 0.25)
+ if (BOTTOM_RIGHT > 0.45)
return_value += 0.1;
if (BOTTOM_LEFT > 0.45 || BOTTOM_RIGHT > 0.45)
return_value += 0.1;
- if ((BOTTOM_LEFT + 0.2) < (BOTTOM_RIGHT))
+ if ((BOTTOM_LEFT + 0.3) < (BOTTOM_RIGHT))
return_value += 0.1;
if (BOTTOM_LEFT > 0.30 && BOTTOM_RIGHT > 0.30)
return_value += 0.1;
@@ -1341,6 +1357,8 @@ ho_recognize_font_1_samech (const double *array_in)
return_value -= 0.3;
if (TOP_LEFT > 0.4)
return_value -= 0.2;
+ if (MID_LEFT > 0.4)
+ return_value -= 0.2;
if (MID_LEFT_NOTCH)
return_value -= 0.1;
if (MID_TOP_NOTCH)
@@ -1351,7 +1369,9 @@ ho_recognize_font_1_samech (const double *array_in)
return_value -= 0.2;
if (BOTTOM_LEFT_END)
return_value -= 0.2;
-
+ if (BOTTOM_RIGHT < 0.32)
+ return_value -= 0.3;
+
return return_value;
}
@@ -1530,7 +1550,9 @@ ho_recognize_font_1_tzadi (const double *array_in)
return_value += 0.1;
if (MID_RIGHT_NOTCH || BOTTOM_RIGHT_NOTCH)
return_value += 0.2;
-
+ if (MID_MID_CROSS)
+ return_value += 0.1;
+
if (BOTTOM_LEFT < BOTTOM_RIGHT)
return_value -= 0.1;
if (MID_BOTTOM_NOTCH)
View
@@ -453,12 +453,12 @@ ho_segment_fonts (const ho_bitmap * m, const ho_bitmap * m_line_map,
return NULL;
/* set default slicing_threshold */
- if (slicing_threshold < 15)
- s_threshold = 70;
+ if (slicing_threshold < 5)
+ s_threshold = 30;
else
s_threshold = slicing_threshold;
- if (slicing_width < 80)
+ if (slicing_width < 20)
s_width = 160;
else
s_width = slicing_width;
View
@@ -88,7 +88,7 @@ hocr_image_processing (const ho_pixbuf * pix_in,
/* if fonts are too small, re-scale image */
if (bitmap_temp->font_height < 10)
- scale_by = 4;
+ scale_by = 3;
else if (bitmap_temp->font_height < 20)
scale_by = 2;
else

0 comments on commit cb55b42

Please sign in to comment.