Image Processing Reference
Mick and SB realized after some struggle that a standard thresholding approach with
a fixed threshold value would not suffice. Primarily because the system should run
for a long period of time where the lighting in the basement changed significantly
due to the many windows and Fred's unwillingness to cover these windows. After
reading about thresholding in the topic they looked at each other.
“It seems we need automated thresholding, right?” asked Mick.
“Agreed, but which one of the two methods mentioned, the global or the local?”
After a short break SB continued, “well, we known that the lighting on the table
can differ from position to position, which suggests applying the local threshold-
ing method. But we also know that the overall lightning in the room may change,
which suggests using automatic thresholding.” They played around with the two
methods and finally arrived at the conclusion that they needed both. First they used
the subtracting approach from the local method to remove the effect of the uneven
illumination within the image and then they applied the global method to the result-
ing image. It worked very robustly independent on how the lightning changed, but
was not perfect. Some small holes appeared inside the coins due to strong refections
of the light from the metal surfaces. They applied a morphologic closing operation
to remove these holes. The different steps Mick and SB went through can be seen in
Fig. 13.6 .
13.5 Representation and Classification
With good binarized images, SB and Mick now turned to the problem of defining
features that would allow for a classification of the different types of coins. First,
of course, they had to locate the different BLOBs in the image. For this purpose
they reused their BLOB extracting algorithm from their previous system. Next they
removed all small BLOBs, like those in the corners of Fig. 13.6 (f), by introducing a
minimum threshold value on the BLOB size.
“Mick?” SB called, “have you noticed that the coins sometimes touch each and
hence two BLOBs are merged into one?”
“Yes. We need to calculate the circularity and ignore all BLOBs with a circularity
far from one. Could you look into that?” SB agreed and found the equation for
circularity (Eq. 7.5). It contained both the area and perimeter. SB didn't know how to
calculate those features for a BLOB with holes inside and therefore first performed
a closing with a big kernel to remove the hole. That did the trick. Armed with the
circularity he could easily detect merged BLOBs and ignore them based on their
circularity values. He proudly showed the result to Mick who liked his solution.
Mick had in the meanwhile been investigating which features that could separate
the different types of coins. He knew that different lighting situations and different
placements of a coin would result in slightly different feature values. So in order
to understand the effect of these factors he placed ten different coins of each type
different places in the scene (under different lighting conditions) and measured their
feature values, see Fig. 13.7 .