|
|
@@ -443,10 +443,15 @@
|
|
|
if (px < photoFit.x || px >= photoFit.x + photoFit.w || py < photoFit.y || py >= photoFit.y + photoFit.h) continue;
|
|
|
if (maskData[my * maskW + mx] === 0) continue;
|
|
|
|
|
|
- // Anatomical heat profile: cooler extremities, warmer torso, strongest
|
|
|
- // local maxima at the head and upper chest. This is not thermometry.
|
|
|
+ // Anatomical heat profile: retain the existing warm head, chest and core,
|
|
|
+ // then add a distinct but smoothly blended maximum over the heart area.
|
|
|
+ // Coordinates are relative to the detected silhouette, not the full photo:
|
|
|
+ // x=0.54 is slightly to the subject's left (viewer-right in a frontal pose),
|
|
|
+ // y=0.40 places the focus in the upper torso. This is an illustration,
|
|
|
+ // not a measurement of real body temperature.
|
|
|
const head = Math.exp(-((((nx - 0.50) / 0.17) ** 2) + (((ny - 0.105) / 0.10) ** 2)) * 2.0);
|
|
|
const chest = Math.exp(-((((nx - 0.51) / 0.23) ** 2) + (((ny - 0.36) / 0.20) ** 2)) * 1.65);
|
|
|
+ const heart = Math.exp(-((((nx - 0.54) / 0.115) ** 2) + (((ny - 0.405) / 0.12) ** 2)) * 1.45);
|
|
|
const core = Math.exp(-((((nx - 0.50) / 0.29) ** 2) + (((ny - 0.43) / 0.34) ** 2)) * 1.25);
|
|
|
const shoulder = Math.exp(-((((nx - 0.50) / 0.34) ** 2) + (((ny - 0.24) / 0.13) ** 2)) * 1.3);
|
|
|
const outer = clamp(
|
|
|
@@ -455,9 +460,9 @@
|
|
|
1
|
|
|
);
|
|
|
|
|
|
- // Approximate absolute apparent skin temperatures, Kelvin.
|
|
|
- // Head/chest are hottest; the outer silhouette remains cooler.
|
|
|
- const temp = 289 + 3 * outer + 5 * core + 11 * head + 10 * chest + 2 * shoulder;
|
|
|
+ // The heart region has the highest model temperature. The broad chest
|
|
|
+ // contribution below keeps a continuous transition into the surrounding torso.
|
|
|
+ const temp = 289 + 3 * outer + 5 * core + 11 * head + 10 * chest + 2 * shoulder + 18 * heart;
|
|
|
const t = clamp((temp - displayMin) / displaySpan, 0, 1);
|
|
|
// Slight gamma compression keeps cooler extremities blue/green while
|
|
|
// allowing the head and chest to reach vivid orange/red values.
|