convolve2

From DavinciWiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
{{DavinciWiki_Function|
 
{{DavinciWiki_Function|
Computes a sliding window kernel convolution.(AKA kernel filter, smooth)
+
Computes a sliding window kernel convolution.(AKA kernel filter, smooth).  Same as thm.convolve()
 
|
 
|
 
Arguments: A numeric array, a kernel (filtering array) and an ignore value
 
Arguments: A numeric array, a kernel (filtering array) and an ignore value
Line 6: Line 6:
 
Return Value: An array the size of the input object.
 
Return Value: An array the size of the input object.
 
|
 
|
[[Syntax]]: thm.convolve(object = VAL, kernel = VAL [, normalize = 1] [, ignore = VAL] [, kernreduce = 1])
+
[[Syntax]]: convolve2(object = VAL, kernel = VAL [, normalize = 1] [, ignore = VAL] [, kernreduce = 1])
 
   
 
   
 
'object' - Any numeric array of up to 3 dimensions
 
'object' - Any numeric array of up to 3 dimensions
Line 20: Line 20:
 
For each pixel in object, the weighted sum of the neighboring pixels is computed, with the weights being specified by the kernel.
 
For each pixel in object, the weighted sum of the neighboring pixels is computed, with the weights being specified by the kernel.
 
   
 
   
thm.convolve() will NOT fill in ignore values in the smoothed array with interpolated points. Instead it will fill null pixels in with the ignore value.
+
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.
 
|
 
|
 
  dv> b
 
  dv> b
Line 53: Line 53:
 
  1.00000
 
  1.00000
 
   
 
   
  dv> thmconvolve = thm.convolve(b,kern)
+
  dv> thmconvolve = convolve(b,kern)
 
  1x272x1 array of float, bsq format [1,088 bytes]
 
  1x272x1 array of float, bsq format [1,088 bytes]
 
   
 
   
  dv> kernreduce = thm.convolve(b,kern,kernreduce=1)
+
  dv> kernreduce = convolve(b,kern,kernreduce=1)
 
  1x272x1 array of float, bsq format [1,088 bytes]
 
  1x272x1 array of float, bsq format [1,088 bytes]
 
|
 
|

Revision as of 23:56, 9 January 2008



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