赞
踩
python的路径写法:C:/VOCdeckit/VOC2017/JPEGImages//000001.jpg
注意斜杠
而cv2用的是正常的windows路径,注意转义字符
eg:
import cv2
img_path="C:\VOCdevkit\VOC2007\JPEGImages\\000001.jpg" orig_image = cv2.imread(image_path) cv2.namedWindow('showing') cv2.imshow("showing",orig_image) cv2.waitKey(0) cv2.destroyAllWindows()
其它路径写法:
img_path=f"{image_path}\\{test_ids_single}.jpg"
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。