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

ZeroDivisionError: division by zero when running demo #8

Open
jvence opened this issue Mar 7, 2023 · 1 comment
Open

ZeroDivisionError: division by zero when running demo #8

jvence opened this issue Mar 7, 2023 · 1 comment

Comments

@jvence
Copy link

jvence commented Mar 7, 2023

On Mac OS with python 3.7:

rohart.jpg
path: /Users/me/tmp/Fourier/FourierImages/rohart.jpg
[Application of the Fourier Transform.] Window has been created.
Traceback (most recent call last):
File "main.py", line 37, in
fourier()
File "/Users/me/tmp/Fourier/fourier_drawing/fourier.py", line 156, in call
self.events()
File "/Users/me/tmp/Fourier/fourier_drawing/fourier.py", line 170, in events
self.setMode((self.mode + 1) % 3)
File "/Users/me/tmp/Fourier/fourier_drawing/fourier.py", line 319, in setMode
self.setConstructionMode()
File "/Users/me/tmp/Fourier/fourier_drawing/fourier.py", line 334, in setConstructionMode
self.coefficients = Fourier.transform(self.sample, self.coefficients_number)
File "/Users/me/tmp/Fourier/fourier_drawing/fourier.py", line 34, in transform
cn /= npts
ZeroDivisionError: division by zero

@MarcPartensky
Copy link
Owner

Yes it can happen when no points has been selected in the construction mode. You have to select some points on your image by clicking on it. I could add a little warning but i just forgot to treat this case. I might fix it in future versions.

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