Skip to content

Instantly share code, notes, and snippets.

View Grrrolf's full-sized avatar
😎

Rolf Grrrolf

😎
View GitHub Profile
@dannguyen
dannguyen / README.md
Last active May 17, 2024 02:07
Using Python 3.x and Google Cloud Vision API to OCR scanned documents to extract structured data

Using Python 3 + Google Cloud Vision API's OCR to extract text from photos and scanned documents

Just a quickie test in Python 3 (using Requests) to see if Google Cloud Vision can be used to effectively OCR a scanned data table and preserve its structure, in the way that products such as ABBYY FineReader can OCR an image and provide Excel-ready output.

The short answer: No. While Cloud Vision provides bounding polygon coordinates in its output, it doesn't provide it at the word or region level, which would be needed to then calculate the data delimiters.

On the other hand, the OCR quality is pretty good, if you just need to identify text anywhere in an image, without regards to its physical coordinates. I've included two examples:

####### 1. A low-resolution photo of road signs

@michaelhjulskov
michaelhjulskov / fancy_date_functions.py
Last active June 21, 2016 17:46
date Business days functions - can be used in ecommerse for estimating delivery day
def get_holidays(year=date.year):
easter_sunday = easter.easter(year)
holidays = [
# These holidays have a fixed date
date(year,1,1), # New Year
date(year,5,1), # Labor Day
date(year,6,5), # Constitution Day (Grundlovsdag)
date(year,12,24), # Christmas Night
date(year,12,25), # 1st Christmas Day
date(year,12,26),# 2st Christmas Day