Improved thesholding, now the preprocessed image is beautiful