ocrd_cis icon indicating copy to clipboard operation
ocrd_cis copied to clipboard

Please provide some working code examples.

Open NavpreetDevpuri opened this issue 5 years ago • 3 comments

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

NavpreetDevpuri avatar Jun 20 '20 01:06 NavpreetDevpuri

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?

bertsky avatar Jun 30 '20 14:06 bertsky

As mentioned at https://github.com/cisocrgroup/ocrd_cis/issues/53#issuecomment-651926548 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)

NavpreetDevpuri avatar Jun 30 '20 17:06 NavpreetDevpuri

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.

finkf avatar Jul 01 '20 08:07 finkf