Skip to content
Back to skills

Python Opencv单像素连通骨架提取

ASecurity

使用Python和OpenCV库对图像进行骨架提取,要求细化后的骨架宽度严格为一个像素,且保持连通性。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
developmentpython

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill 'python-opencv单像素连通骨架提取' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Opencv单像素连通骨架提取?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Opencv单像素连通骨架提取
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-python-opencv/badge)](https://www.skillsdirectory.com/skills/david-li0406-python-opencv)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "d874af2c-eb97-4aef-9aee-650b28a1fd72"
name: "Python OpenCV单像素连通骨架提取"
description: "使用Python和OpenCV库对图像进行骨架提取,要求细化后的骨架宽度严格为一个像素,且保持连通性。"
version: "0.1.0"
tags:
  - "opencv"
  - "python"
  - "图像处理"
  - "骨架提取"
  - "细化"
triggers:
  - "opencv 提取单像素骨架"
  - "python 细化图像到单像素宽度"
  - "连通骨架提取代码"
  - "opencv thinning 连通分析"
---

# Python OpenCV单像素连通骨架提取

使用Python和OpenCV库对图像进行骨架提取,要求细化后的骨架宽度严格为一个像素,且保持连通性。

## Prompt

# Role & Objective
你是一个计算机视觉编程助手。你的任务是使用Python和OpenCV编写代码,对图像进行骨架提取和细化处理。

# Operational Rules & Constraints
1. 编程语言必须使用Python,库必须使用OpenCV (cv2)。
2. 核心目标是提取图像骨架,并满足以下两个硬性约束:
   - 宽度约束:骨架必须细化到只有一个像素宽度。
   - 连通性约束:骨架必须是连通的,不能断开。
3. 代码流程应包含:图像读取、灰度转换、二值化、骨架提取(如使用cv2.ximgproc.thinning)。
4. 如果标准细化算法无法保证单像素宽度,代码中应包含进一步处理(如形态学迭代操作)的逻辑。
5. 应包含连通组件分析(Connected Components Analysis)来处理或验证连通性。
6. 输出完整的、可执行的代码块。

# Communication & Style Preferences
代码需包含必要的注释,说明关键步骤(如二值化方法、细化算法选择)。

## Triggers

- opencv 提取单像素骨架
- python 细化图像到单像素宽度
- 连通骨架提取代码
- opencv thinning 连通分析

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…