Let the domain of the input image be E = [0, 1, ..., m - 1] x [0, 1, ..., n - 1]. Let vs and hs be two positive integer values representing, respectively, the vertical and horizontal scale factors. Let the domain of the output image be vhE = [0, 2, ..., vs(m - 1)] x [0, 2, ..., hs(n - 1)]. Let vo and ho be two non negative integer values less or equal than, respectively, vs and hs. vo and ho represent, respectively, the vertical and horizontal offsets. Let a be the (conditionally) structuring function from E to P(vhE) (the subsets of vhE) given by a(y) = (A + (y + (vo, ho))) n vhE (y member of E) where n means "intersection" and where A is a subset of the 3 x 3 square centered at the origim, called structuring element. The expansion of the input image Y is the dilation of Y by a, that is: expand of Y = U{a(y): y member Y}.
If A is the 2 x 2 square then the dilation expands the input image in the usual manner, that is by duplicating each original pixel four times (twice in both directions). If A is the 3 x 3 square then the expansion of an 8-connected subset appears without ambiguity on the screen as a connected subset (in the sense of the usual Euclidean topology). In this later case, we say that the expansion preserve the connectivity 8.
The input and output images must be of the same data type, and have the same number of data bands. The output image column size is vs times the input image column size and the output image row size is hs times the input image row size.
vdilexpan -i ball.xv -str b.str -vs 2 -hs 2 -voff 0 -hoff 0 -o outimage.xv
will do the expansion (dilation) of the input image "ball.xv" by the structuring element "b.str" and the resulting image will be "outimage.xv". The vertical scale factor is 2, the horizontal scale factor is 2, the vertical offset is 0 and the horizontal offset is 0.
vdilexpan -i ball.xv -vs 2 -hs 2 -voff 0 -hoff 0 -o outimage.xv
will do the expansion (dilation) of the input image "ball.xv" by the structuring element reduced to the singleton containing the origin and the resulting image will be "outimage.xv". The vertical scale factor is 2, the horizontal scale factor is 2, the vertical offset is 0 and the horizontal offset is 0. This option can be used to realize an expansion without internal dilation. In this case a dilation (by a structuring element greater than the 3 x 3 square) or anything else (a median filter) can be used after the expansion.
For more details on Digital Topology see: G. Banon and J. Barrera, "Bases da Morfologia Matematica para Analise de Imagens binarias", IX Escola de Computacao, Recife, 1994.
related routines are: veroexpan, vdilshrin, veroshrin