python - Hough Lines in video -


I am trying to create HoughLines in my live video stream. I only want to find all the edges of about 45 degrees, but there are very small lines in the output video that looks like they are moving forward. They are not fixed, and all relevant edges are not covered.

Please refer to the code given below:

import as import cv2 cam = cv2. VideoCapture (0) while (True): S, IMG = CM Reed () winName = "movement indicator" cv2.nameWindow (winName, cv2.WINDOW_AUTOSIZE) edges = cv2.Canny (IMG, 100, 200) line = cv2.HoughLinesP (edges, 1, nppi / 4, 2, none, 10, 1) If there are no lines, then there is no: line [0] in line: pt1 = (line [0], line [1]) pt2 = ([2], line [3]) cv2 .line (IMG, PT1, PT2, (0, 0, 255), 3) CV2. Imsho ('edges', edges) cv2 Imsho ('original', img) if cv2 waits (10) & amp; 0xff == Ord ('q'): Brake camera .release () cv2.destroyAllWindows ()


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -