'opencv Hough Circles 'overload resolution failed'

i = cv2.imread('./folder/image.png')
i = cv2.cvtColor(i, cv2.COLOR_BGR2GRAY)
circles = cv2.HoughCircles(i,cv2.HoughCircles,1.2,100)
print(circles)

Whenever I try to run the above code I keep getting this error:

Traceback (most recent call last):
  File "C:\Users\.....\Main.py", line 112, in <module>
    circles = cv2.HoughCircles(i,cv2.HoughCircles,1,20)
cv2.error: OpenCV(4.5.5) :-1: error: (-5:Bad argument) in function 'HoughCircles'
> Overload resolution failed:
>  - Argument 'method' is required to be an integer
>  - Argument 'method' is required to be an integer


Solution 1:[1]

Your calling args are wrong. Read the doc.

cv2.HoughCircles(   image, method, dp, minDist[, circles[, param1[, param2[, minRadius[, maxRadius]]]]] ) ->    circles
'''
    image: The input image.
    method: Detection method.
    dp: the Inverse ratio of accumulator resolution and image resolution.
    mindst: minimum distance between centers of detected circles.
    param_1 and param_2: These are method specific parameters.
    min_Radius: minimum radius of the circle to be detected.
    max_Radius: maximum radius to be detected. 
'''

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 balu