A Function-Based Image Binarization based on Histogram