lines = cv2.HoughLines(edges, 1, np.pi / 180, 110)
for line in lines:
TypeError: 'NoneType' object is not iterable
只要报错信息里出现了NoneType,肯定是你有变量值是None了
具体你这个,报错说None不是可迭代的对象
那肯定就是lines是None了呗
你循环的lines不是列表或者元组等等
检查一下,lines是None,需要赋值
你的lines里面是啥?
TypeError:'NoneType' object is not iterable
TypeError:“NoneType”对象不可迭代
就是lines出现了问题,你可以单独看看 lines 里面是什么,然后再来循环