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

Fix check for nrm.png files in ocropus-pageseg --gray #287

Merged
merged 1 commit into from Feb 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions ocropus-gpageseg
Expand Up @@ -85,7 +85,7 @@ group_column.add_argument('--csminaspect',type=float,default=1.1,
# output parameters
group_output = parser.add_argument_group('output parameters')
group_output.add_argument('--gray',action='store_true',
help='output grayscale lines as well, default: %(default)s')
help='output grayscale lines as well, which are extracted from the grayscale version of the pages, default: %(default)s')
group_output.add_argument('-p','--pad',type=int,default=3,
help='padding for extracted lines, default: %(default)s')
group_output.add_argument('-e','--expand',type=int,default=3,
Expand Down Expand Up @@ -395,7 +395,10 @@ def process1(job):
if args.gray:
if os.path.exists(base+".nrm.png"):
gray = ocrolib.read_image_gray(base+".nrm.png")
checktype(gray,GRAYSCALE)
checktype(gray,GRAYSCALE)
else:
print_error("Grayscale version %s.nrm.png not found. Use ocropus-nlbin for creating normalized grayscale version of the pages as well." % base)
return

binary = 1-binary # invert

Expand Down