agentsclimarketplace

Python opencv单像素连通骨架提取

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt3.5_8/python-opencv单像素连通骨架提取

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

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill python-opencv单像素连通骨架提取

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

1.8 KB, 461 tokens by cl100k_base, as published. Nobody here has run it

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 连通分析

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.