opencv-python cv2接口下错误TypeError: mat data type=18 is not supported
这个错误原因是因为nbarray这个对象内置一个类别属性,该属性记录了数组元素的类别,属性接口为ndarray.astype(dtype,order='K',casting='unsafe',subok=True,copy=True)(详见文档ndarray.astype)该属性在python-opencvmat数据类型必须定义为整型,所以,在调用imshow前只需配置一下该属性即可,代码是:nd