Wow...my mind is racing with this....I wonder if there are any coin sorting systems with optical scanning and recognition to compare against a database of valuable coins....and if there isn't you should build one!!
I thought about doing just that 5-10 years ago when I was sorting heavily.
It would be a fun engineering challenge, but I don't think you'd ever get your money out of it compared to very simple approaches you could do with existing technology.
Using my searching experiences when I was searching heavily, almost all of the "valuable" coins I found were due to the metal content (silver) and not because of the rare date or variation. To find coins with a different metal content, all you would need is a Ryedale or equivalent and not any of the fancy optical and recognition technology. And for wheat pennies you can use a Ryedale and just hand sort the copper side to minimize the work.
I have done some work with image analysis, but not enough that I would consider myself an expert, so the rest of the entry is mostly my ideas and opinions. There may be other options available.
That being said, if someone were to take on the challenge here is my thoughts on how to do it and where the challenges might be:
Note: Any time I use the "reject" below, it just means put it in the hand-sort pile.
Step 1) Sort the coins to get 1 coin at a time to process.
Build a hopper and some type of processing device that allows the machine to get one coin at a time from the hopper onto some sort of belt or transport device in a consistent manner. I am assuming this is very doable by re-purposing the current coin hopper technology for this somehow.
Step 2) Take pictures of the coins
I would suspect that you would want at least 2 cameras. One to take a picture of each side of the coin rather than one camera and some type of flipping device. The higher definition the camera the better for likelihood of successful identification of the coin, but higher definition also means more pixels and the image processing will take longer.
To completely identify some coins you also would somehow need to take a picture of the rim which I suspect would be challenging. Most likely, I would skip the rim cameras and just hand sort those types of coins.
Step 3) Process the images to decide what denomination of coin is being processed
Once the pictures are taken, you would have to process the images.
* The first step would be to measure the diameter of the coin to determine what denomination the coin is. Alternately, you could have a method to preset the machine that it will only be processing coins of a certain denomination so that this test only confirms the size is correct and rejects all coins that are the wrong size.
* Sort any coin that is not a recognizable size to the reject slot for hand analysis.
Step 4) The denomination has been determined, now determine the series.
If you are processing cents, for example, is the coin an Indian Head Cent, a Wheat Cent, a Memorial Cent, etc.
* You will have two images and since you don't know which image is the obverse and which image is the reverse, you would need to analyze both images of the coin against all possible obverse and reverse designs.
* You also have no indication how the coin is rotated in the image, so you would have to find the best match against all possible rotations of all possible designs on both sides. Since coins can have rotation errors, it would be safest to process the images by rotating them independently and finding the best match for each image.
* In addition, coins are not always stamped perfectly centered, so you will need to have some way to process the images that allows for them to be detected even if stamped slightly off-center. So probably for each angle of rotation tested, the images will need to be shifted up or down a certain percentage looking for the best match.
Note: When considering the matching of the different designs, you also would have to consider that some coins (especially older ones) will be low grade coins and that the design features will be more worn thus making identifcation more difficult. Probably have to consider using just basic features for the processing such as what is visible for coins graded G or something like that.
* After completing processing of both the obverse image and the reverse image, if neither image is able to return a match percentage high enough to determine the coin series, send the coin to the reject pile for hand analysis. The coin could just be dirty or worn smooth, but it could also be a blank planchet, a foreign coin, or some other error that has value.
* If the obverse image and reverse image do not detect the same coin series, reject it.
* If the obverse image and reverse image detect the same coin series, but the rotation is greater than a set (ideally configurable) percentage, sort the coin to the error slot for closer analysis.
* If either the obverse image or the reverse image is detected as off center by greater than a set (ideally configurable) percentage, sort the coin to the error slot for closer analysis.
* (Optional) If the coin series is identified as one that is always discarded, sort it to the discard pile. If the date, mintmark, and variation are desired regardless, keep processing.
* (Optional) If the coin series is identified as one that is always kept, sort it to the keeper pile. If the date, mintmark, and variation are desired regardless, keep processing.
Step 5) The coin series is identified, determine the year.
After completing all the processing in the above steps, you finally know what type of coin you are processing, what orientation the coin is, how far off center the coin is and which image would display the date. Because of that, the processing should know where to find the date on the images.
* Use some type of character recognition to read the date from the images. Note that some coin series have slightly different variations of the digits and the character recognition would have to be able to handle that.
* If the date cannot be read, the software would need to decide whether to sort the coin to the reject slot (for hand analysis), the keeper slot (because it is a coin to save regardless of the date), or the discard pile (a coin to discard regardless of the date).
Step 6) The coin series and year is identified, determine the mintmark.
Now that the year has been determined, the software should know where to look for the mintmark on the image. Mintmark locations can vary even within coin series.
* Use some type of character recognition to read the mintmark from the images. Note that some coin series have slightly different variations of the mintmarks (both size and character style) and the character recognition would have to be able to handle that.
(Optional) Step 7) The year and mintmark have been identified, look for variations
At this point, the images could be processed to look for specific known errors or variations for the year and mintmark. For example the Close AM/Wide AM or large date/small date. Unfortunately, each design variation will probably have to be programmed in individually to be identified. Possible, but likely very time consuming and extremely hard to verify that the software is correct unless you have an example of that variation to test with.
Unfortunately, some of the variations are likely the most valuable coins that you can find in circulation.
Step 8) Once the coin has been fully identified, sort the coin to the appropriate slot
I can see 3 or 4 output slots for coins
* a discard pile for all coins that do not need to be kept.
* a reject slot for coins that need to hand analyzed
* an error slot for coins in which errors were detected.
* a keeper slot for coins that programmed to be keepers.
Ideally, all of the slots are configured programatically.
Another feature that could be added is that the software could keep a list of every coin processed, so you would know what was supposedly processed into each pile and why. This would only help with the hand analysis, sorting afterward.
Other challenges:
* Outside of the challenge of the image analysis itself which is quite daunting, coins are dirty and the camera's lenses would need to be kept clean.
* The time needed to process the images from steps 3 through 7 to determine what to do in step 8 has to be fast. The image size will be a big factor, but I am not sure if everything that needs to be done can be done fast enough to make it worthwhile. If you could process 1 coin per second (and I am not sure if you could get it that fast), processing $50 in cents would take almost 1.4 hours. For comparison, I typically could process $50 in cents in 30 minutes manually if only pulling wheats and older. If also processing for key errors and reading every date, $50 in cents used to take 1.5- 2 hours.
Summary:
* Cool? Yes.
* Challenging? Very much so.
* Worth the time and expense for the expected results? Only if the end solution is able to truly find rare variations and they occur often enough to provide a payback other than just the satisfaction of building the machine in the first place.
So, do you still think someone should build one?