How ENVI Quick filters and Morphology filters differ
ENVI's "quick" filters that are applied from an image Display menu (
Enhance ->Filter ->Sharpen/Smooth/Median) produce different results than the High Pass/Low Pass and Median filters available from the
Filter ->Convolutions and Morphology menu on the main ENVI menu. This Help Article describes why you get different results using the two methods of applying filters.
The "quick" Sharpen filter (available from an image Display menu
Enhance -> Filter ->Sharpen[n] ) is a 3x3 high pass filter with the value of "[n]" in the center. For example, the "Sharpen [10]" will use the following kernel:
kernel =
[[-1,-1,-1, $
-1,10,-1, $
-1,-1,-1]]
The difference between the "quick" sharpen filter and the filters from the main ENVI Filter menu is that the ENVI routine
CONV_DOIT calls
CONVOL() with a scale factor for the "quick" filter:
result = CONVOL(data, kernel, total(kernel), /edge)
The High Pass filter available through the main ENVI menu via
Filter ->Convolutions and Morphology, uses
CONV_DOIT but doesn't use a scale factor. Instead, it will scale the kernel based on the
add_back value. While
add_back is similar to scaling, it isn't exactly the same thing.
The scale factor is used for the "quick" filter to keep the data range of the result within the input data range of the raw data. The stretch applied to the result in the display is still based on the raw data and not the resulting sharpened data. In the
Convolutions and Morphology filters, there is no need to constrain the data with a scale factor because the output data type can easily be expanded (from byte to integer) to encompass the full range of the applied filter.
For the
High Pass filter, it might be useful to apply the scale factor from the "quick" filter into our kernel for the "regular" filter:
kernel = kernel / total(kernel)
which gives a new kernel of:
kernel =
[[-.5, -.5, -.5, $
-.5, 5, -.5, $
-.5, -.5, -.5]]
This produces *nearly* the same result as the "quick" filter except that if the input data to the "quick" filter is byte, different roundoffs will occur and some data will get clipped at zero.
The differences between the Smooth and Median "quick" filters (available from the Display Enhance menu) and their Low Pass and Median filter counterparts (available from the main ENVI Filter menu) are not as pronounced as those between the Sharpen/High Pass filters. This is because the output data range of these filters will not deviate as much from the input data range. The Low Pass and Median filters in ENVI use the IDL routines
SMOOTH(n) and
MEDIAN(n) (where the "[n]" referes to the kernel size) and will produce nearly identical results as the "quick" Smooth and Median filters.
Review on 12/31/2013 MM