【发布时间】:2019-09-10 06:10:27
【问题描述】:
我们如何为使用 YOLO 检测到的不同对象设置不同的colors。现在检测到的所有内容都显示在绿色矩形中。
function draw() {
image(video, 0, 0, width, height); // Displaying image on a canvas
for (let i = 0; i < objects.length; i++) //Iterating through all objects
{
noStroke();
fill(0, 255, 0); //Color of text
text(objects[i].label, objects[i].x * width, objects[i].y * height - 5);
//Displaying the label
noFill();
strokeWeight(4);
stroke(0, 255, 0); //Defining stroke for rectangular outline
rect(objects[i].x * width, objects[i].y * height, objects[i].w * width,
objects[i].h * height);
}
}
【问题讨论】:
标签: javascript processing p5.js yolo