From 445349dd7d2ab81f2fd027f6f0575277d35882f4 Mon Sep 17 00:00:00 2001 From: Aleksandar Atanasov Date: Sun, 12 Jun 2016 12:55:29 +0200 Subject: [PATCH] Same fix as with the houghcircles Moved second `imshow()` inside the if-statement to prevent error when no lines have been found and the function is called with an empty `cdst`. --- samples/python/houghlines.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/python/houghlines.py b/samples/python/houghlines.py index 98c3640147..4a98828824 100755 --- a/samples/python/houghlines.py +++ b/samples/python/houghlines.py @@ -47,7 +47,8 @@ if __name__ == '__main__': pt1 = ( int(x0+1000*(-b)), int(y0+1000*(a)) ) pt2 = ( int(x0-1000*(-b)), int(y0-1000*(a)) ) cv2.line(cdst, pt1, pt2, (0, 0, 255), 3, cv2.LINE_AA) + + cv2.imshow("detected lines", cdst) cv2.imshow("source", src) - cv2.imshow("detected lines", cdst) cv2.waitKey(0)