1/15/2024 0 Comments Google cloud vision ocr pdf![]() ![]() Google Search led to this question on Super User about an interesting problem where you want to take a “searchable scan” PDF and combine it with another PDF with higher quality images. (Just how I arrived at the code in the next “Results” section… can probably skip this section and go there directly….) It will still be the scanned image that is visible (good), but the text can be selected/copied/searched. So what we’d like to do is to add this text layer to the scanned image, positioning each detected word at its original position on the page. Anyway, I’m interested in the Google Vision API for now, which seems to have its own format.) (Actually, as I was typing this, I learned that other OCR tools like tesseract can provide this too: there’s a data format called hOCR that includes this bounding box information. Google has a Cloud Vision API ( try it out here) that appears to provide not only the detected text, but also the position (bounding box) on the page of each detected word. One doesn’t feel in control of what’s happening. There are many OCR tools that do this automatically (ABBYY FineReader, etc), but they are often not very reliable for the kinds of use-cases I am interested in (old books with Sanskrit text in Devanagari script, of uneven scan quality), and do not (I think?) allow editing the resulting text. Either way, many errors are likely, so when we open the PDF we’d still like to see the scanned image, except that it would be nice if the text can be selected and copied (and also searched). To get there, either we need the text to be typed in manually by someone, or we need OCR. As each page is just a picture, no text has been associated with it, and it is not searchable. ![]() Situation: A printed book has been scanned into images, possibly assembled into a single PDF. (Summary: How to add an invisible text layer to a PDF containing scanned images, using an OCR tool-in this case Google Cloud Vision API-that also gives the position of each recognized word.) Manually adding an OCR layer to scanned PDF | Blog Blog Manually adding an OCR layer to scanned PDF ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |