mzucker / noteshrink

Convert scans of handwritten notes to beautiful, compact PDFs
https://mzucker.github.io/2016/09/20/noteshrink.html
MIT License
4.8k stars 351 forks source link

K-means clustering exception with white pages #14

Open DiegoFaFe opened 7 years ago

DiegoFaFe commented 7 years ago

When get_fg_mask can't find any pixel in the sample that's foreground (e.g. white page, like image attached) will cause a exception running K-means clustering(randint's call inside it to be precise)

Im not sure which behavior would be desirable in this case, check and ignore it or writing the white page on output breaker

SLboat commented 5 years ago

im see the problem too