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

improve ocropy processor #8

Merged
merged 3 commits into from
Apr 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ocrd_cis/ocrd-tool.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@
],
"description": "Recognize text in lines with ocropy",
"parameters": {
"dewarping": {
"type": "boolean",
"description": "enable line normalization",
"default": true
},
"binarization": {
"type": "string",
"enum": ["none", "global", "otsu", "gauss-otsu", "ocropy"],
"default": "none"
},
"textequiv_level": {
"type": "string",
"enum": ["line", "word", "glyph"],
Expand Down
2 changes: 1 addition & 1 deletion ocrd_cis/ocropy/ocrolib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def array2pil(a):
else:
raise OcropusException("bad image rank")
elif a.dtype==dtype('float32'):
return PIL.Image.fromstring("F",(a.shape[1],a.shape[0]),a.tostring())
return PIL.Image.frombytes("F",(a.shape[1],a.shape[0]),a.tostring())
else:
raise OcropusException("unknown image type")

Expand Down
Loading