首先说下配置,labview2018 32位 python3.6 32位,用的labview自带调用python
以下面代码,把labview独特行形式的image转换成8位的2维数组,把数组导入Python中,然后运行labview,会出现错误
Invalid number of channels in input image:
'VScn::contains(scn)'
where
'scn' is 1
经分析图片数据后,发现导入的数组python识别成为1通道 ,
cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
只能处理3通道的,所以想到利用
ima = cv2.merge([img0, img0, img0])
函数创造一个3通道的灰度图,现在又报错
Unsupported depth of input image:
'VDepth::contains(depth)'
where
'depth' is 4 (CV_32S)
说是出现透明通道了,
最后问下有没有大佬目前或者以前做过这种项目,望指点一下,怎么把image传入python还能在python中正常灰度再二值