The documentation of HoughCircles says:
circles Output vector of found circles. Each vector is encoded as 3 or
4 element floating-point vector (x,y,radius) or (x,y,radius,votes)
This means that it is a vector of circles. So to print all the x,y,radius of each circle you can do:
for circle in circles:
print ("(x,y) = (",circle[0],",",circle[1], ") and radius =", circle[2] )
or:
print ("(x,y) = (",circle[0][0],",",circle[0][1], ") and radius =", circle[0][2] )
to print the first circle.
Also, for the mouse position it is possible to pass a subimage like:
# the position of the click as (x,y)
mousePosition = (10,15)
# the size of the image you want to look when you click (width, height)
swz = (20,20)
#calculate the box top corner so that is no less than 0 and the right bottom side less than image size
imgSize = img.shape
tl = (max(0, mousePosition[0] - (swz [0] / 2)), max(0, mousePosition[1] - (swz [1] / 2)))
tl = (min(tl[0], imgSize[1] - (swz [0] / 2)), min(tl[1], imgSize[0] - (swz [1] / 2)))
tl = (int(tl[0]), int(tl[1]))
circles = cv.HoughCircles(img[tl[1]:swz[1]+tl[1], tl[0]:swz[0]+tl[0]], cv.HOUGH_GRADIENT, 1, 20, param1=50, param2=30, minRadius=0, maxRadius=0 )
Then to draw them:
# make sure it found anything and make them int
circles = None if circles is None else np.uint16(np.around(circles))
cimg = cv.cvtColor(img,cv.COLOR_GRAY2BGR)
for i in circles[0,:]:
# draw the outer circle
cv.circle(cimg,(i[0]+tl[0],i[1]+tl[1]),i[2],(0,255,0),2)
# draw the center of the circle
cv.circle(cimg,(i[0]+tl[0],i[1]+tl[1]),2,(0,0,255),3)
An example of this will be with :
mousePosition = (100,170)
swz = (100,100)
and the OpenCVlogo as image and I get this search region:

and this result:
