Add binarized function for pgm image