|
An automated system for sorting coins by rarity does not currently exist.
Many sorting devices use image processing and pattern recognition techniques, but not for the purpose of identifying rare coins.
The goal of this project was to design and implement a new, unique, and patentable system for automatically sorting coins by mintage date and relative die rotation error.
The functional prototype applies template matching algorithms to images of a Canadian 5 cent coin, ultimately producing a measurement of the relative rotation between the two sides.
Further algorithms then extract and interpret the date using optical character recognition routines.
A mechanical system delivers the coins to the imaging system and, once the analysis has been completed, sorts them according to the categories "rare", "not rare", and "unrecognized".
The entire imaging system has been enclosed to ensure that the coins are illuminated uniformly.
|
|
The quality of the image processing results is fundamentally limited by the quality of the coin images.
High-quality images were defined to be those possessing the following four characteristics:
- In focus – edges of features are sharp with no blurring;
- Smooth – resolution is sufficiently high to avoid pixelation;
- Square – no image skew or geometric distortion; and
- Rotationally invariant – coin features are illuminated uniformly.
The first three characteristics are determined by the type of digital camera used for capturing the images.
The best results that could be obtained using a Logitech® QuickCam for Notebooks Pro® web camera are shown in Figure 1.
Note that the image lacks sharpness and is out of focus.
It was found that the Creative Labs Webcam Live!® web camera provided far superior results for this application.
As shown in Figure 2, the Creative Labs web camera is capable of producing images that are sharp and in focus.
A lighting environment was built that would facilitate the uniform illumination of both sides of the coin.
Each of the two polystyrene bases, shown in Figure 3, houses a web camera as well as LEDs used for fine-tuning the lighting conditions.
|
|
 |
 |
| Figure 1: Logitech® QuickCam® results. |
Figure 2: Creative Labs Webcam Live!® results. |
|
|
 |
| Figure 3: Imaging system of functional prototype. |
|
The images must first be cropped, removing as much of the background as possible without removing the edges of the coin.
The cropped images must then be resized in order to meet the input requirements of the template matching and optical character recognition algorithms.
Nearest neighbour, bilinear, and bicubic interpolation methods were compared, as shown in Figures 4 to 7.
Though bicubic interpolation provides the best results, it requires the greatest amount of computation time.
|
|
 |
 |
| Figure 4: Original image. |
Figure 5: Image resized using nearest neighbour interpolation. |
|
|
 |
 |
| Figure 6: Image resized using bilinear interpolation. |
Figure 7: Image resized using bicubic interpolation. |
|
|
Finally, the Canny edge detection algorithm is used to extract the edge information from the resized image.
This four-step algorithm proceeds as follows [1]:
- Minimize the effects of unwanted noise by filtering the image with a Gaussian smoothing function.
- Find the edges by searching for large differences in the brightness of neighbouring pixels.
- Trace along the edges until a sufficiently dark pixel is encountered, colouring edge pixels white.
- Colour all non-edge pixels black.
The result obtained by applying the Canny edge detection algorithm to a cropped, resized coin image using optimized parameters is shown in Figure 8.
|
|
 |
| Figure 8: Result obtained from Canny edge detection algorithm. |
|
The images of the coin are compared pixel-by-pixel, image-by-image to a database of rotated templates in order to determine the orientation of the coin and the relative die rotation between the two sides.
The template matching algorithm calculates the sum of the distances from each white pixel in the original image to the nearest white pixel in the template.
Typical results obtained using a database of 720 rotated templates, each separated by 0.5 degrees, are shown in Figure 9.
The sharp peak suggests that a good match has been found.
Finer resolution can be obtained by increasing the database size.
|
|
 |
| Figure 9: Results obtained from template matching algorithm. |
|
The region in which the date should appear is first extracted from the upright image, as shown in Figure 10.
Thresholding is then applied to the grey-scale image, making the lighter pixels white and the remaining pixels black, as shown in Figure 11.
The date is then segmented into its constituent digits, and a template matching algorithm is applied using a database of digits to determine the mintage date of the coin.
The digits of the date are segmented by finding columns in the image in which there are very few white pixels, as shown in Figure 12.
|
|
 |
 |
| Figure 10: Date extracted from upright image. |
Figure 11: Date region after thresholding. |
|
|
 |
| Figure 12: Distribution of white pixels after thresholding. |
|
The mechanical system is responsible for delivering coins to the imaging system and removing them once the analysis has been completed, which is accomplished with the arm shown in Figure 13.
A stepper motor accurately rotates the arm into position between the cameras so that the coin can be imaged.
Stepper motors are also used to actuate the two sorting flappers, shown in Figure 14.
Once the coin has been categorized as either "rare", "not rare", or "unrecognized", the two flappers adjust so that, as the arm passes over the hole in the plexiglass, the coin falls into the appropriate bin.
|
|
 |
| Figure 13: Coin positioning arm. |
|
 |
| Figure 14: Functional prototype with sorting flappers installed. |
|
The project to design and build a rare coin identification system was ambitious and challenging, but was also a tremendous success.
The design team learned a great deal about the application of image processing and pattern recognition techniques, as well as the integration of mechanical, electrical and software components into a multidisciplinary mechatronic system.
The functional prototype clearly demonstrated the main functionality of the idealized device.
|
|
|