Answers for "cv2 check if image is grayscale"

0

cv2 check if image is grayscale

from scipy.misc import imread, imsave, imresize
image = imread(f_name)
if(len(image.shape)<3):
      print 'gray'
elif len(image.shape)==3:
      print 'Color(RGB)'
else:
      print 'others'
Posted by: Guest on June-30-2021

Python Answers by Framework

Browse Popular Code Answers by Language