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

Large image with thin lines, all black. #13

Open
fgabel opened this issue May 6, 2021 · 2 comments
Open

Large image with thin lines, all black. #13

fgabel opened this issue May 6, 2021 · 2 comments

Comments

@fgabel
Copy link

fgabel commented May 6, 2021

Hello LingDong-,

I'm amazed by the speed of this algorithm. Great work! One issue I encountered is that for large images with quite thin white lines, I end up with no vectors at all. I used csize=1 and many iterations, but to no avail.

Could you help me with that?

Thanks, Frank

UPDATE: The algorithm seems to be non-robust against "artifacts". For reference, this is the image: https://gyazo.com/c11c5dabd97d81b70283cec449a78177
If you remove the artifacts on the right, it works. If you don't, all black.

@LingDong-
Copy link
Owner

Hi @fgabel

Thanks for the issue. What language port are you using? I just tested your image in Java and Python(swig) ports, and it seems to be working just fine with the "artifacts":

This was the python two-liner I used to make the above svg:

im = cv2.imread("input.png")
open('output.svg','w').write(
  f'<svg xmlns="http://www.w3.org/2000/svg" width="{im.shape[1]}" height="{im.shape[0]}"><path stroke="red" fill="none" d="'+" ".join(
  ["M"+" ".join([f'{x[0]},{x[1]}' for x in y]) for y in trace_skeleton.from_numpy(im)]
)+'"/></svg>')

@fgabel
Copy link
Author

fgabel commented May 7, 2021

Hello LingDong-,

Thanks for your answer. I was actually using the Python (swig) implementation as well, but apparently the issue is on my side if it works for you just fine. I'll investigate and report my findings soon.

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