|[mmdrobotop] [Up] [mmdsoil]||Demonstrations|
The input image is a gray-scale image of a ruler, that has a number touching a tick mark. This number and mark are detected based on morphological and connected filtering.
The gray-scale image of the ruler is read.
a = mmreadgray('mm3.tif');
The close top-hat operator followed by a thresholding is applied.
b = mmthreshad( mmcloseth(a,mmsebox(5)),40);
Warning: converting image from scalar to uint8
The vertical lines longer than 50 pixels are detected.
c = mmopen(b,mmseline(50,90));
It closes ruler tick marks gaps.
It detects all objects connected to the ruler tick markers.
e = mminfrec(d,b);
It detects all objects vertically connected to the ruler tick mark. Note that the 3x1 rectangle is used as structuring element in the vertical reconstruction.
f = mminfrec(d,b,mmseline(3,90));
The residues obtained from the previous image.
g = mmsubm(e,f);
It uses an opening by an elementary cross structuring element to eliminate the artifacts.
h = mmopen(g);
It detects the objects connected to ruler tick marks. A reconstruction from the ruler marks detected is applied.
i = mminfrec(h, b);
Overlay the detected defect over the original image
|[mmdrobotop] [Up] [mmdsoil]|
|Copyright (c) 1998-2008 by SDC Information Systems|