🦀 ClawHub
Windows Skills
by @civen-cn
Windows 桌面自动化技能,支持截图、文字识别(OCR)、图像定位。用于:(1) 截取屏幕内容 (2) 从图片提取文字 (3) 定位UI元素位置进行自动化操作
💡 Examples
Dependencies
pip install mss pytesseract pillow pyautogui opencv-python numpy
Note: OCR requires Tesseract OCR installedCore Features
#### 1. Screenshot
from scripts.screenshot import capture_screen, capture_region, capture_windowFull screen
capture_screen("output.png")Region (x, y, width, height)
capture_region(0, 0, 800, 600, "region.png")Window by title
capture_window("Notepad", "notepad.png")
#### 2. OCR (Text Recognition)
from scripts.ocr import extract_textExtract text from image
text = extract_text("screenshot.png")
print(text)Specify language (chi_sim=Chinese, eng=English)
text = extract_text("screenshot.png", lang="chi_sim+eng")
#### 3. Image Location
from scripts.image_locate import locate_on_screen, locate_allFind image position (returns center coordinates)
pos = locate_on_screen("button.png")
if pos:
x, y, confidence = pos
pyautogui.click(x, y) # Click the found elementFind all matches
positions = locate_all("icon.png")
📋 Tips & Best Practices
Windows 桌面自动化
TERMINAL
clawhub install windows-skills