
实用脚本
梦醒时分1218
这个作者很懒,什么都没留下…
展开
-
【python】多张图片转 gif
1. 描述多帧图片转成gif动图2. 代码import imageioimport osimport sysdef pic2Video(path, output_name): files = [] for f in os.listdir(dir): files.append(f) files.sort(key=lambda x: int(x[:-4])) frames = [] for i in range(len(原创 2021-12-03 16:29:06 · 1732 阅读 · 2 评论 -
【python】反转图像颜色
Markimport sysros_path = '/opt/ros/kinetic/lib/python2.7/dist-packages'if ros_path in sys.path: sys.path.remove(ros_path)import cv2import numpy as npimg = cv2.imread("/home/seivl/for_code/2.png",1) # kernel = np.ones((3,3),np.uint8) # i.原创 2021-03-11 14:51:42 · 430 阅读 · 0 评论 -
【python】获取鼠标位置并自动点击
# import time# import pyautogui## x,y = pyautogui.position() #返回鼠标的坐标# posStr="Position:"+str(x).rjust(4)+','+str(y).rjust(4)# print (posStr)#打印坐标## x, y = 1000, 534 # 鼠标需要移动到的位置# num_seconds = 2 # 将鼠标移动到指定坐标的间隔时间## time.sleep(8) # 延迟8秒# pyau原创 2020-09-24 10:04:01 · 3478 阅读 · 0 评论 -
【python】gps路点txt 截取
文章目录1 描述2 代码1 描述处理gps数据的时候,需要截取掉前n个数据,和后m个数据2 代码temp_x = []temp_y = []txtname = "/home/seivl/test.txt"f = open(txtname,"r")lines = f.readlines()for line in lines: lineData=line.split(',') temp_x.append(float(lineData[0])) temp_y.app原创 2020-06-09 11:49:38 · 184 阅读 · 0 评论 -
【python】gps路点txt 翻转
文章目录1 描述2 代码1 描述采集gps路网数据的时候,有时候路点的朝向记录的反了,需要把txt文件里的内容翻转一下2 代码temp_x = []temp_y = []txtname = "/home/seivl/test.txt"f = open(txtname,"r")lines = f.readlines()for line in lines: lineData=line.split(',') temp_x.append(float(lineData[0]))原创 2020-06-05 22:01:07 · 166 阅读 · 0 评论 -
【script】python读取目录下所有文件名并保存
path = ['D:\pcl2\PCL 1.8.1\lib', 'D:\pcl2\PCL 1.8.1\3rdParty\Boost\lib', 'D:\pcl\pcl_install\PCL 1.10.1\3rdParty\VTK\lib', 'D:\pcl\pcl_install\PCL 1.10.1\3rdParty\Qhull\lib', ...原创 2020-04-08 20:06:06 · 567 阅读 · 0 评论 -
【script】python提取视频中的每帧图像
# -*- encoding: utf-8 -*-import cv2import osimages = './image/'if not os.path.exists(images): os.mkdir(images)cap = cv2.VideoCapture("31770757503.mp4")c=0while(1): success, frame = ca...原创 2020-03-22 20:24:07 · 2376 阅读 · 0 评论