|[mmdbrain] [Up] [mmdcells]||Demonstrations|
This procedure detects the keys in a gray-scale image of a calculator. The approach used is watershed Beucher's paradigm. The internal markers are the numbers on the keys and the external markers are obtained by the skiz of the keys background.
The gray-scale image of the calculator is read.
a = mmreadgray('keyb.tif');
The image edges are enhanced by the gradient operator.
b = mmgradm(a, mmsebox);
The opening top-hat procedure enhances the small objects relatively to its background. In the calculator image, the digits are enhanced.
c = mmopenth(a,mmsebox(5));
The threshold operator is used to separated the enhanced objects. This procedure is quite robust, since the background was reduced to very low levels with the opening top-hat.
d = mmthreshad(c, uint8(150));
In order to have just one object (i.e., connected component) inside each key, a dilation is applied.
e = mmdil(d, mmsebox(3));
The outside markers are built by taking the watershed (skiz) of the complement of internal markers image.
f = mmwatershed(mmneg(e));
The markers used are the union of the internal and external markers detected. They are displayed as overlay on the gradient image.
g = mmunion(e,f);
The calculator keys are extracted by applying the watershed operator on the gradient image, constrained by the markers detected.
h = mmcwatershed(b,g,mmsebox);
Superposition of the detected contours on the input image.
|[mmdbrain] [Up] [mmdcells]|
|Copyright (c) 1998-2008 by SDC Information Systems|