builtree / handwrite

Handwrite generates a custom font based on your handwriting sample.
https://pypi.org/project/handwrite/
MIT License
366 stars 46 forks source link

IndexError: list index out of range #66

Open ganesh314159 opened 2 years ago

ganesh314159 commented 2 years ago

Hello, I was making font file and got following error

Command I used

handwrite Handwrite.jpg ./

Error I got

Traceback (most recent call last):
File "/home/ganesh314159/.local/bin/handwrite", line 8, in <module>
sys.exit(main())
File "/home/ganesh314159/.local/lib/python3.9/site-packages/handwrite/cli.py", line 56, in main
converters(
File "/home/ganesh314159/.local/lib/python3.9/site-packages/handwrite/cli.py", line 34, in converters
run(sheet, output_directory, directory, config, metadata)
File "/home/ganesh314159/.local/lib/python3.9/site-packages/handwrite/cli.py", line 12, in run
SHEETtoPNG().convert(sheet, characters_dir, config)
File "/home/ganesh314159/.local/lib/python3.9/site-packages/handwrite/sheettopng.py", line 44, in convert
characters = self.detect_characters(
File "/home/ganesh314159/.local/lib/python3.9/site-packages/handwrite/sheettopng.py", line 116, in detect_characters
x, y, w, h = cv2.boundingRect(contours[i])
IndexError: list index out of range

This is my Handwrite jpg Handwrite

yashlamba commented 2 years ago

Hi @ganesh314159, thanks for trying out handwrite and letting us know about the issue; So handwrite currently doesn't apply any filters on its own, so when scanning an image you'll have to try to make the light consistent or use a filter from the adobe scan/camscanner app. I'll open a new to issue for this feature, let's see if we can add it soon.

Related: #3