1mlib_ImageGradientMxN(3MLIBm)ediaLib Library Functionmslib_ImageGradientMxN(3MLIB)
2
3
4

NAME

6       mlib_ImageGradientMxN - MxN gradient filter
7

SYNOPSIS

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

DESCRIPTION

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

PARAMETERS

35       The function takes the following arguments:
36
37       dst      Pointer to destination image.
38
39
40       src      Pointer to source image.
41
42
43       hmask    Pointer to horizontal mask in row-major order.
44
45
46       vmask    Pointer to vertical mask in row-major order.
47
48
49       m        Width of the convolution kernel. m > 1.
50
51
52       n        Height of the convolution kernel. n > 1.
53
54
55       dm       X coordinate of the key element in the convolution kernel. 0 ≤
56                dm < m.
57
58
59       dn       Y coordinate of the key element in the convolution kernel. 0 ≤
60                dn < n.
61
62
63       cmask    Channel mask to indicate the channels to  be  convolved,  each
64                bit  of  which represents a channel in the image. The channels
65                corresponding to 1 bits are those to be processed. For a  sin‐
66                gle channel image, the channel mask is ignored.
67
68
69       edge     Type of edge condition. It can be one of the following:
70
71                  MLIB_EDGE_DST_NO_WRITE
72                  MLIB_EDGE_DS_FILL_ZERO
73                  MLIB_EDGE_DST_COPY_SRC
74                  MLIB_EDGE_SR_EXTEND
75
76
77

RETURN VALUES

79       The  function  returns MLIB_SUCCESS if successful. Otherwise it returns
80       MLIB_FAILURE.
81

ATTRIBUTES

83       See attributes(5) for descriptions of the following attributes:
84
85
86
87
88       ┌─────────────────────────────┬─────────────────────────────┐
89       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
90       ├─────────────────────────────┼─────────────────────────────┤
91       │Interface Stability          │Committed                    │
92       ├─────────────────────────────┼─────────────────────────────┤
93       │MT-Level                     │MT-Safe                      │
94       └─────────────────────────────┴─────────────────────────────┘
95

SEE ALSO

97       mlib_ImageGradientMxN_Fp(3MLIB),          mlib_ImageGradient3x3(3MLIB),
98       mlib_ImageGradient3x3_Fp(3MLIB), attributes(5)
99
100
101
102SunOS 5.11                        2 Mar 2007      mlib_ImageGradientMxN(3MLIB)
Impressum