The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Capstone coins classification

Capstone coins classification

Super Learner
0
Votes
2
Answer

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

2
Votes

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.

Super Learner
0
Votes

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

×
Learn Data Science
this Summer!
Get 50% OFF