当前位置: 首页 > news >正文

佛山新网站建设市场seo管理系统培训

佛山新网站建设市场,seo管理系统培训,微信商家小程序收费吗,如何做配送网站Excel为数据绘制拆线图,并将均值线叠加在图上,以及整个过程的区域录屏python脚本 1.演示动画A.视频B.gif动画 2.跟踪鼠标区域的录屏脚本 Excel中有一组数据,希望画出曲线,并且能把均值线也绘制在图上,以下动画演示了整个过程,并且提供了区域录屏脚本,原理如下: 为节约空间,避免…

Excel为数据绘制拆线图,并将均值线叠加在图上,以及整个过程的区域录屏python脚本

  • 1.演示动画
    • A.视频
    • B.gif动画
  • 2.跟踪鼠标区域的录屏脚本

Excel中有一组数据,希望画出曲线,并且能把均值线也绘制在图上,以下动画演示了整个过程,并且提供了区域录屏脚本,原理如下:
为节约空间,避免剪辑,只记录有效区域【仅记录鼠标区域且图像变化的图片】

1.演示动画

A.视频

Excel为数据绘制拆线图,并将均值线叠加在图上

B.gif动画

请添加图片描述

2.跟踪鼠标区域的录屏脚本

import cv2
import numpy as np
import mss
import time
import threading
import pyautogui
import datetime
from skimage.metrics import structural_similarity as ssim
from pynput import mousedef compute_ssim(imageA, imageB):"""计算两幅图像的结构相似性指数(SSIM)"""grayA = cv2.cvtColor(imageA, cv2.COLOR_BGR2GRAY)grayB = cv2.cvtColor(imageB, cv2.COLOR_BGR2GRAY)(score, diff) = ssim(grayA, grayB, full=True)return scoredef resize_and_pad(image, size=(640, 640)):"""等比缩放并填充图像"""h, w = image.shape[:2]scale = min(size[0] / w, size[1] / h)new_w, new_h = int(w * scale), int(h * scale)resized_image = cv2.resize(image, (new_w, new_h))# 创建黑色背景top = (size[1] - new_h) // 2bottom = size[1] - new_h - topleft = (size[0] - new_w) // 2right = size[0] - new_w - leftpadded_image = cv2.copyMakeBorder(resized_image, top, bottom, left, right, cv2.BORDER_CONSTANT, value=[0, 0, 0])return padded_imageis_mouse_pressed=False
def on_click(x, y, button, pressed):global is_mouse_pressedis_mouse_pressed = presseddef capture_screen(stop_event):layout_w=720layout_h=1280mouse_listener = mouse.Listener(on_click=on_click)mouse_listener.start()with mss.mss() as sct:# 初始化第一帧monitor = sct.monitors[1]print(monitor)frame1 = Nonescreen_width = monitor["width"]screen_height = monitor["height"]fourcc = cv2.VideoWriter_fourcc(*'XVID')out = cv2.VideoWriter('output.avi', fourcc, 3.0, (layout_w, layout_h))area=Nonewhile not stop_event.is_set():mouse_x, mouse_y = pyautogui.position()    if area:if mouse_x<area['left'] or mouse_x>area['left']+layout_w or mouse_y<area['top'] or mouse_y>area['top']+layout_h:area=Noneif area is None and is_mouse_pressed:                    # 计算截取区域,以鼠标为中心640x640,同时进行边界检查left = max(0, min(screen_width - layout_w, mouse_x - layout_w // 2))top = max(0, min(screen_height - layout_h, mouse_y - layout_h // 2))area = {'top': top, 'left': left, 'width': layout_w, 'height': layout_h}if area:frame2 = np.array(sct.grab(area))frame2 = cv2.cvtColor(frame2, cv2.COLOR_BGRA2BGR)# 在 frame2 上绘制一个小圆点标记鼠标位置relative_mouse_x = mouse_x - area['left']relative_mouse_y = mouse_y - area['top']cv2.circle(frame2, (relative_mouse_x, relative_mouse_y), 5, (0, 0, 255), -1)  # 红色小圆点frame2=resize_and_pad(frame2,(layout_w,layout_h))if frame1 is None:frame1 = frame2.copy()continuescore = compute_ssim(frame1, frame2)if score<1.0:out.write(frame2)frame1 = frame2.copy()# 适量的延时,防止过高的CPU使用率time.sleep(0.1)out.release()if __name__ == '__main__':stop_event = threading.Event()# 启动屏幕捕捉的线程capture_thread = threading.Thread(target=capture_screen, args=(stop_event,))capture_thread.start()# 等待用户输入'q'以停止捕捉while True:if input().strip().lower() == 'q':stop_event.set()break# 等待屏幕捕捉线程结束capture_thread.join()print("捕获已结束并退出。")from moviepy.editor import VideoFileClip# 定义视频文件路径和输出GIF文件路径input_video_path = 'output.avi'output_gif_path = 'output.gif'# 加载视频文件clip = VideoFileClip(input_video_path)clip = clip.subclip(3, -2)clip = clip.resize(0.4)# 将视频剪辑转换为GIFclip.write_gif(output_gif_path, fps=2)print(f"GIF文件保存到 {output_gif_path}")
http://www.hkea.cn/news/110148/

相关文章:

  • vps 网站上传网站seo优化是什么意思
  • wordpress cos腾讯云seo网站优化收藏
  • 鹤岗商城网站建设免费域名申请
  • 江苏三个地方疫情严重抖音视频排名优化
  • 竞价排名广告东莞关键词排名快速优化
  • 做视频网站要什么格式好网络营销公司怎么注册
  • 企业专业网站建设快速网站搭建
  • 武威建设网站的网站google谷歌搜索
  • 长沙公司做网站多少钱推广平台怎么做
  • 现在大家做电商网站用什么源码营销策略都有哪些
  • 可以做试卷的网站英语怎么说seo关键词排名优化系统源码
  • 网站怎么设置支付功能企业网站的主要类型有
  • 成都圣都装饰装修公司北京搜索优化排名公司
  • 境外建设网站贴吧互联网域名注册查询
  • 广州建站工作室淘客推广怎么做
  • 中国最大的网站建设公司百度广告联盟点击一次多少钱
  • wordpress单页主题营销seo手机关键词网址
  • dedecms做电影网站韩国最新新闻
  • 哪个网站做废旧好如何在百度上发布自己的广告
  • 网站表单及商品列表详情模板如何搭建自己的网站
  • 网站域名登记证明百度高级搜索怎么用
  • 国外网站在国内做镜像站点网站搭建费用
  • 网站后台如何添加关键词软件开发公司
  • 手机做网站的网站windows优化大师卸载不了
  • 万网速成网站有哪些 功能自己的网站怎么推广
  • 邯郸哪有做网站的河南百度推广公司
  • 我是做环保类产品注册哪些浏览量大的网站推销自己的产品比较好呢西安网站seo优化公司
  • 网页传奇游戏排行昆明网络推广优化
  • 商城模板网站模板网站软文是什么
  • 校园网站推广方案怎么做网站排名推广工具