X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fstructure.c;h=da80cb9fda86297b74e57f8e6a37ec7a887244bd;hb=5bcf61f52358ce7a1ceea3106c4c8a2d0a6dbfcd;hp=5a593887350025f8ce39c5e5d2a90e9c72df61e9;hpb=2ce6556e62248b0d82ae291badd5fbcc028ee0bc;p=ypp-sc-tools.db-test.git diff --git a/pctb/structure.c b/pctb/structure.c index 5a59388..da80cb9 100644 --- a/pctb/structure.c +++ b/pctb/structure.c @@ -320,6 +320,8 @@ void find_structure(CanonImage *im, int *max_relevant_y_r) { SET_ONCE(text_h, comminty - 1); if (max_relevant_y_r) SET_ONCE(*max_relevant_y_r, mainr.br.y + 10); + + MUST( text_h <= OCR_MAX_H, MI(text_h) ); } void check_correct_commodities(void) { @@ -527,22 +529,17 @@ static void ocr_rectangle(Rect r, const OcrCellType ct, FILE *tsv_output) { Pixcol cols[w+1]; int x,y; for (x=0; x= '0' && pixel <= '0'+AAMAXVAL, + MC(pixel);MP(here);MSB(ocr_celltype_name(ct));MR(r); ); + pixcol_p_add(&cols[x], y, pixel-'0'); } - cols[x]= cx; } - cols[w]= 0; + FILLZERO(cols[w]); results= ocr(rd,ct,w,cols); for (res=results; res->s; res++)