Coder Social home page Coder Social logo

avinashvarna / gcv2hocr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dinosauria123/gcv2hocr

0.0 0.0 0.0 2.79 MB

gcv2hocr converts from Google Cloud Vision OCR output to hocr to make a searchable pdf.

Shell 4.88% Python 68.52% C 25.72% Makefile 0.88%

gcv2hocr's Introduction

gcv2hocr

gcv2hocr converts from Google Cloud Vision OCR output to hocr to make a searchable pdf.

Installation

Compile:

make

Install to /usr/local/bin:

make install

Install to $HOME/.local/bin:

make install PREFIX=$HOME/.local

Uninstall:

make uninstall

Usage

gcv2hocr test.jpg.json output.hocr

test.jpg.json is a output of Google Cloud Vision OCR. output.hocr is a output of gcv2hocr.

You may specify image size in argument.

gcv2hocr test.jpg.json output.hocr 1280 960

First number 1280 is image height of the picture. Second number 960 is image width of the picture.

gcv2hocr also generates intermediary files preout1.txt and preout2.txt.

You may use gcv2hocr.py instead of gcv2hocr executable.

python gcv2hocr.py test.jpg.json > output.hocr

--savefile (python only) if defined will output to file instead of console.

How to get OCR (json) data:

Execute gcvocr.sh.

./gcvocr.sh test.jpg "Your API KEY"

gcvocr.sh is slightly modified sample.sh originally written by Kazuhiro FURUHATA ([email protected]).

How to make a searchable pdf:

To create a searchable pdf, use the hocr-pdf script bundled with hocr-tools.

makepdf.sh is a sample shell script to make a searchable pdf from individual jpeg files. If you want to use GUI,

python -m makepdfGUI.py.

Acknowledgments

To Kazuhiro FURUHATA, he gave me a permission redistribute and modify sample.sh.

To Philipp Zumstein, he gave me answers several questions about hocr.

To Konstantin Baierer, he wrote python port (gcv2hocr.py).

To skylord123, he fixed many bugs in python port.

To URIN HACK, he gave me a permission redistribute his replace() code. (http://urin.github.io/posts/2018/replace-string-by-c-lang)

Licence

Creative Commons Attribution 4.0 International.

You are free to:

    Share — copy and redistribute the material in any medium or format
    Adapt — remix, transform, and build upon the material
    for any purpose, even commercially.

    The licensor cannot revoke these freedoms as long as you follow the license terms.

2016.9.2 ENDO Michiaki ([email protected])

gcv2hocr's People

Contributors

ailintom avatar avinashvarna avatar dinosauria123 avatar goodevilgenius avatar junior1q94 avatar kba avatar p-acharya avatar skylord123 avatar stweil avatar zuphilip avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.