ofn-remove-grid - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +--- Thread: ofn-remove-grid (/Thread-ofn-remove-grid) |
ofn-remove-grid - Ofnuts - 10-02-2020 ofn-remove-grid removes table borders from scanned text. It is found here. It was spawned from this discussion. As always, comments, suggestions and bug reports welcome. Enjoy. RE: ofn-remove-grid - Krikor - 10-02-2020 Using the script I'm not getting good results for the image presented on this page: What's the way to remove all lines and borders in image (keep texts) programmatically? https://stackoverflow.com/questions/33949831/whats-the-way-to-remove-all-lines-and-borders-in-imagekeep-texts-programmatic I tried with values for the treshold area from 6500 to 9500, but most of the page is deleted. PS: But when manually executing the steps indicated in post #4 - https://www.gimp-forum.net/Thread-Erase-remove-borders-from-a-table-scanned-pdf?pid=20168#pid20168 the result is great!
RE: ofn-remove-grid - Ofnuts - 10-02-2020 (10-02-2020, 04:39 PM)Krikor Wrote: Using the script I'm not getting good results for the image presented on this page: Quoting the script doc: Quote:Assumptions and algorithm ... which is pretty much the case with the image you show. This said, eyeballing the smallest grid area (which appears to be the one at (1890,1020), and making a selection just inside it (which makes an area threshold around 5400px), and then running the script removes this: [attachment=5019]
Which isn't too bad given the circumstances. The one difference between ofn-remove-grid and ofn-path-filter-strokes is that ofn-remove-grid takes a shortcut to compute areas: it actually computes the area of the bounding box, when ofn-path-filter-strokes computes the area of the polygon (but with a formula that is only valid for convex polygons, so not for typical letters...). RE: ofn-remove-grid - Ofnuts - 10-23-2020 Uploaded a new version that can also filter on width and height, for these cases where there are only horizontal or vertical dividers. |