Add center to detection
This commit is contained in:
parent
cef703104b
commit
37d60fd576
1 changed files with 5 additions and 1 deletions
6
dist/static/assets/webcam.js
vendored
6
dist/static/assets/webcam.js
vendored
|
@ -307,11 +307,15 @@ function parseDetectionResults(results) {
|
||||||
y: result.alignedRect._box._y * factor_y,
|
y: result.alignedRect._box._y * factor_y,
|
||||||
width: result.alignedRect._box._width * factor_x,
|
width: result.alignedRect._box._width * factor_x,
|
||||||
height: result.alignedRect._box._height * factor_y,
|
height: result.alignedRect._box._height * factor_y,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
for(let idx in result.parts) {
|
for(let idx in result.parts) {
|
||||||
detection.parts[idx] = result.parts[idx].map((pos) => parseCoordinate(pos));
|
detection.parts[idx] = result.parts[idx].map((pos) => parseCoordinate(pos));
|
||||||
}
|
}
|
||||||
|
detection['center'] = {
|
||||||
|
x: detection.box.x + detection.box.width / 2,
|
||||||
|
y: detection.box.y + detection.box.height / 2,
|
||||||
|
}
|
||||||
detections.push(detection);
|
detections.push(detection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue