cv2 check if image is grayscale

Solutions on MaxInterview for cv2 check if image is grayscale by the best coders in the world

showing results for - "cv2 check if image is grayscale"
Joana
08 Apr 2017
1from scipy.misc import imread, imsave, imresize
2image = imread(f_name)
3if(len(image.shape)<3):
4      print 'gray'
5elif len(image.shape)==3:
6      print 'Color(RGB)'
7else:
8      print 'others'
9