Complete OpenCV computer vision system for Python. PROACTIVELY activate for: (1) Image loading with cv2.imread (BGR format gotcha), (2) Video capture with cv2.VideoCapture, (3) Color space conversion (BGR to RGB, HSV, grayscale), (4) Image filtering (GaussianBlur, medianBlur, bilateralFilter), (5) Edge detection (Canny), (6) Contour detection with cv2.findContours, (7) Image resizing with interpolation methods, (8) Template matching, (9) Feature detection (SIFT, ORB, AKAZE), (10) Drawing functions (rectangle, circle, text), (11) Video writing with cv2.VideoWriter, (12) Morphological operations, (13) Deep learning with cv2.dnn module, (14) GPU acceleration with cv2.cuda, (15) Coordinate system (x,y vs row,col) gotchas. Provides: Image processing patterns, video capture/writing, memory management, performance optimization, Jupyter notebook workarounds. Ensures correct BGR handling and memory-safe OpenCV usage.
View on GitHubJosiahSiegel/claude-plugin-marketplace
python-master
January 20, 2026
Select agents to install to:
npx add-skill https://github.com/JosiahSiegel/claude-plugin-marketplace/blob/main/plugins/python-master/skills/python-opencv/SKILL.md -a claude-code --skill python-opencvInstallation paths:
.claude/skills/python-opencv/## Quick Reference | Function | Purpose | Gotcha | |----------|---------|--------| | `cv2.imread(path)` | Load image | Returns `None` if path invalid (no error!) | | `cv2.imwrite(path, img)` | Save image | Expects BGR, not RGB | | `cv2.cvtColor(img, code)` | Color conversion | BGR is default, not RGB | | `cv2.VideoCapture(src)` | Video/camera input | Always check `isOpened()` and `release()` | | `cv2.VideoWriter(...)` | Save video | Expects BGR frames, codec matters | | `cv2.resize(img, (w, h))` | Resize image | Size is (width, height), not (height, width) | | Coordinate System | Order | Usage | |-------------------|-------|-------| | NumPy indexing | `img[row, col]` = `img[y, x]` | Pixel access | | Image shape | `(height, width, channels)` | Shape is (rows, cols, ch) | | OpenCV functions | `(x, y)` | Drawing functions | | Resize/ROI | `(width, height)` | Size parameters | | Color Conversion | Code | Note | |------------------|------|------| | BGR to RGB | `cv2.COLOR_BGR2RGB` | For Matplotlib display | | BGR to Gray | `cv2.COLOR_BGR2GRAY` | Single channel output | | BGR to HSV | `cv2.COLOR_BGR2HSV` | H: 0-179, S/V: 0-255 | | Interpolation | Best For | Speed | |---------------|----------|-------| | `INTER_NEAREST` | Speed, pixelated OK | Fastest | | `INTER_LINEAR` | General purpose (default) | Fast | | `INTER_AREA` | Downscaling | Medium | | `INTER_CUBIC` | Upscaling quality | Slow | | `INTER_LANCZOS4` | Best upscaling | Slowest | ## When to Use This Skill Use for **computer vision and image processing**: - Loading, displaying, and saving images - Video capture from cameras or files - Image filtering and transformations - Edge and contour detection - Object detection and template matching - Feature detection and matching - Deep learning inference with DNN module **Related skills:** - For NumPy arrays: see `python-fundamentals-313` - For async processing: see `python-asyncio` - For type hints: see `python-type-hints` --- # OpenCV Python Complete Guide (2025)