解决cv2. imread、imwrite无法读取或保存中文路径图片问题

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)
相关推荐
hixiong1237 分钟前
TensorRT转换工具分享
人工智能·计算机视觉·ai·c#
fenglllle11 分钟前
chromadb emmbedding 向量检索
人工智能·python·embedding
cui_ruicheng14 分钟前
Python从入门到实战(六):非序列容器
开发语言·python
飞猪~1 小时前
Langchain python版本 LLM 重要函数invoke,ainvoke,stream,astream,batch,abatch
python·langchain·batch
动物园猫1 小时前
可回收垃圾目标检测数据集:5类别、13,000张图像 | 目标检测
人工智能·目标检测·计算机视觉
沙蒿同学1 小时前
当古诗词遇上 AI:从 38 万句诗词中取一个好名字
python·算法·架构
xxie1237942 小时前
Python装饰器与语法糖
开发语言·python
CClaris2 小时前
大模型量化从0到1(五):GPTQ 原理详解 + 从零量化一个真实大模型
人工智能·python·算法·机器学习
Railshiqian2 小时前
UserPickerActivity 内部逻辑分析
开发语言·python
一tiao咸鱼2 小时前
前端转 agent # 02 - FastAPI 框架入门与原理
前端·python