错误写法:
len(np.where((img[:,:, 0] > 0 |img[:,:, 1] == 0|img[:,:, 2] == 0))[0])/3
正确写法:
len(np.where((img[:,:, 0] > 0) |(img[:,:, 1] == 0)|(img[:,:, 2] == 0))[0])/3
&的内容用括号括起来就好了
错误写法:
len(np.where((img[:,:, 0] > 0 |img[:,:, 1] == 0|img[:,:, 2] == 0))[0])/3
正确写法:
len(np.where((img[:,:, 0] > 0) |(img[:,:, 1] == 0)|(img[:,:, 2] == 0))[0])/3
&的内容用括号括起来就好了