AgentSkillsCN

metrology-invariants

在实现或审查任何亚像素级别的功能(边缘、激光、轮廓线)时,可优先使用此技能。有效防范隐性坐标与约定偏差带来的潜在问题。

SKILL.md
--- frontmatter
name: metrology-invariants
description: Use this when implementing or reviewing anything subpixel (edges, laser, contours). Prevents silent coordinate and convention bugs.

Metrology invariants (pixel-center world)

Coordinate convention

  • Integer index i corresponds to pixel center at i as f32.
  • Subpixel values are expressed in the same coordinate system.

Subpixel outputs

  • Always specify what x/y means in docs (center coordinates).

  • Provide tolerances in tests:

    • quick unit tests: ~0.1 px is fine
    • precision tests (later): push toward 0.05 px on higher-fidelity fixtures

Robustness

  • Prefer edge-pair (Rising→Falling) for laser stripes over intensity peak fitting.

  • If the algorithm uses an ROI around a predicted center, document:

    • how prediction is formed
    • what happens on gaps / reacquisition