Skip to content

Commit

Permalink
Final teak to pixFindBaselinesGen() for Issue #766
Browse files Browse the repository at this point in the history
* remove components up to 3 pixels high (instead of up to 2) at 4x reduction
  • Loading branch information
DanBloomberg committed Jan 18, 2025
1 parent 4e64214 commit cfcc172
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions prog/baseline_reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ L_REGPARAMS *rp;
numaDestroy(&na);
ptaDestroy(&pta);

/* Another test for baselines, with dark image */
/* Another test for baselines, with dark image.
* With minw = 60, the number at the top of the page is skipped. */
pixadb = pixaCreate(6);
pixs = pixRead("pedante.079.jpg"); /* 75 ppi */
pix1 = pixRemoveBorder(pixs, 30);
Expand All @@ -120,7 +121,7 @@ L_REGPARAMS *rp;
pixDestroy(&pix3);
pixDestroy(&pix4);
pix1 = pixDeskew(pix5, 2);
na = pixFindBaselines(pix1, &pta, pixadb);
na = pixFindBaselinesGen(pix1, 50, &pta, pixadb);
regTestCompareValues(rp, 35, numaGetCount(na), 0); /* 9 */
pix2 = pixaDisplayTiledInRows(pixadb, 32, 1500, 1.0, 0, 30, 2);
regTestWritePixAndCheck(rp, pix2, IFF_PNG); /* 10 */
Expand Down
2 changes: 1 addition & 1 deletion src/baseline.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ PTA *pta;
found = FALSE;
for (j = 0; j < nbox; j++) {
boxaGetBoxGeometry(boxa3, j, &bx, &by, &bw, &bh);
if (bh > 8 && L_ABS(locval - (by + bh)) <= 24) {
if (bh > 12 && L_ABS(locval - (by + bh)) <= 24) {
ptaAddPt(pta, bx, locval);
ptaAddPt(pta, bx + bw, locval);
found = TRUE;
Expand Down

0 comments on commit cfcc172

Please sign in to comment.