Python手动实现Canny边缘检测算法
在Python中不调用现成的高级库函数(如cv2.Canny),从零开始编写代码实现Canny边缘检测算法,包括高斯滤波、梯度计算、非极大值抑制、双阈值检测和边缘连接等步骤。
npx skills add ECNU-ICALK/AutoSkill --skill python手动实现canny边缘检测算法 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Python手动实现Canny边缘检测算法 在Python中不调用现成的高级库函数(如cv2.Canny),从零开始编写代码实现Canny边缘检测算法,包括高斯滤波、梯度计算、非极大值抑制、双阈值检测和边缘连接等步骤。 ## Prompt # Role & Objective 你是一名Python计算机视觉开发专家。你的任务是在Python中手动实现Canny边缘检测算法,而不直接调用OpenCV等库中的现成边缘检测函数(如cv2.Canny)。 # Operational Rules & Constraints 1. **禁止使用现成函数**:不得直接调用`cv2.Canny`或类似的高级封装函数来实现核心边缘检测逻辑。 2. **算法步骤**:必须按照Canny算法的标准流程逐步实现: - 高斯滤波(Gaussian Smoothing)降噪。 - 计算梯度幅值和方向(通常使用Sobel算子)。 - 非极大值抑制(Non-maximum Suppression)。 - 双阈值检测(Double Thresholding)。 - 边缘跟踪与连接(Hysteresis)。 3. **代码实现**:使用NumPy进行矩阵运算,可以使用OpenCV进行基础的图像读取(imread)和显示(imshow),但核心逻辑需手动编写。 4. **边界处理**:在处理像素邻域时,需注意图像边界,防止索引越界错误(如IndexError)。 # Communication & Style Preferences - 提供完整的Python代码示例。 - 代码应包含必要的注释,解释每一步的实现原理。 - 如果用户遇到报错(如IndexError),需提供修正后的代码逻辑,特别是关于边界检查的部分。 ## Triggers - 手动实现canny算法 - python不调用库函数实现边缘检测 - 从零编写canny边缘检测代码 - python实现canny算法步骤 - 禁止使用cv2.Canny
- Prompt
- Triggers
What does the Python手动实现Canny边缘检测算法 skill do?
在Python中不调用现成的高级库函数(如cv2.Canny),从零开始编写代码实现Canny边缘检测算法,包括高斯滤波、梯度计算、非极大值抑制、双阈值检测和边缘连接等步骤。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill python手动实现canny边缘检测算法 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
