convolve2

From DavinciWiki
(Redirected from thm.convolve)
Jump to: navigation, search


64-bit SafeYes

Description

Computes a sliding window kernel convolution.(AKA kernel filter, smooth). Same as thm.convolve

Arguments and Return Values

Arguments: A numeric array, a kernel (filtering array) and an ignore value

Return Value: An array the size of the input object.

Usage

Syntax: convolve2(object = VAL, kernel = VAL [, normalize = 1] [, ignore = VAL] [, kernreduce = 1])

'object' - Any numeric array of up to 3 dimensions

'kernel' - A numeric array used to convolve the data. Boxcar filters simply take the average of all pixels within a certain 'radius'. Sawtooth and gaussian filters are used to favor pixels near to the pixel being convolved.

'normalize' - Whether to normalize the output to the weight of the kernel. Default is yes (1).

'ignore' - The value of pixels not filled with valid data. Default is 0.

'kernreduce' - thm.convolve() provides the user the option to reduce the size of the kernel as the convolve operation approaches an edge. This allows the convolution to not be weighted toward the values on the interior of the array. This is primarily useful in arrays where values roll-off or ramp-up near an edge.

For each pixel in object, the weighted sum of the neighboring pixels is computed, with the weights being specified by the kernel.

convolve2() will NOT fill in ignore values in the smoothed array with interpolated points. Instead it will fill null pixels in with the ignore value.

Examples

dv> b
1x272x1 array of double, bsq format [2,176 bytes]

dv> kern = clone(1.0,1,25,1)
1x25x1 array of float, bsq format [100 bytes]
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000
1.00000

dv> thmconvolve = convolve(b,kern)
1x272x1 array of float, bsq format [1,088 bytes]

dv> kernreduce = convolve(b,kern,kernreduce=1)
1x272x1 array of float, bsq format [1,088 bytes]

Images

convolve.png thmconvolve.png kernreduce.png

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 07-06-2009

Personal tools