fix(camera): raise minimum face brightness to 100
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
'use strict';
|
||||
// Real-phone feedback: ease alignment and normal hand/head movement while
|
||||
// retaining two checked frames, one face, framing and final JPEG validation.
|
||||
var config = Object.freeze({ version: '2026-10-15-angle-relaxed-20-v3', score: 0.4,
|
||||
var config = Object.freeze({ version: '2026-10-15-dark-100-v4', score: 0.4,
|
||||
near: 0.30, far: 0.68, center: 0.16, edge: 0.01,
|
||||
dark: 65, bright: 235, holdMs: 450, minFrames: 2, maxGapMs: 2000,
|
||||
dark: 100, bright: 235, holdMs: 450, minFrames: 2, maxGapMs: 2000,
|
||||
yawDrift: 8, pitchDrift: 8, centerDrift: 0.055, sizeDrift: 0.065 });
|
||||
function finite(v) { return typeof v === 'number' && isFinite(v); }
|
||||
function evaluate(d, options) {
|
||||
|
||||
@@ -146,7 +146,7 @@ try {
|
||||
for (const key of ['front', 'left', 'right']) {
|
||||
const row = body.capture_diagnostics.views[key];
|
||||
assert.equal(row.mode, 'live'); assert.equal(row.direction_checked, true);
|
||||
assert(row.score >= .4 && row.luma >= 65 && row.luma <= 235);
|
||||
assert(row.score >= .4 && row.luma >= 100 && row.luma <= 235);
|
||||
assert(Math.abs(row.roll) <= 18);
|
||||
}
|
||||
assert(Math.abs(body.capture_diagnostics.views.front.yaw) <= 18);
|
||||
|
||||
@@ -61,7 +61,8 @@ assert.equal(check(null).reason, 'quality');
|
||||
assert.equal(check(face(), { count: 2 }).reason, 'quality');
|
||||
const brokenLandmarks = face(); brokenLandmarks.landmarks.positions = [];
|
||||
assert.equal(check(brokenLandmarks).reason, 'quality', 'unreadable pose is not confirmed wrong angle');
|
||||
for (const luma of [70, 230]) assert(check(face(), { luma }).ok);
|
||||
for (const luma of [100, 100.01, 230, 235]) assert(check(face(), { luma }).ok);
|
||||
for (const luma of [65,70,99.99]) assert.equal(check(face(),{luma}).hint,'请到光线充足处');
|
||||
assert(check(face(), { offsetX: .15 }).ok);
|
||||
assert(!check(face(), { offsetX: .17 }).ok);
|
||||
for (const changes of [{ height: 190 }, { height: 400 }, { y: 8 }]) {
|
||||
@@ -114,7 +115,7 @@ assert.equal(Diagnostics.assess(raw).views.right.status, 'valid');
|
||||
const normalized = Diagnostics.normalize({ version: Quality.config.version, secret: 'discard', views: { front: { mode: 'live', yaw: 1, score: .9, luma: Infinity, secret: 'discard' }, left: { mode: 'unchecked', reason: 'model-unavailable' } } });
|
||||
assert.equal(normalized.policy.capture.holdMs, 450);
|
||||
assert.equal(normalized.policy.capture.minFrames, 2);
|
||||
assert.equal(normalized.version, '2026-10-15-angle-relaxed-20-v3');
|
||||
assert.equal(normalized.version, '2026-10-15-dark-100-v4');
|
||||
assert.equal(normalized.views.front.luma, undefined);
|
||||
assert(!JSON.stringify(normalized).includes('discard'));
|
||||
assert.equal(Diagnostics.normalize({ version: '<script>' }).version, 'unknown');
|
||||
|
||||
Reference in New Issue
Block a user