'\" te .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved .TH mlib_ImageGradient3x3 3MLIB "2 Mar 2007" "SunOS 5.11" "mediaLib Library Functions" .SH NAME mlib_ImageGradient3x3 \- 3x3 gradient filter .SH SYNOPSIS .LP .nf cc [ \fIflag\fR... ] \fIfile\fR... \fB-lmlib\fR [ \fIlibrary\fR... ] #include \fBmlib_status\fR \fBmlib_ImageGradient3x3\fR(\fBmlib_image *\fR\fIdst\fR, \fBconst mlib_image *\fR\fIsrc\fR, \fBconst mlib_d64 *\fR\fIhmask\fR, \fBconst mlib_d64 *\fR\fIvmask\fR, \fBmlib_s32\fR \fIcmask\fR, \fBmlib_edge\fR \fIedge\fR); .fi .SH DESCRIPTION .sp .LP The \fBmlib_ImageGradient3x3()\fR function performs edge detection by computing the magnitude of the image gradient vector in two orthogonal directions using 3x3 gradient filtering. .sp .LP It uses the following equation: .sp .in +2 .nf dst[x][y][i] = ( SH(x,y,i)**2 + SV(x,y,i)**2 )**0.5 .fi .in -2 .sp .LP where \fBSH()\fR and \fBSV()\fR are the horizontal and vertical gradient images generated from the corresponding channel of the source image by correlating it with the supplied orthogonal (horizontal and vertical) gradient masks. .SH PARAMETERS .sp .LP The function takes the following arguments: .sp .ne 2 .mk .na \fB\fIdst\fR\fR .ad .RS 9n .rt Pointer to destination image. .RE .sp .ne 2 .mk .na \fB\fIsrc\fR\fR .ad .RS 9n .rt Pointer to source image. .RE .sp .ne 2 .mk .na \fB\fIhmask\fR\fR .ad .RS 9n .rt Pointer to horizontal mask in row-major order. .RE .sp .ne 2 .mk .na \fB\fIvmask\fR\fR .ad .RS 9n .rt Pointer to vertical mask in row-major order. .RE .sp .ne 2 .mk .na \fB\fIcmask\fR\fR .ad .RS 9n .rt Channel mask to indicate the channels to be convolved, each bit of which represents a channel in the image. The channels corresponding to 1 bits are those to be processed. For a single channel image, the channel mask is ignored. .RE .sp .ne 2 .mk .na \fB\fIedge\fR\fR .ad .RS 9n .rt Type of edge condition. It can be one of the following: .sp .in +2 .nf MLIB_EDGE_DST_NO_WRITE MLIB_EDGE_DS_FILL_ZERO MLIB_EDGE_DST_COPY_SRC MLIB_EDGE_SR_EXTEND .fi .in -2 .RE .SH RETURN VALUES .sp .LP The function returns \fBMLIB_SUCCESS\fR if successful. Otherwise it returns \fBMLIB_FAILURE\fR. .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ MT-LevelMT-Safe .TE .SH SEE ALSO .sp .LP \fBmlib_ImageGradient3x3_Fp\fR(3MLIB), \fBmlib_ImageGradientMxN\fR(3MLIB), \fBmlib_ImageGradientMxN_Fp\fR(3MLIB), \fBattributes\fR(5)