title: error: (-215:Assertion failed) !_image.empty() && _image.type() == CV_8UC1 && (_image.isMat() || _image.isUMat()) in function 'cv::HoughCircles'
body: <p><b> Note :</b></p>
  <p>Hai, I'm new to OpenCV and Stackoverflow.</p>
  <p>I'm trying to get the result by detecting a circle inside the circle using cv2.HoughCircles as my methods.</p>
  <p>And here's a simple code that I tried already:</p>
  <pre><code>import cv2
  import numpy as np
  
  pic= cv2.imread('septoria.jpg')
  gray = cv2.cvtColor(pic,cv2.COLOR_BGR2GRAY)
  
  _,thres = cv2.threshold(gray, 50,260, cv2.THRESH_TOZERO)
  res = cv2.Canny(thres, 100, 200, L2gradient=True)
  
  circles = cv2.HoughCircles(res,cv2.HOUGH_GRADIENT,1,20,param1=200,param2=25,minRadius=90,maxRadius=130)
  for i in circles[0,:]:
      
      i = i.astype(int)
      crop = res[i[1]-i[2]:i[1]+i[2], i[0]-i[2]:i[0]+i[2]]
      mask = np.zeros(crop.shape)
      mask = cv2.circle(mask, (i[2], i[2]), i[2], (255, 255, 255), -1)
      final_im = mask * crop
      print(final_im.shape)
      circles2 = cv2.HoughCircles(final_im,cv2.HOUGH_GRADIENT,1,20,param1=20,param2=5,minRadius=0,maxRadius=20)
      for j in circles2[0,:]:
          cv2.circle(final_im,(int(j[0]),int(j[1])),int(j[2]),(255,0,0),2)
  
  cv2.imshow('Hole',final_im)
  cv2.waitKey(0)
  cv2.destroyAllWindows()
  </code></pre>
  <p>Final_im return shape (206, 206)</p>
  <p>And give error like this</p>
  <pre><code>error: OpenCV(4.5.2) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-inblc7p7\opencv\modules\imgproc\src\hough.cpp:2253: error: (-215:Assertion failed) !_image.empty() &amp;&amp; _image.type() == CV_8UC1 &amp;&amp; (_image.isMat() || _image.isUMat()) in function 'cv::HoughCircles'
  
  </code></pre>
  <p>The compiler said that I have wrong code in line 20:</p>
  <pre><code>circles2 = cv2.HoughCircles(final_im,cv2.HOUGH_GRADIENT,1,20,param1=20,param2=5,minRadius=0,maxRadius=20)
  </code></pre>
  <p>Can anyone tell me what's wrong in here, and tell me how to solve it??</p>