/major-ai-skills:opencvfrom major-ai-skills
Build OpenCV image and video processing workflows with transforms, contours, capture, and classical vision operations.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
OpenCV (cv2) provides image/video IO, geometric and photometric transforms, classical feature detectors, and drawing utilities. Images are NumPy arrays in BGR order by default. Agents track color-space conversions explicitly, keep resize/crop parameters reproducible, release video captures, and push deep-learning detection to @pytorch / @huggingface-transformers when classical methods plateau.
imread / VideoCapture
-> BGR ndarray
-> cvtColor / resize / filter / threshold
-> contours / features / write
cv2.imread returns BGR - convert before RGB-only libraries.None after reads; fail fast on missing paths.cv2.IMREAD_COLOR / unchanged flags intentionally for alpha/bit depth.VideoCapture / writers in finally blocks.imshow needs a display).import cv2
from pathlib import Path
path = Path("samples/part.jpg")
bgr = cv2.imread(str(path), cv2.IMREAD_COLOR)
if bgr is None:
raise FileNotFoundError(path)
rgb = cv2.cvtColor(bgr, cv2.COLOR_BGR2RGB)
resized = cv2.resize(bgr, (640, 480), interpolation=cv2.INTER_AREA)
gray = cv2.cvtColor(resized, cv2.COLOR_BGR2GRAY)
blur = cv2.GaussianBlur(gray, (5, 5), 0)
edges = cv2.Canny(blur, 50, 150)
cv2.imwrite("out/edges.png", edges)
_, thresh = cv2.threshold(blur, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
vis = resized.copy()
cv2.drawContours(vis, contours, -1, (0, 255, 0), 2)
cap = cv2.VideoCapture("clips/line.mp4")
try:
ok, frame = cap.read()
if ok:
cv2.imwrite("out/frame0.jpg", frame)
finally:
cap.release()
| Symptom | Cause | Fix |
|---|---|---|
| Wrong colors in matplotlib | BGR vs RGB | cvtColor |
imread None | path/Unicode/cwd | resolve Path; check exists |
| GUI crash headless | imshow without display | write files; use notebooks |
| Slow loops | pure Python per pixel | vectorized NumPy/OpenCV ops |
@pytorch for DNN modules (cv2.dnn) only when appropriate.cuda) depend on build flags and drivers.@pytorch / @huggingface-transformers - learned vision models@jupyter - interactive visualization of intermediates@ffmpeg - heavy video transcoding outside OpenCVWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.Other plugins' skills for the same job
2 plugins ship this exact skill · first indexed Sep 11, 2026