Counting Coins from Image using Python | Tutorial | Computer Vision Project

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 41

  • @ComputerVisionPro
    @ComputerVisionPro  4 роки тому

    Don't forget to SUBSCRIBE !!
    Image download link:
    drive.google.com/file/d/1896XqiK_l9fg1K5yQDzXwBKWXnP_zqH7/view?usp=sharing

  • @michaella5110
    @michaella5110 2 роки тому +1

    Thank you! This was really easy to follow and I like that you explained each parameter too.

  • @codintuna7679
    @codintuna7679 3 роки тому +3

    Good tutorial man! This is easy to follow and nice for beginners!

  • @ultraplayer3214
    @ultraplayer3214 4 роки тому +1

    wow thanks so much, I tried many tutorials for doing this and yours explained it the best.

  • @wallynm
    @wallynm 3 роки тому

    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!

    • @ComputerVisionPro
      @ComputerVisionPro  3 роки тому

      Thank you :) I have used Jupyter notebook.
      Just do pip install jupyter to install it from your command prompt or terminal.

  • @fahamidurrahaman1882
    @fahamidurrahaman1882 2 роки тому

    Good tutorial . Keep it up

  • @suganthiganesh6101
    @suganthiganesh6101 Рік тому

    Hi, Thank you! How to count the number of coins when its arranged like a stack(Vertically)?

  • @mdnaimulislamtanvir7677
    @mdnaimulislamtanvir7677 2 роки тому +1

    Can it read a tray full of pencils (white color pencil but contour is visible (roughly as the color is white), 4000+ pencils)?

  • @__Abu_Ali__
    @__Abu_Ali__ 2 роки тому +3

    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}")

  • @rishisharma5827
    @rishisharma5827 2 роки тому +1

    Thanks for the tutorial. It is helpful. But I lost my sense of balance at the 11x11 blur kernel 😂

  • @igordebastiani
    @igordebastiani 4 роки тому

    Hello! Nice video, the code is very well written.

  • @ijazahamed2951
    @ijazahamed2951 3 роки тому +1

    shortly well explained. If you can put the combined code it will be more easier to copy and paste.lol

  • @akunbaruini4609
    @akunbaruini4609 2 роки тому

    hi, can i use this method to count irregular shapes? such as drone image of forest trees?

    • @ComputerVisionPro
      @ComputerVisionPro  2 роки тому

      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...

  • @rosslambert6163
    @rosslambert6163 3 роки тому

    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

    • @ComputerVisionPro
      @ComputerVisionPro  3 роки тому

      @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 ?

  • @ashokkumarbhishma
    @ashokkumarbhishma 3 роки тому

    Sir,
    I am getting "too many values to unpack error" in the line 18. that (cnt, heirarchy line )
    please help me to resolve this

    • @ComputerVisionPro
      @ComputerVisionPro  3 роки тому

      i think you are using an older version of opencv, try
      img, cnt, hierarchy = ...
      because older version returns 3 values.

  • @nehalshaikh3756
    @nehalshaikh3756 3 роки тому

    can it be used for any coin image?

  • @RomanPittroff
    @RomanPittroff 4 роки тому

    Nice good work!

  • @arnavmehta3669
    @arnavmehta3669 4 роки тому

    Omg i thought it would be incorrect but its correct wow.... Plz send image

  • @bbnn7271
    @bbnn7271 3 роки тому

    Thank you very much for explanation!
    Only one advice.
    Please have eaten your breakfast before preparing your class. Hardly one can hear your voice.

  • @sonalikoli7809
    @sonalikoli7809 3 роки тому

    Could you please resolve my issue.