imwrite()
原先代碼
cv2.imwrite(path_name, image)
但是path_name中含有中文,程序能夠運行但是此路徑文件夾仍爲空
這時應將代碼改成
cv2.imencode('.jpg',image)[1].tofile(path_name)
imread()
原先代碼
img = cv2.imread(path_name)
若path_name中含中文則改成
img=cv2.imdecode(np.fromfile(path_name,dtype=np.uint8),-1)