ocropus-archive / DUP-ocropy

Python-based tools for document analysis and OCR
Apache License 2.0
3.42k stars 591 forks source link

Error running : ocropus-nlbin ersch.png -o book #329

Closed Rumcajs47 closed 5 years ago

Rumcajs47 commented 5 years ago

OS : Arch linux x64 From AUR : https://aur.archlinux.org/packages/ocropy

/> ocropus-nlbin ersch.png -o book

ersch.png

=== ersch.png 1 flattening /usr/lib/python2.7/site-packages/scipy/ndimage/interpolation.py:605: UserWarning: From scipy 0.13.0, the output shape of zoom() is calculated with round() instead of int() - for these inputs the size of the returned array has changed. "the returned array has changed.", UserWarning) estimating skew angle estimating thresholds Traceback (most recent call last): File "/usr/bin/ocropus-nlbin", line 207, in process1((f,i+1)) File "/usr/bin/ocropus-nlbin", line 168, in process1 v = morphology.binary_dilation(v,structure=ones((e*50,1))) File "/usr/lib/python2.7/site-packages/numpy/core/numeric.py", line 223, in ones a = empty(shape, dtype, order) TypeError: 'float' object cannot be interpreted as an index

zuphilip commented 5 years ago

Update the ocropy code and try again.

This line has been changed some time ago: https://github.com/tmbdev/ocropy/blob/19b4a7cc7ffcf52817a0c4c41a5f3703bb57dc2a/ocropus-nlbin#L166

To make sure that you have the latest ocropy code you can type git log -n1 and also git status in the ocropy directory.

Rumcajs47 commented 5 years ago

Thx for the Info I have try it on my linux mint partition and installed it from scratch (followed the description here on github), everything runs as expected. It must be some old sources in the AUR on arch linux that makes it fails.