Answers for "python cv2 read image in grayscale"

8

save an image in python as grayscale cv2

cv2.imwrite('data/dst/lena_opencv_red.jpg', im)
Posted by: Guest on January-04-2021
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