From 2ce6556e62248b0d82ae291badd5fbcc028ee0bc Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 4 Jul 2009 11:16:32 +0100 Subject: [PATCH 1/1] antialiasing text conversion: canonimage has 0..AAMAXVAL --- pctb/ocr.h | 4 ++++ pctb/structure.c | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/pctb/ocr.h b/pctb/ocr.h index 9a2b2c7..5269723 100644 --- a/pctb/ocr.h +++ b/pctb/ocr.h @@ -32,6 +32,10 @@ #include "common.h" +#define AADEPTH 3 +#define AAMAXVAL ((1<d[p.y * cim->w + p.x]= '0' + here_int; } - debug_rect("cell07", colno, *cell); + debug_rect("cell0M", colno, *cell); require_rectangle_r(*cell, "0123456789", __LINE__); } @@ -531,9 +532,9 @@ static void ocr_rectangle(Rect r, const OcrCellType ct, FILE *tsv_output) { Point here= { x+r.tl.x, y+r.tl.y }; int pixel= get_p(here); switch (pixel) { - case ' ': break; - case '0': break; - case '7': cx |= rv; break; + case ' ': break; + case '0': break; + case '0'+AAMAXVAL: cx |= rv; break; default: MUST(!"wrong pixel", MC(pixel);MP(here);MSB(ocr_celltype_name(ct));MR(r); ); -- 2.30.2