Transfer the Image to gray level.