title: OpenCV Hough Circle Transform Not Working
body: <p>I have followed OpenCV's tutorial <a href="http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_imgproc/py_houghcircles/py_houghcircles.html#additional-resources" rel="nofollow noreferrer">here</a> for circle detection on my Raspberry Pi. This is the code that I am using which is the same as the tutorial except a different image.</p>
  
  <pre><code>import cv2
  import numpy as np
  
  img = cv2.imread('watch.jpg',0)
  img = cv2.medianBlur(img,5)
  cimg = cv2.cvtColor(img,cv2.COLOR_GRAY2BGR)
  
  circles = cv2.HoughCircles(img,cv2.HOUGH_GRADIENT,1,20,
                         param1=50,param2=30,minRadius=0,maxRadius=0)
  circles = np.uint16(np.around(circles))
  for i in circles[0,:]:
      cv2.circle(cimg,(i[0],i[1]),i[2],(0,255,0),2)
      cv2.circle(cimg,(i[0],i[1]),2,(0,0,255),3)
  
  cv2.imshow('image',cimg)
  cv2.waitKey(0)
  cv2.destroyAllWindows()
  </code></pre>
  
  <p>Then when I ran the script this is what I was presented with this
  <a href="https://i.stack.imgur.com/WppR6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WppR6.jpg" alt="enter image description here"></a></p>
  
  <p>and this is the original image</p>
  
  <p><a href="https://i.stack.imgur.com/eSrPR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eSrPR.jpg" alt="enter image description here"></a></p>
  
  <p>What is causing this to happen?</p>
  
  <p>Thank You in Advance!</p>
  
  <p>Edit:</p>
  
  <p><a href="https://i.stack.imgur.com/qBHwd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qBHwd.jpg" alt="enter image description here"></a></p>