📜  在 python opencv 中检测灰度图像 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:56.430000             🧑  作者: Mango

代码示例2
import cv2
file = "myFile.jpj"


image = cv2.imread(file)
if image.any() != None:
  if(len(image.shape)<2):
        print ('grayscale')
  elif len(image.shape)==3:
        print ('Colored')
else:
  print("cannot find image")