我必须使用 OpenCV 和 python 检测图像中的黄色圆圈,如第一张图所示:
一旦检测到黄色圆圈,我就必须突出显示它,如下所示:
我是 OpenCV 的新手,所以我正在寻求一些指导或帮助。感谢所有帮助
我想构建两个二维数组
a = [[0, 0, 0, 0, 0, 0],
[1, 1, 1, 1, 1, 1],
[2, 2, 2, 2, 2, 2],
[3, 3, 3, 3, 3, 3],
[4, 4, 4, 4, 4, 4],
[5, 5, 5, 5, 5, 5]]
b = [[0, 1, 2, 3, 4, 5],
[0, 1, 2, 3, 4, 5],
[0, 1, 2, 3, 4, 5],
[0, 1, 2, 3, 4, 5],
[0, 1, 2, 3, 4, 5],
[0, 1, 2, 3, 4, 5]]
Run Code Online (Sandbox Code Playgroud)
但我不能使用 for 循环。我知道我可以使用 …
为什么以下逻辑不起作用?
警告:当您单击"运行代码段"时,以下内容将启动无限循环.
var i = 0;
var currentLocation = 1;
while(currentLocation !== 9){
console.log(currentLocation);
currentLocation += i;
i++;
}Run Code Online (Sandbox Code Playgroud)
这进入了一个无限循环.但是如果我们替换currentLocation += i;它currentLocation++;,它按预期工作.只是好奇为什么会这样.
python ×2
arrays ×1
image ×1
increment ×1
javascript ×1
numpy ×1
opencv ×1
tile ×1
while-loop ×1