【cv2 处理有中文路径的图片】cv2 处理有中文路径的图片 can‘t open/read file: check file path/integrity

【cv2 处理有中文路径的图片】cv2 处理有中文路径的图片 can‘t open/read file: check file path/integrity_第1张图片D:\Dataset\zhongwaiyun\fire_smoke\cl_pic_wb\石窑子乡头道沟顶不带红框.png
cv2.imread(png_path, cv2.IMREAD_UNCHANGED)会报错:can’t open/read file: check file path/integrity
这样操作一下就不报错了。

from pathlib import Path
png_path = Path(png_path)
image = cv2.imread(png_path, cv2.IMREAD_UNCHANGED)

你可能感兴趣的:(python,opencv,人工智能,计算机视觉)