datasets处理时遇到的问题:
上面报错输出结果显示:
def reconstruct( cnts, h, w, val=1 ) :
# print(h)
# print(w)
rst = np.zeros([h,w], dtype='uint8')
print(cnts)
cv2.fillPoly( rst, cnts, val )
return rst
cv2.fillpoly中rst或cnts是空置,于是就选择先print一下
发现都有输出值且我之前跑测试数据时是可以跑通的,但是不知道为什么转成正式数据时就会报错。
原因是因为上述重的cnts传入的数据并不是int32的
在上述代码中加入,dtype = int32即可