-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
HoughLines accumulator not being returned in Python #17050
Description
System information
- OpenCV => 3.4.4/4.2
- Operating System / Platform => Fedora Linux
- Language => Python 3.7
Detailed description
The cv.HoughLines function seems to be unable to return the value of the accumulator (votes) as it is instead possible in C++ since OpenCV 3.4. This issue seems to be discussed in the relevant PR, but I couldn't find a relevant issue nor a follow-up discussion.
In the HoughLines (python) documentation, the output vector lines seems to be an optional argument, but providing one as input seems to have no effect.
Steps to reproduce
Being a missing feature, there's not much to reproduce, but here's an example showing that lines is not used:
out_lines = np.zeros((3824, 1, 3))
ret_lines = cv2.HoughLines(img, 1, 0.1, 0, out_lines)
assert ret_lines.shape == out_lines.shape, "I was hoping for votes as well..."
assert not np.array_equal(out_lines, np.zeros((3824, 1, 3))), "Nothing changed in out_lines"
Both these asserts will fail. As a user, I would expect out_lines to be filled (with votes, as the array has 3 components) or its shape to be used to determine the shape of ret_lines, but neither happens.