6o6o / fft-descreen

An fft-based descreen filter
MIT License
75 stars 8 forks source link

numpy error (`pad_width` must be of integral type.) when running on python3 #4

Closed skorasaurus closed 4 years ago

skorasaurus commented 4 years ago

I receive the following error when I ran fft-descreen for the first time using Python 3.6.8 (default, Oct 7 2019, 12:59:55) [GCC 8.3.0] on linux; ubuntu 18.04

Traceback (most recent call last):
  File "descreen.py", line 36, in <module>
    middle = np.pad(ellipse(ew, eh), ((ph,rows-ph-eh*2-1), (pw,cols-pw-ew*2-1)), 'constant')
  File "<__array_function__ internals>", line 6, in pad
  File "/home/myusername/python/fft-descreen/.venv/lib/python3.6/site-packages/numpy/lib/arraypad.py", line 738, in pad
    raise TypeError('`pad_width` must be of integral type.')
TypeError: `pad_width` must be of integral type.

What I did:

  1. clone repository
  2. cd to fft-descreen, run mkdir .venv && virtualenv -p /usr/bin/python3 --no-site-packages .venv
  3. activate virtualenv (source .venv/bin/activate)
  4. pip install opencv-python (Successfully installed numpy-1.17.3 opencv-python-4.1.1.26).
  5. ran python3 descreen.py before.jpg after.jpg

I used fft-descreen successfully about 9-10 months on a separate installation of ubuntu (that was 16.04 and iirc, I used python2 then).

skorasaurus commented 4 years ago

oops, this is a duplicate of #2

6o6o commented 4 years ago

Yes, this should be fixed with 8e26b1905dd6312d626d7d2e6883e7a4b3ee2240