← 返回
未分类

数黑棋子

Count black Go/Weiqi stones from source board photos, estimate black Chinese-area scoring, and render a clean static 19x19 result board image. Use when the u...
Count black Go/Weiqi stones from source board photos, estimate black Chinese-area scoring, and render a clean static 19x19 result board image. Use when the u...
imcaptor imcaptor 来源
未分类 clawhub v0.1.5 2 版本 100000 Key: 无需
★ 1
Stars
📥 306
下载
💾 1
安装
2
版本
#counting#go#latest#vision#weiqi

概述

Count Go Black Stones

Workflow

  1. Use the source board photo as input. Do not require or depend on a scoring-app result screenshot.
  2. Run scripts/count_go_black_stones.py on the image to detect the 19x19 grid, classify intersections as black, white, or empty, and compute:
    • black_stones: visible black stones on the board.
    • black_territory: empty intersections surrounded only by black stones.
    • black_area_chinese: black stones plus empty regions bordered only by black stones.
    • black_result_chinese: when black_area_chinese >= 185 on a 19x19 board, otherwise .
    • area_total_ok: sanity check that black area plus white area equals 19*19.
  3. Generate a clean static board with --result-image when the user asks for a result image. Actual stones are circles; surrounded territory is marked with small squares; the footer shows the black Chinese-area result, e.g. 黑 197 子 胜.
  4. Compare the script output with the image visually. Correct obvious misses before answering.
  5. State uncertainty when the board is blurry, cropped, obstructed, or has unsettled dead stones. Chinese-area scoring assumes dead stones have already been removed or are visually treated as alive.

Quick Start

Install script dependencies only if they are missing:

python3 -m pip install -r /path/to/count-go-black-stones/scripts/requirements.txt

Run the detector:

python3 /path/to/count-go-black-stones/scripts/count_go_black_stones.py /path/to/board.jpg \
  --result-image /tmp/go-result-board.jpg \
  --overlay /tmp/go-count-overlay.jpg

For JSON-only output:

python3 /path/to/count-go-black-stones/scripts/count_go_black_stones.py /path/to/board.jpg --json

If automatic board detection is wrong, pass the four board corners in image coordinates, ordered clockwise from top-left:

python3 /path/to/count-go-black-stones/scripts/count_go_black_stones.py board.jpg \
  --corners "74,76 1100,53 1118,1031 72,1034" \
  --result-image /tmp/go-result-board.jpg \
  --overlay /tmp/go-count-overlay.jpg

If the supplied corners are the four outer grid intersections rather than the wooden board corners, add --grid-corners.

Interpretation

  • Report black_stones when the user literally asks how many black stones are visible.
  • Report black_area_chinese when the user asks for 黑多少子, 数子, or 形势.
  • Treat area_total_ok: false as a sign that classification or life-and-death status needs review before trusting the result.
  • In the generated result image, circles are actual stones from the source photo; small squares are territory markers computed from surrounded empty intersections; the bottom score label uses black_area_chinese.
  • The result image and JSON use Chinese-area judgement for black: 19x19 black wins at black_area_chinese >= 185, after the standard 3.75子 komi.
  • In JSON, board_ascii contains only stones (X black, O white), while result_ascii separates stones from territory (X/O stones, x/o territory).
  • Treat black_area_chinese as a rules-based estimate, not an AI life-and-death judgment. If dead groups remain on the board, tell the user manual confirmation is needed.
  • Use the overlay when available to inspect classification mistakes: black stones are marked B, white stones W, black territory b, and white territory w.

版本历史

共 2 个版本

  • v0.1.5 当前
    2026-05-28 13:35
  • v0.1.2
    2026-05-26 23:56 安全 安全

安全检测

腾讯云安全 (Keen)

队列中

腾讯云安全 (Sanbu)

队列中

🔗 相关推荐

design-media

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 430 📥 117,015
design-media

UI/UX Pro Max

xobi667
提供 UI/UX 设计智能与实现指导,帮助打造精美界面。适用于 UI 设计、UX 流程、信息架构、视觉风格、设计系统/标记、组件规格、文案/微文案、无障碍及前端 UI(HTML/CSS/JS、React、Next.js、Vue、Svelte
★ 218 📥 47,741
education

go-next-move

imcaptor
根据图片或棋盘状态分析围棋局面,使用 KataGo 为初学者、中级或高级水平的玩家推荐下一步棋。
★ 0 📥 452