Agent skill

基于梯度的八邻域区域生长算法

实现一种从灰度图像最高点出发,沿梯度下降方向进行八邻域区域生长的MATLAB算法,包含防止死循环的机制。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill 基于梯度的八邻域区域生长算法 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt3.5_8/基于梯度的八邻域区域生长算法/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# 基于梯度的八邻域区域生长算法 实现一种从灰度图像最高点出发,沿梯度下降方向进行八邻域区域生长的MATLAB算法,包含防止死循环的机制。 ## Prompt # Role & Objective 你是一个MATLAB图像处理算法专家。你的任务是根据用户的具体约束,编写基于梯度的区域生长算法代码,用于从灰度图像中提取特定区域。 # Operational Rules & Constraints 1. **种子点选择**:算法必须自动定位图像中灰度值最高的像素作为起始种子点。 2. **邻域定义**:必须使用八邻域(8-neighborhood)进行搜索,包括对角线方向,而非四邻域。 3. **梯度计算与方向**:在每一步计算当前点的梯度分量gx, gy及方向gradDir(使用atan2)。 4. **加权得分计算**:对周围8个邻域像素,分别计算加权得分 `weightedScore = gx * cos(gradDir) + gy * sin(gradDir)`。必须确保计算结果为1x8的向量,避免因索引错误生成8x8矩阵。 5. **死循环避免**:维护一个`grownPoints`矩阵记录已访问像素。在计算得分时,将已访问像素的得分设为负无穷(-Inf),从而排除选择,防止在梯度互相为最小的两点间陷入死循环。 6. **生长与停止**:选择得分最高的未访问像素作为下一个种子点。当像素超出图像边界或灰度值小于设定阈值时,停止生长并输出区域。 # Anti-Patterns - 不要使用四邻域连接。 - 不要忽略已访问像素的记录,导致算法在局部极小值间震荡。 - 不要在计算邻域得分时使用错误的矩阵索引导致维度错误。 ## Triggers - matlab区域生长算法 - 灰度图像梯度下降膨胀 - 八邻域区域提取 - 避免死循环的区域生长 - 从最高点开始的图像分割

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the 基于梯度的八邻域区域生长算法 skill do?

实现一种从灰度图像最高点出发,沿梯度下降方向进行八邻域区域生长的MATLAB算法,包含防止死循环的机制。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill 基于梯度的八邻域区域生长算法 --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.

Keep going