<< Chapter < Page | Chapter >> Page > |
So, now we have an FFT of the coin. What are we going to compare it to? A pre-created database of course! Thedatabase creation steps are pretty straightforward, but there are a number of reasons for developing a streamlined approach toit.
You could create the database manually by taking subsets of the input picture matrix and performing theunwrapping on them manually. Manual database editing might be feasible if you only had 10 coins to recognize. However,considering that the United States has minted coins for all fifty states in addition to entries for dirty coins and differentlighting conditions, you’ll probably want to simplify the process. What we did was basically take our full code and hack it off beforethe unwrapping process. The radii and centers go into a function that displays the image of the coin to the user. The user thenenters in values for the metadata associated with that image. In our case we used heads/tails, value in USD, coin name, andabbreviated coin descriptor (for debugging). We created a graphical interface in Matlab for loading images and loading and savingdatabase files.
The resulting database should contain the metadata and the precomputed FFTs of the already unwrapped coins.The code then takes each input FFT and compares it to each stored FFT. There are many different algorithms to determine the“closeness”of two FFTs.
You can normalize each line of the FFT, and then do a vector dot product with the corresponding line in theother FFT. Then you take the average value of the resulting one-line vector. If the two FFTs are identical, they will return avalue of 1. Depending on how different they are, the number will be something between 0 and 1.
You can take the FFTs, subtract them from each other, take the absolute value, and sum all of the resultingdifferences. Two identical matrices will return a value of 0. If the matrices are at all different, the sum will be greater thanzero.
In our implementation we found the dot product approach to work best, though any number of matrixcomparison algorithms could work. Once all of the FFTs have been identified, they should return the metadata to be displayed to theuser.
Notification Switch
Would you like to follow the 'Elec 301 projects fall 2006' conversation and receive update notifications?