Elin24 / cclabeler

A web tool for labeling pedestrians in an image, provideing two types of label: box and point.
109 stars 25 forks source link

Point 有问题 #13

Open mightyroy opened 2 years ago

mightyroy commented 2 years ago
image

我弄了29多个point, 你看number已经30了,但是没有什么point出现!

mightyroy commented 2 years ago

我在用苹果Safari。

问题解决了,global.js 里的 drawPoint 需要更新:

function drawPoint(context, x, y, color = '#f00', width = 1) {
    context.beginPath();
    context.lineCap = 'round';
    context.moveTo(x-0.1, y-0.1);
    context.lineTo(x+0.1, y+0.1);
    context.closePath();
    context.lineWidth = width;
    context.strokeStyle = color;
    context.stroke();

}
Elin24 commented 2 years ago

为什么要加减0.1呢?

Sigurd-git commented 1 month ago

我这个成功了:

function drawPoint(context, x, y, color = '#f00', width = 1) { context.beginPath(); context.lineCap = 'round'; context.moveTo(x-5, y); context.lineTo(x +5, y); context.moveTo(x, y-5); context.lineTo(x, y + 5); context.closePath(); context.lineWidth = width; context.strokeStyle = color; context.stroke();

}