Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide whitespace changes
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Text styles
Change appearance
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
cam1_5_diff
Created
2 years ago
Diff never expires
Clear
Export
Share
Explain
5 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
9 lines
Copy
48 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
52 lines
Copy
Copy
Copied
Copy
Copied
from picamera2 import Picamera2,
Preview
from picamera2 import Picamera2,
MappedArray
from time import sleep
from libcamera import Transform
from libcamera import Transform
Copy
Copied
Copy
Copied
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)
Copy
Copied
Copy
Copied
# Create camera object
picam2 = Picamera2()
picam2 = Picamera2()
Copy
Copied
Copy
Copied
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()
Saved diffs
Original text
Open file
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()
Changed text
Open file
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()
Find difference