send callibration
This commit is contained in:
@@ -235,7 +235,7 @@
|
||||
</select>
|
||||
<button id="btn-compute-calib">Kalibrierung berechnen</button>
|
||||
|
||||
<button disabled title="Folgt später">NPZ speichern</button>
|
||||
<button id="btn-upload-npz">NPZ speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -451,6 +451,27 @@
|
||||
}
|
||||
});
|
||||
|
||||
// "NPZ speichern" → an Webcam-Service übertragen
|
||||
document.getElementById('btn-upload-npz').addEventListener('click', async () => {
|
||||
const camera = document.getElementById('cam-select-calib').value;
|
||||
if (!camera) { logC('⚠ Bitte zuerst eine Kamera auswählen.'); return; }
|
||||
|
||||
logC(`NPZ wird an Webcam-Service übertragen (${camera}) …`);
|
||||
try {
|
||||
const r = await fetch('/api/calibration/upload-npz', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ camera }),
|
||||
});
|
||||
const d = await r.json();
|
||||
if (d.error) { logC(`❌ Fehler: ${d.error}`); return; }
|
||||
logC(`✅ Gespeichert: ${d.webcam?.saved} (${d.size} Bytes)`);
|
||||
logC(` calibrationUrl: ${d.webcam?.calibrationUrl}`);
|
||||
} catch (err) {
|
||||
logC(`❌ Fehler: ${err}`);
|
||||
}
|
||||
});
|
||||
|
||||
// "Kalibrierung berechnen" – SSE-Stream lesen
|
||||
document.getElementById('btn-compute-calib').addEventListener('click', async () => {
|
||||
const camera = document.getElementById('cam-select-calib').value;
|
||||
|
||||
Reference in New Issue
Block a user