Last answered:

09 Jun 2020

Posted on:

26 May 2020

0

Capstone coins classification

Hello, I can not achieve the same result as in the lesson when running the capstone_solution.py app. The screenshot in attachment. Has anybody similar effect? Changing blur parameters the app can find max six coins but I do not understand why it works different way.
2 answers ( 0 marked as helpful)
Posted on:

07 Jun 2020

2

I had the exact same issue where only 3 circles were identified instead of 8. I found the answer to my solution by reading a stack overflow post explaining what param1 and param2 do, you can read it for yourself here.

Essentially, you need to change the values for param1 and param2. While even I don't understand the full effect these have on the image processing, what I do understand is that param1 controls sensitivity with higher numbers equating to more circles being found and vice versa, and param2 has to do with the number of edge points needs to declare a circle.

I personally was able to get the 3 circles (coins) to register when using param1=60 and param2=15. Also, in case any other changes I made affected my outcome, here is the whole line of code:

circles = cv.HoughCircles(img,cv.HOUGH_GRADIENT,0.9,120,param1=60,param2=15,minRadius=70,maxRadius=130)

This should help get your code to register all of the coins as circles, but if my exact solution doesn't work for you, continue playing around with those values until you are able to get different results.

Posted on:

09 Jun 2020

0
Thanks Collin for your answer. I played with the parameters for a while and I found the combination when the script recognized all coins perfectly ( param1 = 54, param2=16, minRadius=50, maxRadius= 90. Radius is important as well). Value recognition was not correct but probably rules should be upgraded. But in general it was manual factors search so is not useful method to do anything.... Regards

Submit an answer