1. A machine implementable method for detecting shapes in a first image represented by a matrix of digital data signals including the following steps: (a) storing the first image matrix; (b) computing the complement of the first image matrix and storing the complement image matrix; (c) creating a first structuring element representative of the shape to be recognized, the first structuring element being represented by a matrix of digital data signals slightly larger in dimension than the shape; (d) creating a second structuring element equal to the window complement of the first structuring element; (e) electronically eroding the first image matrix with the first structuring element to form a first transformation matrix; (f) storing the first transformation matrix; (g) electronically eroding the complement image matrix with the second structuring element to form a second transformation matrix; (h) storing the second transformation matrix; and (i) combining the corresponding points of the first and second transformation matrices to form a result matrix wherein each non-zero point represents the location of the desired shape in the first image.