Incorporated binarization from Leptonica libraries.