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

Creating json lines from image with image_to_json fails with error #124

Open
lriley2020 opened this issue Nov 25, 2022 · 0 comments
Open

Comments

@lriley2020
Copy link

Sorry in advance if I'm doing something stupid here! I've been trying to convert a png image to json to plot it, but when I import linedraw and run image_to_json, I get the following error:

>>> from linedraw import *
>>> image_to_json("imagename", draw_contours=2, draw_hatch=16, repeat_contours=3)
generating contours...
finding edges...
getting contour points...
connecting contour points...
getting contour points...
connecting contour points...
optimizing stroke sequence...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/liamriley/bg/BrachioGraph/linedraw.py", line 36, in image_to_json
    lines=vectorise(
  File "/Users/liamriley/bg/BrachioGraph/linedraw.py", line 120, in vectorise
    contours = sortlines(getcontours(
  File "/Users/liamriley/bg/BrachioGraph/linedraw.py", line 329, in sortlines
    slines = [clines.pop(0)]
IndexError: pop from empty list
>>> 

Is there an issue with the code?

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

1 participant