convolve

[ XITE Reference Manual | XITE home ]

Contents


Name

convolve - perform an n x m convolution

Syntax

 convolve [<option>...] <inimage> <inimage> <outimage>
 or:
 convolve [<option>...] <inimage> <outimage>
           <xsize> <ysize> <v1> .. <vn>
  or:
 convolve [<option>...] -conv <asciifile>
           <inimage> <outimage>

Description

convolve performs a convolution between a convolution kernel and one or more bands. The result is written to outimage.

In the first case above, the first band of the first inimage argument is considered the convolution kernel. All the bands of the second inimage argument will be processed.

In the second case above, the convolution kernel is specified as a list of integers (and xsize and ysize specify the size of the kernel).

In the third case above, the convolution kernel is specified by the name of a file containing ascii values.

Options

-conv filename
Take convolution kernel from Ascii file given by filename.

-scale scale
Scale convolution result. Default (with no -scale option or with scale equal to 0.0): Autoscaling.
 pixel = (conv. result) * scale

-offset offset
Offset (scaled) convolution result.
 pixel = (conv. result) * scale + offset

-title title
Use title as title for the output image.

-byte
Force the output image pixeltype to become unsigned byte. Default: Same pixeltype as input band.

-word
Force the output image pixeltype to become signed short. Default: Same pixeltype as input band.

-verbose
With this standard XITE option, a message is written if the convolution sum is less than 0 or greater than 255. If autoscaling is performed, the scale and offset factors are displayed.

File format

See ascii2biff(1)

Restrictions

Works on unsigned byte and signed short images. If the convolution kernel is read from a BIFF image file, it must be of type signed short. Unsigned short images will be treated as if they were signed short.

See also

ascii2biff(1), convolve(3), conv3x3(1), laplace(1), gradient(1), sobel(1), prewitt(1), roberts(1)

Example

 convolve mona.img m.img -scale 0.5 3 3 1 1 1 1 1 1 1 1 1

Author

Otto Milvang

Revised

Svein Bøe

Id

$Id: convolve.c,v 1.33 1997/01/09 17:16:41 svein Exp $