Ring code: two-cut locator, thicker dashes, first-token confirmation, scanner in vote page
This commit is contained in:
@@ -39,7 +39,9 @@ function diagnose(img, k, truth, t) {
|
||||
const T = (x, y) => { const [u, v] = truth(x, y); return [(u + 0.5) * k - 0.5, (v + 0.5) * k - 0.5]; };
|
||||
const [cx, cy] = T(0, 0), [ex, ey] = T(CENTER, 0), rpx = Math.hypot(ex - cx, ey - cy);
|
||||
const out = { rpx: +rpx.toFixed(1) };
|
||||
const cands = locate(img, { max: 60 });
|
||||
const dbg = { cx, cy, r: rpx, stage: "noblob" };
|
||||
const cands = locate(img, { max: 60, dbg });
|
||||
out.loc = dbg.stage;
|
||||
out.rank = cands.findIndex((c) => Math.hypot(c.cx - cx, c.cy - cy) < 0.3 * rpx);
|
||||
out.ncand = cands.length;
|
||||
if (out.rank >= 0) { const r = decodeAt(img, cands[out.rank], {}); out.candOk = !!(r && r.token === t.token); out.candScore = r ? +(+r.score).toFixed(2) : null; }
|
||||
|
||||
Reference in New Issue
Block a user