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

Binarization fails #2

Closed
sonofmun opened this issue May 7, 2015 · 3 comments
Closed

Binarization fails #2

sonofmun opened this issue May 7, 2015 · 3 comments

Comments

@sonofmun
Copy link

sonofmun commented May 7, 2015

When I run the command

nidaba batch --binarize sauvola:10,20,30,40 --ocr tesseract:grc+eng --willitblend -- /home/mmunson/ddd/extracted_books/uc1.b4034434/*.png

I get the following error message for every image:

Error in pixSauvolaBinarize: whsize too large for image
[2015-05-07 14:41:31,041: ERROR/MainProcess] Task nidaba.binarize.sauvola[28767f13-0328-4efb-8585-083f56555a25] raised unexpected: NidabaLeptonicaException('Binarization failed for unknownreason.',)
Traceback (most recent call last):
  File "/home/mmunson/envs/nidaba/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/mmunson/envs/nidaba/local/lib/python2.7/site-packages/nidaba/tasks/helper.py", line 61, in __call__
    ret = super(NidabaTask, self).__call__(*args, **nkwargs)
  File "/home/mmunson/envs/nidaba/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/mmunson/envs/nidaba/local/lib/python2.7/site-packages/nidaba/plugins/leptonica.py", line 69, in sauvola
    lept_sauvola(input_path, output_path, whsize, factor)
  File "/home/mmunson/envs/nidaba/local/lib/python2.7/site-packages/nidaba/plugins/leptonica.py", line 111, in lept_sauvola
    raise NidabaLeptonicaException('Binarization failed for unknown'
NidabaLeptonicaException: Binarization failed for unknownreason.
@sonofmun
Copy link
Author

sonofmun commented May 7, 2015

BTW, I also got this error in the main screen (not on celery) after running this command:

Exception TypeError: "unsupported operand type(s) for +: 'NoneType' and 'str'" in <bound method PluginSource.__del__ of <pluginbase.PluginSource object at 0x7fcdb6080590>> ignored

@mittagessen
Copy link
Contributor

Are you sure you're running the latest version? Configurations of algorithms are divided by ';' now with parameters divided by ',', i.e. to run sauvola with the 4 configurations the configuration would be sauvola:10;20;30;40. In addition, the CLI should detect incorrect parameter counts for parametrized tasks (binarization, OCR, and statistical measures) now. I apologize for changing it again, but it couldn't be helped.

The final exception is caused on program exit by the plugin framework. It does not affect operation in any way (as far as I can determine) and there's already a bug report attached to it.

@sonofmun
Copy link
Author

This appears to have been a problem with the images I was trying to process and not Nidaba itself.

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