I have a directory with many images that are in these 3 scale: binary, gray scale and colorful.using cv2 i managed to check if the image is colorful or not.
def color_type(address): image = cv2.imread(address,-1) b,g,r = cv2.split(image) comp_1 = b==g comp_2 = b==r if comp_1.all() and comp_2.all(): return 'The Image is gray scale' else: return 'The Image has colors'
i can't find a way to separate binary images and gray scale image. I will be grateful if anyone would help me.