Jam*_*ett 6 python arrays plot geometry opencv
我已经能够生成一个坐标列表,我想将其用作我想在图像上绘制的多个小圆圈的中心。
我能够在各个点绘制圆圈,但无法找到在所有中心绘制圆圈的正确语法。我希望用于中心的坐标存储如下,在名为 Points 的数组中,其形状为 :(11844, 2)
[[ 5 5]
[ 5 10]
[ 5 15]
...,
[630 460]
[630 465]
[630 470]]
Run Code Online (Sandbox Code Playgroud)
我可以使用以下代码绘制单个圆圈:
cv2.circle(frame1,(5,5),1,(0,0,255))
Run Code Online (Sandbox Code Playgroud)
我尝试使用以下方法绘制所有点:
cv2.circle(frame1,Points[:,:],1,(0,0,255))
Run Code Online (Sandbox Code Playgroud)
不过,这会返回此错误:
cv2.circle(frame1,Points[:,:],1,(0,0,255))
SystemError: new style getargs format but argument is not a tuple
Run Code Online (Sandbox Code Playgroud)
我是否应该使用循环来遍历所有点并一一绘制它们?如果是这样,我应该使用哪个循环?或者有什么简单的东西我错过了?
我设法在 Joel 的帮助下使用以下代码找到了答案:
for point in Points:
cv2.circle(frame1,tuple(point),1,(0,0,255))
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8361 次 |
| 最近记录: |