opencv-computer-vision

opencv-computer-vision is a skill for Claude Code, Codex from hamzabellouch/agent-skills. It costs 79 tokens per session (2,204 once invoked), scanned A, original, MIT.

Guidance for building computer-vision systems with OpenCV, a library for analysing images and video, in C++ or Python. It covers camera streams, GPU processing, feature tracking, calibration, and estimating 3D position.

In plain words
What is it for?
Use it to process RTSP camera feeds, detect shapes and features, track movement, match images, calibrate cameras, and calculate spatial position.
Why use it?
It helps structure real-time video processing so camera data can be handled efficiently across threads and between the CPU and GPU.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to process RTSP camera feeds, detect shapes and features, track movement, match images, calibrate cameras, and calculate spatial position.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hamzabellouch/agent-skills/opencv-computer-vision
Install

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.

Any agent
npx skills add hamzabellouch/agent-skills --skill opencv-computer-vision
Clone the repo
git clone --depth 1 https://github.com/hamzabellouch/agent-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for opencv-computer-vision

README.md
[![agentmods](https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/opencv-computer-vision/github.svg)](https://agentmods.dev/skills/hamzabellouch/agent-skills/opencv-computer-vision)
Your own site
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/opencv-computer-vision"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/opencv-computer-vision/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for opencv-computer-vision

Your own site · 80×15
<a href="https://agentmods.dev/skills/hamzabellouch/agent-skills/opencv-computer-vision"><img src="https://agentmods.dev/badge/skills/hamzabellouch/agent-skills/opencv-computer-vision.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,204 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00079 $0.02204
Opus 5 $0.00039 $0.01102
Sonnet 5 $0.00016 $0.00441
Haiku 4.5 $0.00008 $0.00220

Measured 8d ago against content hash f3177efd682e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

opencv-computer-vision 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 8d 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.

Computer Vision and Spatial AI/opencv-computer-vision/SKILL.md · 256 lines

How it starts

The opening of the file, as written. The whole thing — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenCV Computer Vision & Spatial AI

Production implementations for GPU-accelerated image processing, multi-threaded RTSP video streaming, feature tracking, camera calibration, and 3D spatial position estimation.


1. Computer Vision Architecture

+-------------------+      +--------------------------------+      +---------------------------+
| RTSP IP Camera    | ---> | Multi-Threaded VideoReader     | ---> | CUDA GpuMat Memory Transfer|
| (1080p @ 60 FPS)  |      | (Thread-safe Queue Buffer)     |      | (Zero CPU-GPU copy bottleneck)|
+-------------------+      +--------------------------------+      +---------------------------+
                                                                                 |
                                                                                 v
+-------------------+      +--------------------------------+      +---------------------------+
| Spatial 3D Pose   | <--- | Feature Detection & PnP        | <--- | GPU Pre-processing        |
| (X, Y, Z, R, P, Y)|      | (SolvePnP / ArUco Marker)      |      | (Threshold, Blur, Contours)|
+-------------------+      +--------------------------------+      +---------------------------+

2. Multi-Threaded RTSP Stream Reader (rtsp_reader.py)

A non-blocking, thread-safe RTSP video ingest pipeline with automatic reconnect logic to prevent frame dropping.

import cv2
import threading
import queue
import time
import logging

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

class RobustVideoSubscriber:
    def __init__(self, rtsp_url: str, max_queue_size: int = 5):
        self.rtsp_url = rtsp_url
        self.frame_queue = queue.Queue(maxsize=max_queue_size)
        self.stopped = False
        self.cap = None
        self.thread = threading.Thread(target=self._update, daemon=True)

    def start(self):
        self._connect()
        self.thread.start()
        return self

    def _connect(self):
        logger.info(f"Connecting to RTSP stream: {self.rtsp_url}")
        self.cap = cv2.VideoCapture(self.rtsp_url, cv2.CAP_FFMPEG)
        self.cap.set(cv2.CAP_PROP_BUFFERSIZE, 1) # Force minimal buffering latency

    def _update(self):
        while not self.stopped:
            if not self.cap or not self.cap.isOpened():
                logger.warning("Stream disconnected. Attempting reconnect...")
                time.sleep(2.0)
                self._connect()
                continue

            grabbed, frame = self.cap.read()
            if not grabbed:
                logger.warning("Failed to grab frame. Reconnecting...")
                self.cap.release()
                time.sleep(1.0)
                self._connect()
                continue

            # Drop oldest frame if queue is full to enforce real-time processing
            if self.frame_queue.full():
                try:
                    self.frame_queue.get_nowait()
                except queue.Empty:
                    pass

            self.frame_queue.put(frame)

    def read(self):
        """Fetch latest frame non-blocking."""
        try:
            return True, self.frame_queue.get(timeout=1.0)
        except queue.Empty:
            return False, None

    def stop(self):
        self.stopped = True
        if self.thread.is_alive():
            self.thread.join()
        if self.cap:
            self.cap.release()
        logger.info("RTSP subscriber stopped.")

Read the full file on GitHub · 256 lines

Changes

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.

  1. 8d ago First seen · 256 lines · 79 tokens per session scan A f3177efd682e

Subscribe to this mod's changes

opencv-computer-vision is a skill published in the GitHub repository hamzabellouch/agent-skills (4 stars, last pushed 1mo ago), licensed MIT. It adds 79 tokens to every session and 2,204 once invoked, about $0.0004 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.