ocrd_cis
ocrd_cis copied to clipboard
Please provide some working code examples.
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?
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)
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.