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

ketos linegen --legacy fails #307

Open
bertsky opened this issue Nov 16, 2021 · 3 comments
Open

ketos linegen --legacy fails #307

bertsky opened this issue Nov 16, 2021 · 3 comments

Comments

@bertsky
Copy link

bertsky commented Nov 16, 2021

If I use ketos linegen with the --legacy option, I currently get:

  File "kraken/ketos.py", line 933, in line_generator
    im = linegen.ocropy_degrade(im)
  File "kraken/linegen.py", line 271, in ocropy_degrade
    (sigma, ssigma, threshold, sthreshold) = degradations[np.random.choice(len(degradations))]
TypeError: cannot unpack non-iterable float object
@bertsky
Copy link
Author

bertsky commented Nov 16, 2021

Thanks – that was fast!

Alas, I'm afraid there's another bug lurking here: the output in this mode looks all black. Diving in, it seems the color mode is 8 bit grayscale, but fg bg is at 1 (instead of 255). In other words, only convert 000000.png -threshold 1 -depth 1 out.png will repair it.

@bertsky
Copy link
Author

bertsky commented Nov 26, 2021

Alas, I'm afraid there's another bug lurking here: the output in this mode looks all black. Diving in, it seems the color mode is 8 bit grayscale, but fg bg is at 1 (instead of 255). In other words, only convert 000000.png -threshold 1 -depth 1 out.png will repair it.

@mittagessen, reopen or new issue?

@mittagessen
Copy link
Owner

Sorry, I forgot about it. Let's reopen and have a look. It's probably related to the arcane image loading routines that often returned different numerical ranges than a simple np.array() call on a PIL image.

@mittagessen mittagessen reopened this Nov 26, 2021
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

2 participants