
Python练习题
文章平均质量分 51
没有出口的猎户座
这个作者很懒,什么都没留下…
展开
-
opencv的图片处理:缩小尺寸为原图的一半【自己练习存档,没有参考价值,多看其他大神代码,谢谢】
4.2 除了png转成jpg,并且jpg的长宽是原来一半这些要求外,还对文件名有要求,希望添加前缀lalala。比如原来的图片路径是folder1/a.png,那么我们希望结果图片的路径为folder2/lalala_a.jpg#存放原图的文件夹input_image_path = 'D:\\Research\\Python\\Practice\\resource\\practice_4_jpg' #图片缩小后保存的目标文件夹resized_image_path = r'D:\Resear.原创 2022-02-02 14:41:17 · 4730 阅读 · 0 评论 -
Python基础练习:计算周长、for循环函数使用,修改文件名
import osimport shutilfrom shutil import copyfrom PIL import Imageimport cv2#写一个用于计算矩形面积的函数,给定矩形的长和宽,能返回这个矩形的周长。length = int(input('please type the length:'))wide = int(input('please type the wide'))print('length:{} wide:{}'.format(length,wide)).原创 2022-01-27 08:31:15 · 863 阅读 · 0 评论