【发布时间】:2020-04-06 12:18:58
【问题描述】:
我有一组来自图像的坐标。使用这些坐标,我想在图像上绘制线条。在尝试时,我遇到了错误。请帮我解决这个问题。下面是代码。
[((line[0, 0], line[0, 1]), (line[1, 0], line[1, 1])) for line in lines[:nlines]]
print(lines[:lines])
for i in lines:
x1,y1,x2,y2=i[0]
cv2.line(image,(x1,y1),(x2,y2),(255,0,0),2)
cv2.imshow("Image",image)
cv2.waitKey(0)
错误:
x1,y1,x2,y2=line[0]
ValueError: not enough values to unpack (expected 4, got 2)
积分输出:
[[[1150 327]
[1166 316]]
[[1146 475]
[1158 467]]
[[ 903 322]
[ 911 320]]
...
[[ 364 403]
[ 374 402]]
[[ 644 570]
[ 649 569]]
[[ 249 645]
[ 255 644]]]
【问题讨论】:
标签: python opencv image-processing hough-transform straight-line-detection