Ring locator: contrast ranking, all-round ink check; bench baseline switch
This commit is contained in:
@@ -88,7 +88,7 @@ window.runBench = async (cfg) => {
|
||||
clutter(sctx, 960, 720, rnd);
|
||||
if (!trial.nocode) {
|
||||
actx.clearRect(0, 0, A.width, A.height);
|
||||
render(actx, A.width / 2, A.height / 2, A.width / (2 * DISC), trial.theta, trial.bits, trial.anim);
|
||||
(cfg.v1 ? V1.render : render)(actx, A.width / 2, A.height / 2, A.width / (2 * DISC), trial.theta, trial.bits, trial.anim);
|
||||
const q = quad(480 + trial.dx, 360 + trial.dy, trial.d, trial.tilt, trial.axis, trial.dist || 3.5);
|
||||
sctx.drawImage(warp(A, q, 960, 720), 0, 0);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// far / low contrast bench: stills with per-stage diagnosis, and timed sequences
|
||||
import * as RC from "/static/js/ringcode.js";
|
||||
import { lcg, makeRoom, frame, jpeg } from "/static/ringlab/synth.js";
|
||||
import { lcg, makeRoom, frame, jpeg, design } from "/static/ringlab/synth.js";
|
||||
|
||||
import * as V1 from "/static/ringlab/ringcode_v1.js";
|
||||
import { makeRingScanner } from "/static/js/ringscan.js";
|
||||
@@ -131,6 +131,7 @@ function toneLab(img, T, t) {
|
||||
|
||||
window.runFar = async (cfg) => {
|
||||
const rnd = lcg(cfg.seed || 4242), results = [];
|
||||
design.v1 = !!cfg.v1;
|
||||
for (const t of cfg.trials) {
|
||||
const room = makeRoom(t.W, t.H, t.room, rnd);
|
||||
let f = frame(room, t, rnd);
|
||||
@@ -157,6 +158,7 @@ window.runFar = async (cfg) => {
|
||||
// seq: frame params + { fps, secs, interval, tokens: [{ bits, token }], shake }
|
||||
window.runSeq = async (cfg) => {
|
||||
const rnd = lcg(cfg.seed || 777), results = [];
|
||||
design.v1 = !!cfg.v1;
|
||||
for (const s of cfg.seqs) {
|
||||
const room = makeRoom(s.W, s.H, s.room, rnd);
|
||||
const res = { ...s, tokens: undefined };
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
// synthetic camera frames of a projected ring code: a washed-out screen in a room, seen by a phone sensor
|
||||
import { render, DISC } from "/static/js/ringcode.js";
|
||||
import { render as renderV1 } from "/static/ringlab/ringcode_v1.js";
|
||||
|
||||
// v1: draw the code as it was before the far-reading work, for baselines
|
||||
export const design = { v1: false };
|
||||
|
||||
export function lcg(seed) {
|
||||
let s = (seed >>> 0) || 1;
|
||||
@@ -51,7 +55,7 @@ function page(pw, ph, d, t, rnd) {
|
||||
const ctx = c.getContext("2d", { willReadFrequently: true });
|
||||
ctx.fillStyle = "#f5f6fa"; ctx.fillRect(0, 0, pw, ph);
|
||||
const cx = pw * 0.36, cy = ph * 0.54, unit = (d / 2 / DISC);
|
||||
if (!t.nocode) render(ctx, cx, cy, unit, t.theta, t.bits, t.anim, t.fade || null);
|
||||
if (!t.nocode) (design.v1 ? renderV1 : render)(ctx, cx, cy, unit, t.theta, t.bits, t.anim, t.fade || null);
|
||||
ctx.fillStyle = "#1c2036";
|
||||
ctx.font = `700 ${d * 0.11}px system-ui`; ctx.fillText("Inscription", pw * 0.66, ph * 0.2);
|
||||
ctx.font = `${d * 0.05}px system-ui`;
|
||||
|
||||
Reference in New Issue
Block a user