libvips/man/im_compass.3
2007-08-31 13:01:42 +00:00

107 lines
3.2 KiB
Groff

.TH IM_COMPASS 3 "2 May 1991"
.SH NAME
im_compass, im_rank_image, im_maxvalue, im_lindetect, im_gradient \- extract features from an image with
a rotating input mask
.SH SYNOPSIS
#include <vips/vips.h>
int im_rank_image(in, out, n, index)
.br
IMAGE **in;
.br
IMAGE *out;
.br
int n;
.br
int index;
int im_maxvalue(in, out, n)
.br
IMAGE **in;
.br
IMAGE *out;
.br
int n;
int im_compass(in, out, mask)
.br
IMAGE *in, *out;
.br
INTMASK *mask;
int im_lindetect(in, out, mask)
.br
IMAGE *in, *out;
.br
INTMASK *mask;
int im_gradient(in, out, mask)
.br
IMAGE *in, *out;
.br
INTMASK *mask;
.SH DESCRIPTION
.B im_rank_image()
sorts the input images pixel-wise, then outputs an image in which each pixel
is selected from the sorted list by the
.B index
parameter. For example, if
.B index
is zero, then each output pixel will be the minimum of all the corresponding
input pixels.
It works for any uncoded, non-complex
image type. All input images must match in size, format, and number of bands.
These functions convolve the image pointed by the image descriptor in with the
mask pointed by mask and put the result in the image pointed by out.
The mask structure INTMASK is returned by the function im_read_imask(3), for
integer mask only. Input should be unsigned char; processing is carried out
using look-up tables. The output is integer. coefficients. The size of the
output image and the number of channels are the same as the corresponding of
the input.
If the sizes of the mask are xm and ym and the sizes of the image are xs and ys,
then there is a black border at the output image as follows:
The top ym/2 lines black, bottom ys-ym/2-ym lines black; each of the remaining
lines has the initial xm/2 pels blank, and the final
xs-xm/2-xm pels black (division over 2 is integer division).
The output at each point is divided by scale and then the offset is added.
Both offset and scale are held in mask.
.B im_maxvalue()
is a convenience function: it is simply:
im_rank_image( in, out, n, n - 1 )
.B im_compass()
convolves each point of the input byte image pointed by in with 8 masks.
The first mask is the entered mask and the seven remaining masks are produced
by successive rotations of the entered mask by 45 degrees. The maximum output
of all masks at each point is written to the output integer IMAGE descriptor.
The function expects as input a square mask of odd size.
.B im_lindetect()
convolves each point of the input byte image pointed by in with 4 masks.
The first mask is the entered mask and the three remaining masks are produced
by successive rotations of the entered mask by 45 degrees. The maximum output
of all masks at each point is written to the output integer IMAGE descriptor.
The function expects as input a square mask of odd size.
.B im_gradient()
convolves each point of the input byte image pointed by in with 2 masks;
the entered mask and with a 90 degrees rotation of the
entered mask. If g1, g2 are the result of each convolution then for each point
abs(g1) + abs(g2) is written to the output integer IMAGE descriptor.
The function expects as input a square mask of any size.
.SH RETURN VALUE
All functions returns 0 on success and -1 on error.
.SH SEE\ ALSO
im_readmask(3), im_conv(3).
.SH COPYRIGHT
.br
N. Dessipris
.SH AUTHOR
N. Dessipris \- 02/05/1991