IPCREATE_FILTER Function (PV-WAVE Extreme Advantage)
Creates a spatial filter object, given a kernel and other appropriate fields.
Usage
result = IPCREATE_FILTER(kernel [, scale_factor])
Input Parameters
kernel—A 2D array containing the filter kernel.
scale_factor—(optional) Scalar float containing scaling factor of the filter.
Returned Value
result—An associative array containing a spatial filter object. (See the
Returned Value description for the
IPREAD_FILTER Function (PV-WAVE Extreme Advantage) for information about the spatial filter object.)
Keywords
None.
Discussion
The IPCREATE_FILTER function takes an input array and puts it into the spatial filter object format. Spatial filter objects are used with the IPCONVOL and IPCORRELATE functions, in addition to the IPREAD_FILTER and IPWRITE_FILTER functions.
Example
; Create a 3-by-3 low pass filter.
kernel = BYTARR(3,3)
kernel(*) = 1B
; Use scaling factor to normalize kernel during convolution.
scale_factor = FLOAT(TOTAL(kernel))
; Create a filter object.
filter = IPCREATE_FILTER(kernel, scale_factor)
; Save the filter to a file.
status = IPWRITE_FILTER(filter, 'my_lpf.ker')
See Also