Start with an original scanned image:
Images to the right are cropped portions of the original image.
Use your code from asgn 6 to convert the image to binary
Use morphological functions to eliminate voids in the binary image, without changing the size of the blobs. Use your code from asgn 8.
Use Connect1 to generate a labeled image of connected components.
Connect1 code produces two ouput BufferedImage files:
The first image uses component numbers from 1 .. nobjs. The second uses a colormap to produce a displayable image.
However, there are only six entries in the colormap and 14 objects, so the colors repeat.
To obtain the component numbers you must mask off the first 8-bits, using a statement like
v = value[i] & 0xFFFFFF;
Write code to use the first image, process the unique components and calculate the area and centroid of each object. Then label and count the different coins and determine the total monetary value.
See the example below.
Maintained by John Loomis, last updated 11 April 2018