ypv 2 дней назад
Родитель
Сommit
77efb59950
2 измененных файлов с 21 добавлено и 5 удалено
  1. 18 5
      ПМ.03.01/4.7.200/002/app.js
  2. 3 0
      ПМ.03.01/4.7.200/002/specification.md

+ 18 - 5
ПМ.03.01/4.7.200/002/app.js

@@ -365,9 +365,20 @@
     const w=image.width*scale,h=image.height*scale;
     return {x:(NV_W-w)/2,y:(NV_H-h)/2,w,h};
   }
-  function drawPhotoBase(ctx) {
+  function drawPhotoBase(ctx, monochrome=false, brightness=1) {
     ctx.fillStyle="#050505"; ctx.fillRect(0,0,NV_W,NV_H);
     photoFit=fitRect(uploadedPhoto); ctx.drawImage(uploadedPhoto,photoFit.x,photoFit.y,photoFit.w,photoFit.h);
+    // Thermal-view base: subdued monochrome scene so the simulated heat layer
+    // reads like a thermal display without hiding photographic texture.
+    if(monochrome){
+      const im=ctx.getImageData(0,0,NV_W,NV_H), d=im.data;
+      for(let i=0;i<d.length;i+=4){
+        const gray=(0.2126*d[i]+0.7152*d[i+1]+0.0722*d[i+2]);
+        const subdued=clamp((gray-18)*brightness,0,255);
+        d[i]=d[i+1]=d[i+2]=subdued;
+      }
+      ctx.putImageData(im,0,0);
+    }
   }
   function drawUploadedNV() {
     drawPhotoBase(nvCtx);
@@ -385,10 +396,12 @@
     nvFoot.textContent="Учебная симуляция ЭОП: яркость исходного фото условно зависит от усиления, освещённости и ИК-подсветки. Спектральные данные фото отсутствуют.";
   }
   function drawUploadedThermal() {
-    drawPhotoBase(thermalCtx);
+    // Both the background and the uncolored human remain a dim monochrome photo.
+    // The segmented thermal layer is a restrained transparent color overlay.
+    drawPhotoBase(thermalCtx,true,0.43);
     const ambient=+ambientInput.value, span=+spanInput.value;
     thermalReadout.textContent=`Фото · ${paletteInput.value} · ΔT=${span} K`;
-    thermalFoot.textContent="Фоновая псевдотепловая окраска условна. Для обнаруженного человека поверх фото нанесена прозрачная учебная карта: края холоднее, центральные области и голова/грудь ярче. Реальных температур фото не содержит.";
+    thermalFoot.textContent="Фон и исходные детали человека приглушены в чёрно-белом виде. Поверх сегментированного силуэта нанесена прозрачная учебная тепловая карта: периферия холоднее, центр и голова/грудь теплее. Это не измерение температуры.";
     if(personBox) drawPersonHeatOverlay();
   }
   function paletteRGB(name,t){
@@ -429,11 +442,11 @@
         const idx=(py*NV_W+px)*4;
         d[idx]=c[0];d[idx+1]=c[1];d[idx+2]=c[2];
         // Preserve photographic details: semi-transparent overlay, stronger in hot core.
-        d[idx+3]=Math.round(95+55*Math.max(head,chest,core));
+        d[idx+3]=Math.round(78+48*Math.max(head,chest,core));
       }
     }
     octx.putImageData(img,0,0);
-    thermalCtx.save();thermalCtx.globalAlpha=.86;thermalCtx.drawImage(overlay,0,0);thermalCtx.restore();
+    thermalCtx.save();thermalCtx.globalAlpha=.72;thermalCtx.drawImage(overlay,0,0);thermalCtx.restore();
   }
   function canvasPoint(canvas,e){const r=canvas.getBoundingClientRect();return {x:(e.clientX-r.left)*canvas.width/r.width,y:(e.clientY-r.top)*canvas.height/r.height};}
   async function loadPersonDetector(){

+ 3 - 0
ПМ.03.01/4.7.200/002/specification.md

@@ -3,6 +3,9 @@
 - **Что изменено:**
 
 
+ненаглядно, фон и человека надо приглушить сильнее, цвета тепловизора ярче, и сделать реакцию на ползунок "Температура фона"
+v.0.2.0.7 [color_more]
+
 сегментация отлично, менять не надо. Надо сделать более реалистичным фон (черно-белый, неяркий) и самого человека аналогично
 v.0.2.0.6 [color_man]