User Tools

Site Tools


samples:samples:pixelfilters

Table of Contents

PixelFilters sample

Documentation | Samples | PixelFilters

Summary

NEW! How to perform filter operation.

Description

This sample illustrates use of:

Name Description
TGIS_PixelFilterMaskTypePredefined mask filters.
TGIS_PixelFilterStructuringElementTypePredefined structuring element types.
TGIS_PixelFilterThresholdThreshold filter for pixel layers - if the pixel value is smaller than the threshold then it is set to the smallest value in the layer, otherwise to the largest.
TGIS_PixelFilterNoiseSaltPepperSalt-And-Pepper noise filter for pixel layers.
TGIS_PixelFilterNoiseGaussianGaussian noise filter for pixel layers.
TGIS_PixelFilterConvolutionApplies mask filters to pixel layers by convolution.
TGIS_PixelFilterSobelMagnitudeSobel magnitude filter for pixel layers - performs edge detection, the pixel value is proportional to the value difference at the edge.
TGIS_PixelFilterRangeRange filter for pixel layers - transforms the pixel value to the difference between the maximum and the minimum value in the block.
TGIS_PixelFilterMidpointMidpoint filter for pixel layers - transforms the pixel value to the average between the maximum and the minimum value in the block.
TGIS_PixelFilterMinimumMinimum filter for pixel layers - transforms the pixel value to the smallest value in the block.
TGIS_PixelFilterMaximumMaximum filter for pixel layers - transforms the pixel value to the greatest value in the block.
TGIS_PixelFilterArithmeticMeanArithmetic mean filter for pixel layers - transforms the pixel value to the arithmetic mean of the values within the block.
TGIS_PixelFilterAlphaTrimmedMeanAlpha-trimmed mean filter for pixel layers - transforms the pixel value to the alpha-trimmed mean of the values within the block.
TGIS_PixelFilterContraHarmonicMeanContra-harmonic mean filter for pixel layers - transforms the pixel value to the contra-harmonic mean of the values within the block.
TGIS_PixelFilterGeometricMeanGeometric mean filter for pixel layers - transforms the pixel value to the geometric mean of the values within the block.
TGIS_PixelFilterHarmonicMeanHarmonic mean filter for pixel layers - transforms the pixel value to the harmonic mean of the values within the block.
TGIS_PixelFilterWeightedMeanWeighted mean filter for pixel layers - transforms the pixel value to the weighted mean of the values within the block.
TGIS_PixelFilterYpMeanYp mean filter for pixel layers - transforms the pixel value to the Yp mean of the values within the block.
TGIS_PixelFilterMajorityMajority filter for pixel layers - transforms the pixel value to the most frequent value in the block (if exists).
TGIS_PixelFilterMinorityMinority filter for pixel layers- transforms the pixel value to the least frequent value in the block (if exists).
TGIS_PixelFilterMedianMedian filter for pixel layers - transforms the pixel value to the median of the values within the block.
TGIS_PixelFilterWeightedMedianWeighted median filter for pixel layers - transforms the pixel value to the weighted median of the values within the block.
TGIS_PixelFilterSumSum filter for pixel layers - transforms the pixel value to the sum of the values within the block.
TGIS_PixelFilterStandardDeviationStandard deviation filter for pixel layers - transforms the pixel value to the standard deviation of the values within the block.
TGIS_PixelFilterUniqueCountUnique value count filter for pixel layers - transforms the pixel value to the number of unique values within the block.
TGIS_PixelFilterErosionErosion filter for pixel layers - transforms the pixel value to the smallest difference of the value in the block and the mask value.
TGIS_PixelFilterDilationDilation filter for pixel layers - transforms the pixel value to the greatest sum of the value in the block and the mask value.
TGIS_PixelFilterOpeningOpening filter for pixel layers - two-stage filter, applies erosion followed by dilation.
TGIS_PixelFilterClosingClosing filter for pixel layers - two-stage filter, applies dilation followed by erosion.
TGIS_PixelFilterTopHatTop-hat filter for pixel layers - three-stage filter, computes the difference of the original image with its opening (erosion followed by dilation).
TGIS_PixelFilterBottomHatBottom-hat filter for pixel layers - three-stage filter, computes the difference of the closing (dilation followed by erosion) of the image with the original image.
TGIS_PixelFilterBlockStats.BlockSizeSize of the moving block (number of columns/rows); default is 3 (for a 3×3 block).
TGIS_PixelFilterAbstract.SourceLayerSource layer, pixel (image or grid).
TGIS_PixelFilterAbstract.DestinationLayerDestination layer, pixel (image or grid); if nil then the source layer will be altered.
TGIS_PixelFilterAbstract.BandDefines the band to be processed; if set to zero then all bands will be processed; default is 1.
TGIS_PixelFilterAbstract.ColorSpaceDefines the color space in which the image will be processed; default is HSL.
TGIS_PixelFilterAbstract.BusyEvent
TGIS_PixelFilterAbstract.ExecuteApplies the filter on the source layer.

Code

This sample is available on following platforms (click to see source code):

2020/05/26 09:38

Page Tools