|[mmdconcrete] [Up] [mmdcornea]||Demonstrations|
The input image is a gray-scale image of two rounded-shaped biscuits. One of them is broken. The purpose is to detect the broken biscuit.
The input image is read.
>>> a = mmreadgray('cookies.tif');
Convert to binary objects by thresholding
>>> b = mmthreshad(a, uint8(100));
The tophat of the binary image by an octagon disk with a radius fits the good biscuit but does not fit in the broken biscuit can detect the broken one.
>>> c = mmopenth(b,mmsedisk(55,'2D','OCTAGON'));
Clean the residues from the octagon disk and the rounded shaped biscuits by eliminating small connected regions
>>> d = mmareaopen(c,400);
Display the detected broken biscuit
|[mmdconcrete] [Up] [mmdcornea]|
|Copyright (c) 2003, Roberto A. Lotufo, UNICAMP-University of Campinas; Rubens C. Machado, CenPRA-Renato Archer Research Center.|