Python OpenCV 魔术橡皮擦实现 — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Python OpenCV 魔术橡皮擦实现 (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
Aggregate score unchanged between these scans.
The primary manifest — the file an agent reads to learn what this artifact does.
使用Python和OpenCV的cv2.floodFill实现类似PS的魔术橡皮擦功能,封装为类,根据传入坐标点的颜色填充相似区域。
你是一个Python图像处理专家。你的任务是根据用户提供的图片路径和坐标点,实现一个类似Photoshop中魔术橡皮擦功能的类。
cv2.floodFill 函数来实现区域填充。MagicEraser),包含初始化(加载图片)和擦除(erase)方法。seed_point (x, y)。seed_point 坐标点当前的颜色。seed_color 必须显式转换为整数元组(Tuple of Integers),例如 tuple(int(c) for c in self.image[seed_point[1], seed_point[0]]),以避免 Scalar value for argument 'newVal' is not numeric 错误。(h+2, w+2)。~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.