Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide some working code examples. #54

Open
NavpreetDevpuri opened this issue Jun 20, 2020 · 3 comments
Open

Please provide some working code examples. #54

NavpreetDevpuri opened this issue Jun 20, 2020 · 3 comments

Comments

@NavpreetDevpuri
Copy link

Likewise we can find so many working examples about tesseract-OCR
for example at this link

@bertsky
Copy link
Collaborator

bertsky commented Jun 30, 2020

This repo is not about Tesseract, and not just an API. There are plenty of usage examples in the README, including links to the general documentation of the OCR-D framework.

Can we close this?

@NavpreetDevpuri
Copy link
Author

NavpreetDevpuri commented Jun 30, 2020

As mentioned at #53 (comment)
is there any examples similar to mentioned code example ?

similar to

import ocrd
import cv2 

config = {
    "ocrd-olena-binarize": {"impl": "sauvola"},
    "ocrd-anybaseocr-crop": None,
    "ocrd-olena-binarize": {"impl": "kim"},
    "ocrd-cis-ocropy-denoise": {"level-of-operation":"page"},
    "ocrd-tesserocr-deskew": {"operation_level":"page"},
    "ocrd-tesserocr-segment-region": None,
    "ocrd-segment-repair": {"plausibilize": True},
    "ocrd-cis-ocropy-deskew": {"level-of-operation":"region"},
    "ocrd-cis-ocropy-clip": {"level-of-operation":"region"},
    "ocrd-tesserocr-segment-line": None,
    "ocrd-segment-repair": {"sanitize": True},
    "ocrd-cis-ocropy-dewarp": None,
    "ocrd-calamari-recognize": {"checkpoint":"/path/to/models/*.ckpt.json"}
}

img = cv2.read("someimage.jpg")

# Doing the post-correction magic
processed_img = ocrd.process(img, config)

# Now i can use pytesseract to get text from processed_img
text = pytesseract.image_to_string(processed_img)
print(text)

@finkf
Copy link
Contributor

finkf commented Jul 1, 2020

I am sorry, but there is no such explicit API documentation. This project is meant to provide a command-line application for the OCR-D tool suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants