Performs a low-pass, high-pass, or median filter
Performs a low-pass, high-pass, or median filter on an input image. Low-pass filters and median filters are used most often for noise suppression or smoothing, while high-pass filters are typically used for image enhancement.For subcommands -ILOW, -VLOW, and -HIGH, a valid range for the input data is specified as MINVAL and MAXVAL (inclusive). Input values within this range are valid, and values outside the range are invalid (THRVAL may be used to specify a valid range relative to the pixel data values). The output values are calculated using all input values, valid input values, or invalid input values, depending on the subcommand specified.
Subcommand -DESPIKE uses a low-pass filter and performs a despike algorithm on all the input image pixels; subcommand -LOW applies a low-pass filter to all the input image pixels; subcommand -VLOW applies a low-pass filter to all valid input image pixels; subcommand -ILOW applies a low-pass filter to all nonvalid input image pixels; subcommand -HIGH applies a high-pass filter to all valid input image pixels; subcommand -MED applies a median filter to all input image pixels.
- IN
- Input image. The input data type may be BYTE, INTEGER*2, INTEGER*4, or REAL*4. Window and/or band options may be specified.
- OUT
- Output image. The output image will be the same size and contain the same number of bands as specified in IN. The output data type will be ODTYPE.
- TOLVAL
- Tolerance value. The tolerance used in the check for despiking an image.
- KERNDIM(3,3)
- Kernel dimensions. The number of lines and samples per line in the sampling kernel. The values must be odd numbers between 1 and 501. The smallest kernel allowed is 1 x 3 or 3 x 1.
- ODTYPE(SAME)
- Output data type. The data type of the output image.
= SAME: Same as input = BYTE: BYTE = I*2: INTEGER*2 = I*4: INTEGER*4 = R*4: REAL*4
- IN
- Input image. The input data type may be BYTE, INTEGER*2, INTEGER*4, or REAL*4. Window and/or band options may be specified.
- OUT
- Output image. The output image will be the same size and contain the same number of bands as specified in IN. The output data type will be ODTYPE.
- KERNDIM(3,3)
- Kernel dimensions. The number of lines and samples per line in the sampling kernel. The values must be odd numbers between 1 and 501. The smallest kernel allowed is 1 x 3 or 3 x 1.
- ODTYPE(SAME)
- Output data type. The data type of the output image.
= SAME: Same as input = BYTE: BYTE = I*2: INTEGER*2 = I*4: INTEGER*4 = R*4: REAL*4
- IN
- Input image. The input data type may be BYTE, INTEGER*2, INTEGER*4, or REAL*4. Window and/or band options may be specified.
- OUT
- Output image. The output image will be the same size and contain the same number of bands as specified in IN. The output data type will be ODTYPE.
- MINVAL(0.0)
- Minimum value. The valid data limit for the low end of the input data. Pixels with a value less than MINVAL are invalid.
- MAXVAL(255.0)
- Maximum value. The valid data limit for the high end of the input data. Pixels with a value greater than MAXVAL are invalid.
- THRVAL(--)
- Threshold value. The threshold value which determines how much the value of some given pixel within the kernel can deviate from the value of the pixel to be replaced. If the difference between the value of the pixel to be replaced and the value of some given pixel within the kernel is greater than THRVAL, the given pixel within the kernel is invalid.
- KERNDIM(3,3)
- Kernel dimensions. The number of lines and samples per line in the sampling kernel. The values must be odd numbers between 1 and 501. The smallest kernel allowed is 1 x 3 or 3 x 1.
- ODTYPE(SAME)
- Output data type. The data type of the output image.
= SAME: Same as input = BYTE: BYTE = I*2: INTEGER*2 = I*4: INTEGER*4 = R*4: REAL*4
- SCALFACT(1.0)
- Scale factor. Multiplicative constant applied to the low-pass or high-pass components of the input filter kernel.
- INVALOPT(1)
- Invalid pixel option. The method of assigning a value to the output pixel when the input image pixel is invalid (less than MINVAL or greater than MAXVAL). Options 1 and 2 are set depending on whether the input pixel is less than MINVAL or greater than MAXVAL.
= 1: Set to (MINVAL - 1) or to (MAXVAL + 1). The output pixel is set to (MINVAL - 1) if the input pixel value is less than MINVAL or set to (MAXVAL + 1) if the input pixel is greater than MAXVAL. = 2: Set to 0 or 255. The output pixel is set to 0 if the input pixel value is less than MINVAL or set to 255 if the input pixel is greater than MAXVAL. = 3: Set to input pixel value. The output pixel is set to the value of the input pixel.
- IN
- Input image. The input data type may be BYTE, INTEGER*2, INTEGER*4, or REAL*4. Window and/or band options may be specified.
- OUT
- Output image. The output image will be the same size and contain the same number of bands as specified in IN. The output data type will be ODTYPE.
- MINVAL
- Minimum value. The valid data limit for the low end of the input data. Pixels with a value less than MINVAL are invalid.
- MAXVAL
- Maximum value. The valid data limit for the high end of the input data. Pixels with a value greater than MAXVAL are invalid.
- THRVAL(--)
- Threshold value. The threshold value which determines how much the value of some given pixel within the kernel can deviate from the value of the pixel to be replaced. If the difference between the value of the pixel to be replaced and the value of some given pixel within the kernel is greater than THRVAL, the given pixel within the kernel is invalid.
- KERNDIM(3,3)
- Kernel dimensions. The number of lines and samples per line in the sampling kernel. The values must be odd numbers between 1 and 501. The smallest kernel allowed is 1 x 3 or 3 x 1.
- ODTYPE(SAME)
- Output data type. The data type of the output image.
= SAME: Same as input = BYTE: BYTE = I*2: INTEGER*2 = I*4: INTEGER*4 = R*4: REAL*4
- SCALFACT(1.0)
- Scale factor. Multiplicative constant applied to the low-pass or high-pass components of the input filter kernel.
- IN
- Input image. The input data type may be BYTE or INTEGER*2. Window and/or band options may be specified.
- OUT
- Output image. The output image will be the same size and contain the same number of bands as specified in IN. The output data type will be ODTYPE.
- KERNDIM(3,3)
- Kernel dimensions. The number of lines and samples per line in the sampling kernel. The values must be odd numbers between 1 and 51. The smallest kernel allowed is 1 x 3 or 3 x 1.
- ODTYPE(SAME)
- Output data type. The data type of the output image.
= SAME: Same as input = BYTE: BYTE = I*2: INTEGER*2 = I*4: INTEGER*4 = R*4: REAL*4
- IN
- Input image. The input data type may be BYTE, INTEGER*2, INTEGER*4, or REAL*4 if THRVAL is null. However, only BYTE and INTEGER*2 data are allowed if a non-zero value is entered for THRVAL. Window and/or band options may be specified.
- OUT
- Output image. The output image will be the same size and contain the same number of bands as specified in IN. The output data type will be ODTYPE.
- MINVAL(0.0)
- Minimum value. The valid data limit for the low end of the input data. Pixels with a value less than MINVAL are invalid.
- MAXVAL(255.0)
- Maximum value. The valid data limit for the high end of the input data. Pixels with a value greater than MAXVAL are invalid.
- THRVAL(--)
- Threshold value. The threshold value which determines how much the value of some given pixel within the kernel can deviate from the value of the pixel to be replaced. If the difference between the value of the pixel to be replaced and the value of some given pixel within the kernel is greater than THRVAL, the given pixel within the kernel is invalid.
- THRVAL(--)
- Threshold value. The threshold value which determines how much the value of a pixel within the kernel can deviate from the value of the pixel to be replaced. If the difference between the value of the pixel to be replaced and the value of a pixel within the kernel is greater than THRVAL*STDDEV (standard deviation for present kernel), that pixel is invalid. Values for THRVAL should usually vary between 1 and 3, with 2 being the recommended first attempt. Other values may work better for specific applications.
- KERNDIM(3,3)
- Kernel dimensions. The number of lines and samples per line in the sampling kernel. The values must be odd numbers between 1 and 501. The smallest kernel allowed is 1 x 3 or 3 x 1.
- ODTYPE(SAME)
- Output data type. The data type of the output image.
= SAME: Same as input = BYTE: BYTE = I*2: INTEGER*2 = I*4: INTEGER*4 = R*4: REAL*4
- SCALFACT(1.0)
- Scale factor. Multiplicative constant applied to the low-pass or high-pass components of the input filter kernel.
- ADDBACK(0.0)
- Addback. A constant from 0.0 to 1.0 that specifies what fraction of the center kernel value is to be added back to the filter kernel.
- THRPERC(0)
- Threshold percentage. The minimum percentage of valid data that must be present in the kernel for filtering to occur. If the percentage of valid data in the kernel is less than THRPERC, the output is set to zero. If the percentage of valid data in the kernel is greater than or equal to this value, the high-pass filter is applied to the kernel.
- OFFSET(127.5)
- Offset value. A value added to the high-pass filter value. This is usually used in order to center a histogram of the output image. Generally, OFFSET is defined as (MAXVAL - MINVAL) / 2.
- INVALOPT(1)
- Invalid pixel option. The method of assigning a value to the output pixel when the input image pixel is invalid (less than MINVAL or greater than MAXVAL). Options 1 and 2 are set depending on whether the input pixel is less than MINVAL or greater than MAXVAL.
= 1: Set to (MINVAL - 1) or to (MAXVAL + 1). The output pixel is set to (MINVAL - 1) if the input pixel value is less than MINVAL or set to (MAXVAL + 1) if the input pixel is greater than MAXVAL. = 2: Set to 0 or 255. The output pixel is set to 0 if the input pixel value is less than MINVAL or set to 255 if the input pixel is greater than MAXVAL. = 3: Set to input pixel value. The output pixel is set to the value of the input pixel.
- LOWVAL(--)
- Minimum output value. The minimum pixel value of the output image.
- HIGHVAL(--)
- Maximum output value. The maximum pixel value of the output image.
The output is a REAL*4 image whose pixel values are the mean of all the values in each 13 x 5 input kernel.
The output image is the same data type as the input image. If the input pixel value is valid (between 0 and 255, inclusive), the output pixel value is the mean of the valid values in the 5 x 5 kernel. Otherwise, the output pixel value is set to the input pixel value.
The output is a REAL*4 image whose pixel values are the result of applying a high-pass filter with a 51 x 51 kernel to input image DC.
The output is an INTEGER*2 image whose pixel values are median values of a 7 x 7 kernel passed over each pixel in the input image.
The output image is the same data type as the input image. If the input pixel value is valid, the output pixel value is the mean of the valid values in the 5 x 5 kernel. Otherwise, the output pixel value is set to the input pixel value. Pixel status (valid/invalid) is determined using the values of MINVAL, MAXVAL, and THRVAL. A valid pixel in the kernel is one whose value:
(1) lies somewhere between MINVAL and MAXVAL (inclusive) (2) does not deviate from the input value of the pixel to be replaced by more than THRVAL*STDDEV (inclusive), where STDDEV is the standard deviation for the present kernel.
The boxcar filtered image is created by passing a user-specified window (called a kernel or box) over an input image on a pixel-by-pixel basis. As each input pixel is passed over, the value of the corresponding output pixel is calculated according to the user-specified options and the value of the surrounding valid pixels.The following symbols are used in the filter formulas:
P(i,j) = original value of the input image at line-sample i,j S(i,j) = sum of input pixels in the kernel centered at i,j N(i,j) = number of valid pixels in the window centered at i,j SCALFACT= scale factor ADDBACK = fraction of the center pixel value to be added back OFFSET = value used in order to center the histogram of output image The formulas for each type of filter are as follows: LOW-PASS -------- Low(i,j) = (S(i,j) / N(i,j)) * SCALFACT MEDIAN ------ Median(i,j) = the median pixel value of the current kernel HIGH-PASS --------- High(i,j) = (OFFSET * (1-ADDBACK)) + (P(i,j) * SCALFACT * (1+ADDBACK)) - (S(i,j)/N(i,j) * SCALFACT)
The image data is probably valid and therefore saved. The message that is displayed immediately preceding this message is the specific error that was encountered. Processing continues.
A fatal error was encountered during processing. The output image is not deleted, and processing is terminated. The error message that is displayed immediately preceding this message is the specific error that was encountered.
The specified window to filter within the image is invalid.
The kernel or computed boundary values are out of range. Check the input kernel size.
The data type is invalid.
The amount of maximum RAM is invalid. Check the header file containing the MAXRAM definition.
The output image's data type was to be the same as the input image, but the input images are not of the same data type. The user can either ensure all input images have the same data type or specify ODTYPE, the data type of the output image.
The kernel cannot be smaller than 3 x 1 or 1 x 3.
The specified kernel is larger than the input image.
The range specified with MINVAL and MAXVAL is not valid. MAXVAL must be greater than MINVAL.
The value of THRVAL must be greater than zero.
The boundary dimensions cannot be determined because the input kernel size is invalid.
The specified amount of RAM available is too small to load a full kernel into memory. Reduce the kernel size, or increase the value of MAXRAM and recompile.
Define the window dimensions such that they are of equal size.
The data type of the input images can only be BYTE or INTEGER*2 when using a median filter.
The kernel dimensions specified contain even numbers. Reset the values for KERNDIM with odd numbers.
The specified kernel dimensions exceed the limit for median filters. The maximum kernel size allowed for median filters is 51 by 51.
The data type of the input images can only be BYTE or INTEGER*2 when using a filter with the THRVAL activated (non-NULL value).
An invalid filter type was encountered. Memory may have been corrupted if this error is encountered.
A problem in allocating the dynamic memory required for filtering was encountered.
Example: IMAGE is a four line by four sample image:
A B C D E F G H I J K L M N O P
A 3 x 3 kernel applied to pixel values A, D, M, and P would appear as:
f e f g h g j I J K L k b A B C D c n M N O P o f E F G H g j i j k l k