X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=pctb%2Fconvert.c;h=f90ca4a450456d3b5d437e4a093da3569fa6f975;hp=93c713708187bfe04361c4f34cac039f3960eaf0;hb=5a2c03e2e4f52b8329f45cf67afc3edec1f2c65b;hpb=8787ee59f6840de63bac432b516a30d0dfe22c84 diff --git a/pctb/convert.c b/pctb/convert.c index 93c7137..f90ca4a 100644 --- a/pctb/convert.c +++ b/pctb/convert.c @@ -30,6 +30,7 @@ static inline char get_p(Point p) { return get(p.x,p.y); } #define START_MAIN {200,200} #define MIN_COLUMNS 6 #define INTERESTING_COLUMNS 6 +#define TEXT_COLUMNS 2 #define MAX_COLUMNS 7 static Rect mainr = { START_MAIN,START_MAIN }; @@ -238,7 +239,7 @@ static void load_image_and_canonify(void) { debug_flush(); } -static void ocr_rectangle(Rect r) { +static void ocr_rectangle(Rect r, const OcrCellType ct) { OcrResultGlyph *results, *res; int w= r.br.x - r.tl.x + 1; @@ -257,7 +258,7 @@ static void ocr_rectangle(Rect r) { } cols[w]= 0; - results= ocr(rd,w,cols); + results= ocr(rd,ct,w,cols); printf("YES! \""); for (res=results; res->s; res++) printf("%s",res->s); @@ -282,7 +283,10 @@ int main(void) { for (colno=0; colno