Intégration de la reco d'image à l'interface borne

This commit is contained in:
Quentin Roussel
2023-03-22 14:39:56 +01:00
parent 15bc1c7714
commit d896767543
11 changed files with 131 additions and 156 deletions

View File

@@ -84,7 +84,6 @@ class CameraPage {
_frame() {
if (this.streaming && this.enabled && this.width && this.height) {
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
// this.ctx.drawImage(this.video, 0, 0, this.width, this.height);
this._drawEffects();
}
if (this.enabled) {
@@ -106,6 +105,11 @@ class CameraPage {
_drawEffects() {
for (let effect of this.activeEffects) {
let { x, y, width, height } = this._scaleEffect(effect.x, effect.y, effect.width, effect.height);
width = width * this.videoWidth * 2;
height = height * this.videoHeight * 2;
x = x * this.videoWidth - width / 2;
y = y * this.videoHeight - height / 2;
console.log(width, height);
if (effect.type == "thumbs_down") {
this._drawThumbsDown(x, y, width, height);
}