Ring scanner: portrait streams, keep tightest blob
This commit is contained in:
@@ -376,7 +376,7 @@ export function locate(img, opts = {}) {
|
|||||||
}
|
}
|
||||||
g = g2; w = w2; h = h2;
|
g = g2; w = w2; h = h2;
|
||||||
}
|
}
|
||||||
// same disc seen at two levels: keep the finer fit
|
// same disc seen at two levels or cuts: keep the tightest blob, the others may have swallowed a ring
|
||||||
raw.sort((p, q) => q.area - p.area);
|
raw.sort((p, q) => q.area - p.area);
|
||||||
const cands = [];
|
const cands = [];
|
||||||
for (const c of raw) {
|
for (const c of raw) {
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ export function makeRingScanner(opts = {}) {
|
|||||||
if (d) return d;
|
if (d) return d;
|
||||||
}
|
}
|
||||||
track = null;
|
track = null;
|
||||||
const k = Math.min(1, WIDE / sw);
|
// phones held upright hand over a 1080x1920 stream
|
||||||
|
const k = Math.min(1, WIDE / Math.max(sw, sh));
|
||||||
wide.width = Math.round(sw * k); wide.height = Math.round(sh * k);
|
wide.width = Math.round(sw * k); wide.height = Math.round(sh * k);
|
||||||
// plain bilinear at 3x reduction skips pixels and keeps the noise
|
// plain bilinear at 3x reduction skips pixels and keeps the noise
|
||||||
wctx.imageSmoothingQuality = "high";
|
wctx.imageSmoothingQuality = "high";
|
||||||
|
|||||||
Reference in New Issue
Block a user