cv2.imwrite(filename, img)
修改为
cv2.imencode('.jpg', img)[1].tofile(filename)
 
cv2.imread(filename, cv2.IMREAD_GRAYSCALE)
修改为
cv2.imdecode(np.fromfile(filename, dtype=np.uint8), cv2.IMREAD_GRAYSCALE)

cv2.imwrite(filename, img)
修改为
cv2.imencode('.jpg', img)[1].tofile(filename)
 
cv2.imread(filename, cv2.IMREAD_GRAYSCALE)
修改为
cv2.imdecode(np.fromfile(filename, dtype=np.uint8), cv2.IMREAD_GRAYSCALE)

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐