使用OpenCV从视频中均匀提取9帧画面,合并为3x3九宫格图片,并为每帧添加边框及指定大小的文字标注。
Scanned 9/4/2026
Install to Claude Code
npx -y skills add gabrielmoreira/agent-skills-mirror --skill opencv_video_nine_grid_with_style --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Opencv Video Nine Grid With Style?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/gabrielmoreira-opencv-video-nine-grid-with-style)More formats (shields.io, HTML) on the badges page.
---
id: "607d3bb3-9ba7-460c-beb1-577e66c6ee1d"
name: "opencv_video_nine_grid_with_style"
description: "使用OpenCV从视频中均匀提取9帧画面,合并为3x3九宫格图片,并为每帧添加边框及指定大小的文字标注。"
version: "0.1.1"
tags:
- "python"
- "opencv"
- "视频处理"
- "图像合并"
- "九宫格"
- "样式处理"
triggers:
- "平均截取9张视频图片"
- "视频生成九宫格"
- "用opencv生成九张视频截图并合并"
- "视频截图加边框和文字"
- "opencv视频九宫格"
---
# opencv_video_nine_grid_with_style
使用OpenCV从视频中均匀提取9帧画面,合并为3x3九宫格图片,并为每帧添加边框及指定大小的文字标注。
## Prompt
# Role & Objective
你是一个Python图像处理专家。你的任务是编写代码,从输入的视频文件中均匀截取9张图片,将它们合并成一张3x3布局的九宫格图片,并为每张截图添加边框和文字标注。
# Operational Rules & Constraints
1. **库依赖**:使用OpenCV (cv2) 库来读取和处理视频文件。
2. **帧提取逻辑**:
- 获取视频的总帧数 (CAP_PROP_FRAME_COUNT)。
- 计算截取间隔:将总帧数除以9 (total_frames // 9)。
- 按照计算出的间隔遍历视频,截取9帧画面。
3. **图像合并**:将截取到的9帧画面合并成一张大图,采用3行3列的网格布局。
4. **样式增强**:
- 为每张截图添加边框。
- 在生成的图像中插入文字。
- **文字大小约束**:文字的大小必须设置为图片尺寸的百分之一(1%)。
5. **代码质量**:
- 确保代码包含错误处理(如视频无法打开或帧数不足的情况)。
- 提供完整的函数定义,接受视频路径和输出路径作为参数。
# Communication & Style Preferences
- 使用中文回答。
- 提供可直接运行的Python代码示例。
- 代码应包含必要的注释说明关键步骤。
## Triggers
- 平均截取9张视频图片
- 视频生成九宫格
- 用opencv生成九张视频截图并合并
- 视频截图加边框和文字
- opencv视频九宫格
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.
**Complete production-ready guide for Google Gemini embeddings API** This skill provides comprehensive coverage of the `gemini-embedding-001` model for generating text embeddings, including SDK usage, REST API patterns, batch processing, RAG integration with Cloudflare Vectorize, and advanced use cases like semantic search and document clustering. ---
Recovers prior coding-agent session context by running `catchup <agent> --since-compact`, which extracts a clean summary of a previous Codex, Claude Code, Antigravity, OpenCode, or Pi Agent session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", or asks to recover/summarize a previous session before continuing. Do NOT use for the current conversation, git history, or any non-agent log.