What a great Tutorial! Helped me a lot to finish a quick test that i needed, never used neither these technologies! Was just a bit confused at whick platform you've used, but i could figure it out! Ty!
how can you find the coordinate of the center for each coin, and print the results as (x,y) table???? Edit: (4hrs later),I found the solution: for i in cnt: M = cv2.moments(i) if M['m00'] != 0: cx = int(M['m10']/M['m00']) cy = int(M['m01']/M['m00']) print(f"x: {cx} y: {cy}") Thank me later!
Рік тому
Thanks! I just added an index to each coin: counter = 0 for i in cnt: M = cv2.moments(i) if M['m00'] != 0: counter +=1 cx = int(M['m10']/M['m00']) cy = int(M['m01']/M['m00']) print(f"[{counter}] x: {cx} y: {cy}")
Hi, thank you, great video. Could you please explain what the last 3 lines do?(apart from the print statement). I commented them out and the code still worked , counting 24 coins. Thanks again
@ross Hi, maybe you just ran the last cell after commenting, hence it ran. Rerun the whole program after commenting the lines. Contours helps to find the boundary or outline.
Don't forget to SUBSCRIBE !!
Image download link:
drive.google.com/file/d/1896XqiK_l9fg1K5yQDzXwBKWXnP_zqH7/view?usp=sharing
Hey where did you code
Thank you! This was really easy to follow and I like that you explained each parameter too.
Good tutorial man! This is easy to follow and nice for beginners!
wow thanks so much, I tried many tutorials for doing this and yours explained it the best.
Thank you, glad this helped u :)
What a great Tutorial! Helped me a lot to finish a quick test that i needed, never used neither these technologies! Was just a bit confused at whick platform you've used, but i could figure it out! Ty!
Thank you :) I have used Jupyter notebook.
Just do pip install jupyter to install it from your command prompt or terminal.
Good tutorial . Keep it up
thanks!
Hi, Thank you! How to count the number of coins when its arranged like a stack(Vertically)?
Can it read a tray full of pencils (white color pencil but contour is visible (roughly as the color is white), 4000+ pencils)?
if the contour is clear then yes with this method....
how can you find the coordinate of the center for each coin, and print the results as (x,y) table????
Edit: (4hrs later),I found the solution:
for i in cnt:
M = cv2.moments(i)
if M['m00'] != 0:
cx = int(M['m10']/M['m00'])
cy = int(M['m01']/M['m00'])
print(f"x: {cx} y: {cy}")
Thank me later!
Thanks!
I just added an index to each coin:
counter = 0
for i in cnt:
M = cv2.moments(i)
if M['m00'] != 0:
counter +=1
cx = int(M['m10']/M['m00'])
cy = int(M['m01']/M['m00'])
print(f"[{counter}] x: {cx} y: {cy}")
Thanks for the tutorial. It is helpful. But I lost my sense of balance at the 11x11 blur kernel 😂
Hello! Nice video, the code is very well written.
shortly well explained. If you can put the combined code it will be more easier to copy and paste.lol
hi, can i use this method to count irregular shapes? such as drone image of forest trees?
yes, but if there are other objects in the image apart from the trees, then it won't work properly, as it will detect them as well...
Hi, thank you, great video. Could you please explain what the last 3 lines do?(apart from the print statement). I commented them out and the code still worked , counting 24 coins. Thanks again
@ross Hi, maybe you just ran the last cell after commenting, hence it ran. Rerun the whole program after commenting the lines.
Contours helps to find the boundary or outline.
when i want make boundary the result become black image , i dont know why ?
check the variable names, maybe..
Sir,
I am getting "too many values to unpack error" in the line 18. that (cnt, heirarchy line )
please help me to resolve this
i think you are using an older version of opencv, try
img, cnt, hierarchy = ...
because older version returns 3 values.
can it be used for any coin image?
Yup, any object/coin....
Nice good work!
Thanks!
Omg i thought it would be incorrect but its correct wow.... Plz send image
i have shared now. use the above link to download.
Thank you very much for explanation!
Only one advice.
Please have eaten your breakfast before preparing your class. Hardly one can hear your voice.
;(
Could you please resolve my issue.
Hi Sonali, which issue can u elaborate?