1mlib_ImageGradient3x3(3MLIBm)ediaLib Library Functionmslib_ImageGradient3x3(3MLIB)
2
3
4

NAME

6       mlib_ImageGradient3x3 - 3x3 gradient filter
7

SYNOPSIS

9       cc [ flag... ] file... -lmlib [ library... ]
10       #include <mlib.h>
11
12       mlib_status mlib_ImageGradient3x3(mlib_image *dst, const mlib_image *src,
13            const mlib_d64 *hmask, const mlib_d64 *vmask, mlib_s32 cmask, mlib_edge edge);
14
15

DESCRIPTION

17       The mlib_ImageGradient3x3() function performs edge detection by comput‐
18       ing the magnitude of the image gradient vector in two orthogonal direc‐
19       tions using 3x3 gradient filtering.
20
21
22       It uses the following equation:
23
24         dst[x][y][i] = ( SH(x,y,i)**2 + SV(x,y,i)**2 )**0.5
25
26
27
28       where  SH()  and  SV()  are the horizontal and vertical gradient images
29       generated from the corresponding channel of the source image by  corre‐
30       lating it with the supplied orthogonal (horizontal and vertical) gradi‐
31       ent masks.
32

PARAMETERS

34       The function takes the following arguments:
35
36       dst      Pointer to destination image.
37
38
39       src      Pointer to source image.
40
41
42       hmask    Pointer to horizontal mask in row-major order.
43
44
45       vmask    Pointer to vertical mask in row-major order.
46
47
48       cmask    Channel mask to indicate the channels to  be  convolved,  each
49                bit  of  which represents a channel in the image. The channels
50                corresponding to 1 bits are those to be processed. For a  sin‐
51                gle channel image, the channel mask is ignored.
52
53
54       edge     Type of edge condition. It can be one of the following:
55
56                  MLIB_EDGE_DST_NO_WRITE
57                  MLIB_EDGE_DS_FILL_ZERO
58                  MLIB_EDGE_DST_COPY_SRC
59                  MLIB_EDGE_SR_EXTEND
60
61
62

RETURN VALUES

64       The  function  returns MLIB_SUCCESS if successful. Otherwise it returns
65       MLIB_FAILURE.
66

ATTRIBUTES

68       See attributes(5) for descriptions of the following attributes:
69
70
71
72
73       ┌─────────────────────────────┬─────────────────────────────┐
74       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
75       ├─────────────────────────────┼─────────────────────────────┤
76       │Interface Stability          │Committed                    │
77       ├─────────────────────────────┼─────────────────────────────┤
78       │MT-Level                     │MT-Safe                      │
79       └─────────────────────────────┴─────────────────────────────┘
80

SEE ALSO

82       mlib_ImageGradient3x3_Fp(3MLIB),          mlib_ImageGradientMxN(3MLIB),
83       mlib_ImageGradientMxN_Fp(3MLIB), attributes(5)
84
85
86
87SunOS 5.11                        2 Mar 2007      mlib_ImageGradient3x3(3MLIB)
Impressum