Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add cxcscmu/SkillLearnBench --skill opencv-template-matchinggit clone --depth 1 https://github.com/cxcscmu/SkillLearnBenchWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/cxcscmu/skilllearnbench/opencv-template-matching)<a href="https://agentmods.dev/skills/cxcscmu/skilllearnbench/opencv-template-matching"><img src="https://agentmods.dev/badge/skills/cxcscmu/skilllearnbench/opencv-template-matching.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00024 | $0.01073 |
| Opus 5 | $0.00012 | $0.00536 |
| Sonnet 5 | $0.00005 | $0.00215 |
| Haiku 4.5 | $0.00002 | $0.00107 |
Grade A, and why
opencv-template-matching scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.
OpenCV Template Matching for Object Detection
Overview
OpenCV is a computer vision library that enables template matching - finding occurrences of a template image within a larger source image. This is useful for counting objects in screenshots or video frames.
Installation
pip install opencv-python numpy
Key Concepts
Template Matching
Template matching works by sliding a smaller template image across a larger image and computing a similarity score at each position. Objects are detected where the score exceeds a threshold.
Matching Methods
cv2.TM_CCOEFF: Correlation coefficient (recommended for most cases)cv2.TM_CCORR: Cross correlationcv2.TM_SQDIFF: Sum of squared differences
Usage Examples
Convert RGB Image to Grayscale
import cv2
# Read image in color
image = cv2.imread('image.png')
# Convert to grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Save grayscale image (overwrites original)
cv2.imwrite('image.png', gray)
Basic Template Matching
import cv2
import numpy as np
def count_objects(image_path, template_path, threshold=0.8):
"""Count occurrences of template in image"""
# Read images in grayscale
image = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)
template = cv2.imread(template_path, cv2.IMREAD_GRAYSCALE)
# Perform template matching
result = cv2.matchTemplate(image, template, cv2.TM_CCOEFF)
# Find locations where correlation exceeds threshold
locations = np.where(result >= threshold)
# Count unique objects (accounting for nearby detections)
count = len(locations[0])
return count, locations
Advanced: Non-Maximum Suppression
Template matching often produces overlapping detections. Use non-maximum suppression to remove duplicates:
import cv2
import numpy as np
def count_objects_nms(image_path, template_path, threshold=0.8, min_distance=10):
"""Count objects using non-maximum suppression"""
image = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)
template = cv2.imread(template_path, cv2.IMREAD_GRAYSCALE)
result = cv2.matchTemplate(image, template, cv2.TM_CCOEFF)
# Get all locations above threshold with their scores
locations = np.where(result >= threshold)
scores = result[locations]
# Convert to list of (x, y, score) tuples
detections = list(zip(locations[1], locations[0], scores))
# Sort by score descending
detections.sort(key=lambda x: x[2], reverse=True)
# Apply non-maximum suppression
kept = []
for x, y, score in detections:
# Check if too close to already kept detection
too_close = False
for kx, ky in kept:
if abs(x - kx) < min_distance and abs(y - ky) < min_distance:
too_close = True
break
if not too_close:
kept.append((x, y))
return len(kept), kept
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 147 lines · 24 tokens per session scan A 4cea01eefa01
opencv-template-matching is a skill published in the GitHub repository cxcscmu/SkillLearnBench (83 stars, last pushed 1mo ago), licensed MIT. It adds 24 tokens to every session and 1,073 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
image-generation
Generate images from text prompts (and optionally edit/remix input images). Use when the user asks to create, generate, draw, render, or edit an image, illustration, logo, icon, diagram, or photo.
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models.
gemini-count-in-video
Analyze and count objects in videos using Google Gemini API (object counting, pedestrian detection, vehicle tracking, and surveillance video analysis).
video-frame-extraction
Extract frames from video files and save them as images using OpenCV.
gemini-video-understanding
Analyze videos with Google Gemini API (summaries, Q&A, transcription with timestamps + visual context, scene/timeline detection, video clipping, FPS control, multi-video comparison, and YouTube URL analysis).
Automatic Speech Recognition (ASR)
Transcribe audio segments to text using Whisper models. Use larger models (small, base, medium, large-v3) for better accuracy, or faster-whisper for optimized performance. Always align transcription timestamps with diarization segments for accurate speaker-labeled subtitles.