if variable is not none:

0

Hi, I'm working in python and openCV and I'm trying to find circles in my image. For this I use the function cv2.HoughCircles ()

Afterwards, what I intend is to show those circles on the screen ( AND I GET IT , it is in the proper explanation of the function the code. how to use cv2.houghcircles () )

Could you help me to finish understanding how it is working? I know it must be basic but for example to work it I had to add

if circles is not None:

And I do not finish understanding the reason because I do not really understand its meaning.

Full code.

circles = cv2.HoughCircles(grayFrame,cv2.HOUGH_GRADIENT,1,20,param1=50,param2=30,minRadius=0,maxRadius=0)

if circles is not None:
    for i in circles[0,:]:
        cv2.circle(grayFrame,(i[0],i[1]),i[2],(0,255,0),2)
        cv2.circle(grayFrame,(i[0],i[1]),2,(0,0,255),3)

Health!

    
asked by NEA 27.05.2018 в 23:53
source

0 answers