当前位置:网站首页>Batch will png . bmp . JPEG format pictures are converted to Jpg format picture
Batch will png . bmp . JPEG format pictures are converted to Jpg format picture
2022-06-28 11:48:00 【DaYinYi】
import os
import cv2 as cv
image_path = 'G:/LoveDA/JPEGImages1/'
save_path = 'G:/LoveDA/JPEGImages/'
if not os.path.exists(save_path):
os.makedirs(save_path)
image_file = os.listdir(image_path)
for image in image_file:
if image.split('.')[-1] in ['bmp', 'jpg', 'jpeg', 'png', 'JPG', 'PNG']:
str = image.rsplit(".", 1)
output_img_name = str[0] + ".jpg"
src = cv.imread(os.path.join(image_path, image))
newimg = cv.imwrite(save_path + '/' + output_img_name, src)
print('FINISHED')边栏推荐
- QML control type: tabbar
- 使用ssm项目对Mysql8进行访问的时候,出现连接失败和一些错误的解决办法
- 科研丨Web of Science检索技巧
- ThreadLocal的简单理解
- 4. maximum continuity factor
- FTP protocol for Wireshark packet capture analysis
- Oracle date format exception: invalid number
- Unity屏幕截图功能
- What method is required for word, PDF and txt files to realize full-text content retrieval?
- New listing of operation light 3.0 - a sincere work of self subversion across the times!
猜你喜欢

Redis6 一:Nosql引入、Redis可以解决什么问题?

js中this的默认指向及如何修改指向 2021.11.09

Oracle date format exception: invalid number

QML control type: tabbar

Simulation of the Saier lottery to seek expectation

Array method in JS 2021.09.18

培训通知|2022年境外中资企业机构及人员疫情防控和安全防范专题培训通知
This Exception was thrown from a job compiled with Burst, which has limited exception support. report errors

Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush

For example, the visual appeal of the live broadcast of NBA Finals can be seen like this?
随机推荐
Calculate time using calendar
Create ECS using API shortcut
Scientific research - web of science retrieval skills
ThreadLocal的简单理解
When an entity is converted to JSON, the field with null value is lost
5. Sum of N numbers
分析list中有无重复数据且重复了几次
Download and install mysql5.7 for windows 10
QML control type: tabbar
Cannot redeclare block range variables
面试步骤的面试技巧
Solutions to connection failures and errors when accessing mysql8 using the SSM project
毕业了
2022中国信通院首届业务与应用安全发展论坛成功召开!
Ali three sides: what is the difference between using on or where in the left join associated table and the condition
《运营之光3.0》全新上市——跨越时代,自我颠覆的诚意之作!
Dongyuhui, New Oriental and Phoenix Satellite TV
Redis6 一:Nosql引入、Redis可以解决什么问题?
近况
mysql-.sql文件钓鱼上线