Diff
checker
文本
文本
图像
文档
Excel
文件夹
Legal
Enterprise
桌面版
定价
登录
下载 Diffchecker 桌面版
比较文本
查找两个文本文件之间的差异
工具
历史
实时编辑器
隐藏空白更改
折叠未更改行
关闭换行
视图
拆分
统一
比对精度
智能
单词
字符
文本样式
更改外观
语法高亮
选择语法
忽略
文本转换
转到第一个差异
编辑输入
Diffchecker Desktop
运行Diffchecker最安全的方式。获取Diffchecker桌面应用:您的差异永远不会离开您的电脑!
获取桌面版
cam1_5_diff
创建于
2年前
差异永不过期
清除
导出
分享
解释
5 删除
行
总计
删除
字符
总计
删除
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
9 行
全部复制
48 添加
行
总计
添加
字符
总计
添加
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
52 行
全部复制
复制
已复制
复制
已复制
from picamera2 import Picamera2,
Preview
from picamera2 import Picamera2,
MappedArray
from time import sleep
from libcamera import Transform
from libcamera import Transform
复制
已复制
复制
已复制
import cv2, time
resolution = (800, 600)
def apply_text(request):
# Text options
colour = (255, 255, 255)
origin = (0, 60)
font = cv2.FONT_HERSHEY_SIMPLEX
scale = 1
thickness = 1
# text = "17082024 09:07"
# Get the current time in the format "DDMMYYYY HH:MM"
text = time.strftime("%d%m%Y %H:%M")
# Calculate the text size
text_size, _ = cv2.getTextSize(text, font, scale, thickness)
# Calculate the bottom-right origin
x = resolution[0] - text_size[0] - 10 # 10 pixels padding from the right
y = resolution[1] - 10 # 10 pixels padding from the bottom
origin = (x, y)
with MappedArray(request, "main") as m:
cv2.putText(m.array, text, origin, font, scale, colour, thickness)
复制
已复制
复制
已复制
# Create camera object
picam2 = Picamera2()
picam2 = Picamera2()
复制
已复制
复制
已复制
picam2.start_preview(Preview.QTGL
, transform=Transform(hflip=True, vflip=True))
picam2.start()
# Create two separate configs - one for preview and one for capture.
sleep(2)
# Make sure the preview is the same resolution as the capture, to make
# sure the overlay stays the same size
capture_config = picam2.create_still_configuration({"size": resolution}
, transform=Transform(hflip=True, vflip=True))
preview_config = picam2.create_preview_configuration({"size": resolution}, transform=Transform(hflip=True, vflip=True))
# Set the current config as the preview config
picam2.configure(preview_config)
# Add the timestamp
picam2.pre_callback = apply_text
# Start the camera
picam2.start(show_preview=True)
time.sleep(2)
# Switch to the capture config and then take a picture
image = picam2.switch_mode_and_capture_file(capture_config, "timeOnPhoto.jpg")
# Close the camera
picam2.close()
picam2.close()
已保存差异
原始文本
打开文件
from picamera2 import Picamera2, Preview from time import sleep from libcamera import Transform picam2 = Picamera2() picam2.start_preview(Preview.QTGL, transform=Transform(hflip=True, vflip=True)) picam2.start() sleep(2) picam2.close()
更改后文本
打开文件
from picamera2 import Picamera2, MappedArray from libcamera import Transform import cv2, time resolution = (800, 600) def apply_text(request): # Text options colour = (255, 255, 255) origin = (0, 60) font = cv2.FONT_HERSHEY_SIMPLEX scale = 1 thickness = 1 # text = "17082024 09:07" # Get the current time in the format "DDMMYYYY HH:MM" text = time.strftime("%d%m%Y %H:%M") # Calculate the text size text_size, _ = cv2.getTextSize(text, font, scale, thickness) # Calculate the bottom-right origin x = resolution[0] - text_size[0] - 10 # 10 pixels padding from the right y = resolution[1] - 10 # 10 pixels padding from the bottom origin = (x, y) with MappedArray(request, "main") as m: cv2.putText(m.array, text, origin, font, scale, colour, thickness) # Create camera object picam2 = Picamera2() # Create two separate configs - one for preview and one for capture. # Make sure the preview is the same resolution as the capture, to make # sure the overlay stays the same size capture_config = picam2.create_still_configuration({"size": resolution}, transform=Transform(hflip=True, vflip=True)) preview_config = picam2.create_preview_configuration({"size": resolution}, transform=Transform(hflip=True, vflip=True)) # Set the current config as the preview config picam2.configure(preview_config) # Add the timestamp picam2.pre_callback = apply_text # Start the camera picam2.start(show_preview=True) time.sleep(2) # Switch to the capture config and then take a picture image = picam2.switch_mode_and_capture_file(capture_config, "timeOnPhoto.jpg") # Close the camera picam2.close()
查找差异