Python opencv

From JosiahSiegel/claude-plugin-marketplace · View interactive version

Python opencv is an AI agent skill from the GitHub repository JosiahSiegel/claude-plugin-marketplace. 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) E

How to use this skill

Skill file

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:

Related skills:


OpenCV Python Complete Guide (2025)

Overview

OpenCV (Open Source Computer Vision Library) is the most popular computer vision library. Python bindings (opencv-python) provide access to all functionality through NumPy arrays. OpenCV uses BGR color format by default, which is a critical gotcha.

Installation

# CPU-only (most common)
pip install opencv-python

# With contrib modules (SIFT, SURF, extra features)
pip install opencv-contrib-python

# Headless (no GUI, for servers)
pip install opencv-python-headless

# Verify installation
python -c "import cv2; print(cv2.__version__)"

Key Gotchas

Read references/opencv-critical-gotchas.md for the full preserved examples and safe patterns.

Reference Map

The detailed API patterns and code recipes have been split into focused references. Load the file that matches the user's task.

Critical Gotchas -> [references/opencv-critical-gotchas.md](references/opencv-critical-gotchas.md)

Read this for full examples of the most common OpenCV failure modes:

Core Operations -> [references/opencv-core-operations.md](references/opencv-core-operations.md)

Read this for everyday OpenCV work:

Advanced Patterns -> [references/opencv-advanced-patterns.md](references/opencv-advanced-patterns.md)

Read this for specialized computer-vision pipelines:

Triggering Phrases

This skill should activate when the user mentions any of: OpenCV, cv2, BGR, image processing, contours, Canny, Hough transform, template matching, ORB/SIFT/AKAZE, VideoCapture, VideoWriter, cv2.dnn, cv2.cuda, computer vision in Python.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.