MMACH (lmmach) functions


LIBRARY ROUTINE

lvdilexpan - Expansion as a conditionally translation invariant dilation.

LIBRARY CALL

int
lvdilexpan(xvimage *img1, mat_str *b_mat, xvimage *img2, int v_scale, int h_scale, int v_offset, int h_offset , int str_flag, int mflg, unsigned long border, xvimage *img3)
/*    v_scale, vertical scale factor */
/*    h_scale, horizontal scale factor */
/*    v_offset, vertical offset */
/*    h_offset; horizontal offset */

INPUT

none

OUTPUT

none

RETURN VALUE

TRUE (1) on success, FALSE (0) on failure

DESCRIPTION

vdilexpan expand an input image in both directions.

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.

img1 and b_mat are, respectively, the input image and the structuring element, and str_flag should be set to 1 if the structuring element is to be used; img2 is the gating image, and mflg should be set to 1 if the gating image is to be used; v_scale, h_scale, v_offset, h_offset are, respectively, the vertical scale factor, the horizontal scale factor, the vertical offset and the horizontal offset; img3 is the output image.

The optional input mask image is used to gate the operation.

A non-zero mask pixel enables the output pixel to contain the expansion. A zero mask pixel just transfers the value of the corresponding pixel in the first input image to the output pixel.

The input, output and mask 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.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

lvdilexpan can be defined for all data types supported by Khoros, but at the moment it has been implemented just for unsigned char types. The structuring elements are subsets of the 3 x 3 square centered at the origim.

MODIFICATION

none

FILES

$MMACH/objects/library/lmmach/src/lvdilexpan.c

SEE ALSO

lmmach(3)

COPYRIGHT

Copyright (C) 1993-1997 Junior Barrera, Roberto Lotufo. All rights reserved.