用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/cxcscmu/SkillLearnBench --skill object-counting-in-images命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | object-counting-in-images |
| description | Detect and count occurrences of template images within a larger target image. |
To count occurrences of a template object within a scene image, use OpenCV in Python:
import cv2
import numpy as np
def count_objects(scene_path, template_path, threshold=0.8):
img = cv2.imread(scene_path, cv2.IMREAD_GRAYSCALE)
template = cv2.imread(template_path, cv2.IMREAD_GRAYSCALE)
w, h = template.shape[::-1]
res = cv2.matchTemplate(img, template, cv2.TM_CCOEFF_NORMED)
loc = np.where(res >= threshold)
# Filter matches to ensure they are distinct objects
count = 0
matches = []
for pt in zip(*loc[::-1]):
if not any([abs(pt[0]-m[0]) < w and abs(pt[1]-m[1]) < h for m in matches]):
matches.append(pt)
count += 1
return count