2

Problem:

Write a Java application to let user capture/upload any image. After which, program is to detect penny, nickel, dime and quarter coins from the image and show total of the coins (e.g. $1.21). Any other cash forms (like bills, notes, checks) are to be ignored.

No open source libraries are to be used.

What I need to know:

After a fair amount of research I figured out that Hugh Transform implementation can help. Personally, I have studied business economics and have a very limited knowledge of complex mathematics.

  1. Can someone direct me to source where I can study Hugh Transform from a beginner perspective?
  2. Let's say I figure out a way to detect circles (ellipses). How do I differentiate between different kind of coins.

    • Colors won't help since only penny has copper color. All other type of coins will have silver color.
    • Radius or diameter won't help either since photographs zoom level can also affect the output.
    • Finally, we can't compare relatively to other coins cause, there might be a possibility that nickel or penny might not be present in picture.

I know this is open-ended question. Any beginner level help and guidance will be appreciated.

2 Answers2

2

You have two different problems. First one is to simply find any circles on an image. That is what Hough Transform does. Second one is to associate a found circle with a coin. You will need here quite complex feature detection algorithm and I am not sure that it is essential for you to write all the code from scratch and not to use any open libraries. So I recommend you to stop researches on Hough transform or to change the conditions of your task. As for Hough transform, it is pretty simple algorithm without any complex math. If you have any problems with its realization you can check out opencv library with its open source code and use it as a starting point of your own implementation.

antonpp
  • 2,333
  • 23
  • 28
0

First some clarification questions

  • can coins overlap each other?
  • what is the low limit of resolution for source images?

I would approach like this:

  1. derivate the image to make edges visible
  2. add some processing to enhance edges and remove noise
    • morphological operators and smooth filters are good for this
    • may be some adaptive tresholding
    • the edges of coin perimeter and the embossed inside should be visible !!!
  3. create binary image
    • so just what is bellow treshold is black
    • and above is white ... or reverse
  4. find circles/ellipses
    • algebraically or by CHT (circle hough transform)
  5. process each ellipse
    • by comparing its internal edges to known coin image
    • can use any algo for that like:
    • simple OCR
    • polygon comparison
    • if found match to known coin image count its value to your sum
    • you can try to compare also non obvious things like
    • edge density,edge sizes histograms,etc.

This could be solved also by finding the right position of coint

  • so the circle detection stays as is
  • but for comparison
  • take found circle from source image
  • turn to grayscale
  • normalize size,contrast/lighting conditions to match known grayscale coint images
  • try all rotations with some step
  • substract source and known image
  • remember known image and rotation angle where the abs difference is minimal
  • at the end you should have the correct result
  • or if difference is bigger then treshold the coin is non of your supported ones
Community
  • 1
  • 1
Spektre
  • 49,595
  • 11
  • 110
  • 380