Yesterday I wrote about my big discovery that how amazing is Matlab and that little project I’ve made with it. Late night I couldn’t wait for today, so I started a 2nd project called…Coin Counting.

This application can summarize the content of our wallet, and we only have to take a picture about it.

The only  disadvantage it has: The image must contain a 200HUF coin.
The program decides the value of the coin from rate = randomHUF coin parameter / 200HUF coin parameter. This gives us a percentage so we can decide the size of the coin and than the value based on the information above.

This thread can go on, while we have different diameter sizes. (so it would work perfectly with the Euro coins)


  • Load an image
  • Create a binary image from the original
  • Decide if the background is black or white
  • If it’s black we can go on, If it’s white we have to invert it
  • Noise filtering
  • Fill in the holes (Binary image -> Processed image)
  • Get the region information (regionprops)
  • Sort the areas or diameters
  • Calculate the ratio (random coin / biggest one)
  • Than if we did it right we got good numbers and than with a simple ifelse structure we can decide the value of the coins

That’s it, we are done

Now I can sleep in peace because I was able to make a program like this.

I don’t know what will be my next step…Yet 🙂