

我使用的是cv2.houghlinesP,我看到很多人在参数中传递一个空数组。
大概是这样的-
lines = cv2.HoughLinesP(img, rho, theta, threshold, np.array([]), minLineLength=min_line_len, maxLineGap=max_line_gap)np.array([])在这里扮演什么角色?
发布于 2019-09-13 02:03:14
我认为这个函数的Python文档中可能有不足之处。对于大多数C/C++函数,您提供了一个指向结果数组的指针,结果数组将被填充。但在Python中,通常只是将整个结果传递回来。
对于HoughLinesP,您可以follow this post或this tutorial并完全删除空数组:
lines = cv2.HoughLinesP(img, rho, theta, threshold, minLineLength=min_line_len, maxLineGap=max_line_gap)https://stackoverflow.com/questions/57911974
复制相似问题