Ring code: far/washed projector bench, multi-scale locator with ring check

This commit is contained in:
2026-11-16 19:08:56 +01:00
parent fe657fd189
commit be3aab62d9
6 changed files with 1301 additions and 136 deletions
+4 -2
View File
@@ -5,6 +5,8 @@
<script type="module">
import { render, decodeFrame, grayOf, locate, decodeAt, DISC } from "/static/js/ringcode.js";
import * as RC from "/static/js/ringcode.js";
import "/static/ringlab/far.js";
import * as V1 from "/static/ringlab/ringcode_v1.js";
// warps canvas `src` onto a new w x h canvas so that src's unit square maps to quad `dst` (perspective)
function warp(src, dst, w, h, bg) {
@@ -99,7 +101,7 @@ window.runBench = async (cfg) => {
cctx.putImageData(id, 0, 0);
}
const t0 = performance.now();
const d = decodeFrame(grayOf(cctx.getImageData(0, 0, 960, 720)));
const d = (cfg.v1 ? V1.decodeFrame : decodeFrame)(grayOf(cctx.getImageData(0, 0, 960, 720)));
const out = { found: d.found, token: d.token, score: d.score == null ? null : +d.score.toFixed(3), ms: Math.round(performance.now() - t0) };
out.ok = trial.nocode ? !d.token : d.token === trial.token;
if (d.bits && !trial.nocode) {
@@ -148,6 +150,6 @@ window.debugOne = (trial) => {
}
return { quad: q, cTrue, cEst, radial, cands: out.map((o) => ({ ...o, r: o.r && { token: o.r.token, score: o.r.score, bits: o.r.bits } })) };
};
window.benchReady = true;
window.benchReady = true; globalThis.NOFIT = new URLSearchParams(location.search).has("nofit");
</script></head>
<body></body></html>