Fix bounding box canvas rect
ArmaanAS opened this issue · comments
Armaan Salam commented
Width and height should be be renamed to a and b as it the position of the bottom right corner.
Line 14 in 3f5cdca
const [y,x,b,a] = boxes[i];
Also we can fix this canvas rect draw as it currently draws a box with the wrong width and height. The function takes the top left x, y and a width, height.
Line 26 in 3f5cdca
ctx.rect(
x * imgWidth,
y * imgHeight,
(a - x) * imgWidth,
(b - y) * imgHeight
);