News for hackers. Stuff that matters.
Re:Show HN: I made a tool to convert images of tables to CSV by arathore on Tuesday March 09, 2021 @04:10PM (#26404312)
Great project! I've had success using camelot-py (https://camelot-py.readthedocs.io) to extract tabular data from PDFs (for images, I use imagemagick to convert those to PDF). If your table has borders the default method (lattice) works quite well. For non-bordered table there is the option to use 'stream' option but usually requires bit more preprocessing to get usable results.
Re:Show HN: I made a tool to convert images of tables to CSV by f430 on Tuesday March 09, 2021 @08:24PM (#26406697)
how does camelot extract tables from pdf? does it convert to image and then does OCR?
Re:Show HN: I made a tool to convert images of tables to CSV by vortex_ape on Wednesday March 10, 2021 @05:39AM (#26409890)
Hey! Camelot maintainer here. You can check out this doc for details on how Camelot extracts tables from PDFs: https://camelot-py.readthedocs.io/en/master/user/how-it-work...

As pointed out in this thread, right now it only works with text-based PDFs. But there's a PR[1] which will add OCR support (using EasyOCR) for image-based PDFs in some time.

[1] https://github.com/camelot-dev/camelot/pull/209

Re:Show HN: I made a tool to convert images of tables to CSV by mkl on Wednesday March 10, 2021 @12:42AM (#26408187)
From the link: "Camelot only works with text-based PDFs and not scanned documents." If you have character data, using it is almost always going to be more accurate than OCR.

I don't know how OP uses it with images converted to PDFs though, as that would be just like a scan, and ImageMagick doesn't do OCR as far as I can tell.

Re:Show HN: I made a tool to convert images of tables to CSV by punnerud on Wednesday March 10, 2021 @02:19AM (#26408724)
It uses pytesseract and Open-CV, so there is image processing.
Re:Show HN: I made a tool to convert images of tables to CSV by mkl on Wednesday March 10, 2021 @02:33AM (#26408800)
Looks like it's a bit in-progress: https://github.com/camelot-dev/camelot/pull/209

"Update docs" isn't checked, and that's what I was going on.

Re:Show HN: I made a tool to convert images of tables to CSV by vortex_ape on Wednesday March 10, 2021 @05:35AM (#26409865)
Yes I need to work on that PR, haven't been getting a lot of free time these days. It adds OCR support using EasyOCR, which I found on HN some time ago!