title: How to improve detection of Probalistic Hough-Lines-Transform?
body: <p>I'm trying to detect a clock hand in a video of an analogue display and extract the value it points to. I'm using Python with OpenCV for this.</p>
  
  <p>What I essentially do is:</p>
  
  <ol>
  <li>I'm using a Gaussian Blur to lower the noise in the current image.</li>
  <li>I use Canny Edge Detection to filter the edges</li>
  <li>I apply the probalistic Hough Line Transform</li>
  </ol>
  
  <p>The Code for it:</p>
  
  <pre><code>def detect_clock_hand(img, center):
      # Convert to gray
      gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
  
      # Apply gaussian blur
      blur = cv2.GaussianBlur(gray, (11, 11), 0, 0)
  
      # Apply sobel edge detection
      edges = cv2.Canny(blur, 30, 40)
  
      # Apply HoughTransform
      lines = cv2.HoughLinesP(edges, 10, np.pi / 180, 5, 15, 50)
  
      #Filter lines in a given radius
      filtered_edges = util.filter_edges(lines, center)
  </code></pre>
  
  <p>I played a lot with the parameters to improve the results. The current status looks like this:</p>
  
  <ol>
  <li><p>Canny
  <a href="https://i.stack.imgur.com/Ac98z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ac98z.png" alt="Canny"></a></p></li>
  <li><p>Hough
  <a href="https://i.stack.imgur.com/WdoVb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WdoVb.png" alt="HoughLineTransformP"></a></p></li>
  </ol>
  
  <p>As you can see, the result just marks a part of the clockhand. And that part isn't event a 'good' part from what I can tell from the Canny Edge Detection. I'm wondering if I use the Hough Transform wrong or the Edge Detection actually isn't as good as I think it is. Since I'm new to Image Processing, I'd be greatful for any advice.</p>