1IM_DILATE(3)               Library Functions Manual               IM_DILATE(3)
2
3
4

NAME

6       im_dilate,  im_dilate_raw, im_erode, im_erode_raw - perform morphologi‐
7       cal operations on a white object against a black background
8

SYNOPSIS

10       #include <vips/vips.h>
11
12       int im_dilate(in, out, m)
13       IMAGE *in, *out;
14       INTMASK *m;
15
16       int im_erode(in, out, m)
17       IMAGE *in, *out;
18       INTMASK *m;
19
20       int im_dilate_raw(in, out, m)
21       IMAGE *in, *out;
22       INTMASK *m;
23
24       int im_erode_raw(in, out, m)
25       IMAGE *in, *out;
26       INTMASK *m;
27
28

DESCRIPTION

30       The above functions are applications of morphological operations on one
31       channel  binary images ie. images with pixels that are either 0 (black)
32       or 255 (white).  All functions assume that input images  contain  white
33       objects against a black background.
34
35       Mask  coefficients can be either 0 (for object) or 255 (for background)
36       or 128 (for do not care).
37
38       The mask should have odd length sides and the origin of the mask is  at
39       location (m->xsize/2,m->ysize/2) integer division.  All algorithms have
40       been based on the book "Fundamentals of Digital Image Processing" by A.
41       Jain,  pp 384-388, Prentice-Hall, 1989.  Essentially, im_dilate(3) sets
42       pixels in the output  if  *any*  part  of  the  mask  matches,  whereas
43       im_erode(3) sets pixels only if *all* of the mask matches.
44
45       im_dilate(3)  dilates  the  image  pointed by in, according to the mask
46       pointed by m and writes the result in the location pointed by the IMAGE
47       descriptor  out. The output image is the same size as the input, with a
48       black border in the manner of im_conv(3).
49
50       im_dilate_raw(3) works as im_dilate(3), but does not add a  black  bor‐
51       der.
52
53       im_erode(3)  erodes  the  image  pointed  by  in, according to the mask
54       pointed by m and writes the result in the location pointed by the IMAGE
55       descriptor out. Again, the output image is forced to have the same size
56       as the input.
57
58       im_erode_raw(3) works as im_erode(3), but does not add a black border.
59
60       See the boolean operations im_and(3), im_or(3) and im_eor(3)  for  ana‐
61       logues of the usual set difference and set union operations.
62
63

RETURN VALUE

65       All functions returns 0 on success and -1 on error.
66

SEE ALSO

68       im_read_imask(3), im_conv(3), im_and(3), im_rotate_imask(3).
69
71       1991-1995, Birkbeck College and the National Gallery
72
73
74
75                                  14 May 1991                     IM_DILATE(3)
Impressum