Transform - Tiles: Filter

The Filter template appears in the template list when a raster tile field, of type Tile, has been picked in the Transform pane.  The template provides numerous operators to compute image characteristics using matrix filters.

 

Filter

Provides numerous operators to compute image characteristics using matrix filters and to save to the specified Result destination, using the data type required and providing options for each operation. The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array. The Shape parameter allows choosing a matrix filter shape that is a circle, cross, diamond, or square (the default.

 

Available operations include:

 

  • average - Interpolate pixel values based on radius, averaging pixel values over the given shape array of pixels.  Similar to median but using the average of values and not the median as median does.  As a matrix filter, average is identical to blur, but using a fixed Center value of 1.  average is provided for convenience, since not all uses may realize that blur using a Center value of 1 is just averaging.
  • blur - Identical to average, but allows specifying the Center value instead of using a fixed Center value of 1.  The Center value is the weight to give the center pixel: a weight of 1 means not to emphasize it.  A weight of 5 means to give the center pixel's value five times the value in averaging compared to other pixels in the array.  
  • blur direction - Same as blur but emphasizing the direction specified by the given Angle, specified in choice of Unit (Arc Minute, Arc Second, Degree, or Radian).
  • blur gaussian - Similar to blur, but  averaging pixel values over a circular radius  with a convolution function computed using a Gaussian function.   Radius has a greater visual effect than Center.  blur gaussian computes on a corrected circular radius while blur computes on a square, cross or uncorrected circular matrix.  
  • count - Reports the total number of non-NULL pixels within the given filter shape of given radius.  
  • diversity - Reports the total number of different pixel values within the given filter shape of given radius.  
  • diversity index - Reports the diversity index of pixel values within the given filter shape of given radius.  A diversity index provides a measure of diversity, computed as 1 - sum(individualcount^2) / (totalcount^2), 0 means that all values are equal.  
  • edges - Find edges (transitions between pixel values) in any direction.  Begin by setting Radius and Center to 1.  Take the source pixel values, emphasize edges (increasing pixel values) by examining pixel values over a square array of pixels and save to the specified Result destination.
  • edges direction - Same as edges but looking for pixel changes along a direction specified by the given Angle, specified in choice of Unit (Arc Minute, Arc Second, Degree, or Radian).
  • major - Reports the most frequently occurring pixel value within the given filter shape of given radius.  
  • maximum - Reports the maximum pixel value within the given filter shape of given radius.  
  • median - Similar to blur but using the median of values and not the average as blur does.  
  • minimum - Reports the minimum pixel value within the given filter shape of given radius.  
  • sharpen -  Enhance contrast and edge detection by comparing pixel values within the given filter shape of given radius.  
  • std deviation - Calculates the standard deviation using pixel values with non-zero weights within the given filter shape of given radius.
  • std deviation pop - Calculates the square root of the population variance using pixel values with non-zero weights within the given filter shape of given radius.
  • sum - Calculates the sum of pixel values within the given filter shape of given radius.  
  • variance - Calculates the sample variance using pixel values with non-zero weights within the given filter shape of given radius.
  • variance pop - Calculates the population variance using pixel values with non-zero weights within the given filter shape of given radius.

 

Note:  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Launch the template by choosing a Tile field and then double-clicking the Filter template.  When the template launches we can specify options.

 

 

Filter : average

Identical to the blur operation, but uses a fixed Center value of 1.  Provided for convenience, since beginners and those who do not use the system every day might not realize that Blur using a Center value of 1 is just averaging.  The operation works on the single channel chosen in the Channel parameter.

 

Similar to median but using the average of values and not the median as median does.  Take the source field, interpolate pixel values based on radius, averaging pixel values over a square array of pixels,  and place the result in the Result destination.  

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

 

With the focus on the ginevra grayscale image, in the Transform pane we choose the Tile field and then the Filter template.

 

 

In the Filter template, we choose channel 0 for the Channel and average as the Filter.

 

Clicking into the Shape parameter allows us to choose the shape of the filter as a circle, cross, triangle, or square, the default.

Square Shape

 

We enter 10 as the Radius.   Caution: a Radius of 10 is OK for small images like those used in graphics arts, but unreasonably large for aerial photos and other geographic images.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

For the Result destination, we choose New Field and then enter Tile filtered as the name of the new tile field to add to the table.  For the new image name we enter ginevra filtered.   We could use whatever names we want for the names of the new tile and image, but it is wise to use names that remind us of what they are supposed to be.

 

Press Transform.  

 

A new image called ginevra filtered appears in the Project pane.   We drag and drop the new ginevra filtered image into the ginevra grayscale window as a layer.

 

Comparing the original image to the result:

 

 

Compared to the starting image, the result of average using a Radius of 10 shows a characteristic blurriness.

Cross Shape

We re-run the transform operation using the cross option for filter Shape.

 

 

For the Result destination we choose the new Tile filtered tile field we created when trying the square shape.   Press Transform.

 

Comparing the original image to the result:

 

 

The ginevra filtered image automatically shows whatever is in the Tile filtered tile field, so it automatically shows the results of using a cross shaped filter.  The blur seems not to affect horizontal and vertical lines as much as the square shaped filter.

Diamond Shape

We re-run the transform operation using the diamond option for filter Shape.

 

 

For the Result destination we choose the same Tile filtered tile field as before.   Press Transform.

 

Comparing the original image to the result:

 

 

Using a diamond shape for the filter produces results that seem to be a blend of the cross and circle shapes.

Circle Shape

We re-run the transform operation using the circle option for filter Shape.

 

 

For the Result destination we choose the same Tile filtered tile field as before.   Press Transform.

 

Comparing the original image to the result:

 

 

Using a circle shape for the filter tends to reproduce the bokeh effect, when objects are seen out-of-focus.

 

Filter : blur

Identical to the average operation, but allows specifying the Center value instead of using a fixed Center value of 1.

 

Similar to median but using the average of values and not the median as median does.  Take the source field, interpolate pixel values based on radius, averaging pixel values over a square array of pixels, and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Center value is the weight to give the center pixel: a weight of 1 means not to emphasize it.  A weight of 5 means to give the center pixel's value five times the value in averaging compared to other pixels in the array.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array. The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

 

With the focus on the ginevra grayscale image, in the Transform pane we choose the Tile field and then the Filter template.

 

 

In the Filter template, we choose channel 0 for the Channel and blur as the Filter.

 

Clicking into the Shape parameter allows us to choose the shape of the filter as a circle, cross, triangle, or square, the default.

Square Shape

 

We enter 10 as the Radius and 3 as the Center.   Caution: a Radius of 10 is OK for small images like those used in graphics arts, but unreasonably large for aerial photos and other geographic images.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

For the Result destination, we choose New Field and then enter Tile filtered as the name of the new tile field to add to the table.  For the new image name we enter ginevra filtered.   We could use whatever names we want for the names of the new tile and image, but it is wise to use names that remind us of what they are supposed to be.

 

Press Transform.  

 

A new image called ginevra filtered appears in the Project pane.   We drag and drop the new ginevra filtered image into the ginevra grayscale window as a layer.

 

Comparing the original image to the result:

 

Cross Shape

We re-run the transform operation using the cross option for filter Shape.

 

 

For the Result destination we choose the new Tile filtered tile field we created when trying the square shape.   Press Transform.

 

Comparing the original image to the result:

 

 

The blur seems not to affect horizontal and vertical lines as much as the square shaped filter.   Because the center pixel in the filter array is more weighted, the result may preserver more detail.   At the cost of introducing some blurriness, the cross shape filter is often used to remove artifacts from image processing.  

 

For speed and simplicity, some image processing algorithms in various different graphics editors or image processing systems will often make two passes through an image, one pass considering pixels in each row, looking at neighbors to the left and right, and then a second pass considering pixels above and below in a column.  

 

Using a cross shape filter, Blur averages against only pixels in the matrix above and below in the same column or to the left and right in the same row, ignoring diagonal pixel values.  The filter therefore tends to average out artifacts that appear in the same column or the same row as a pixel.  Using a cross shape filter with Median has a similar function.

Diamond Shape

We re-run the transform operation using the diamond option for filter Shape.

 

 

For the Result destination we choose the same Tile filtered tile field as before.   Press Transform.

 

Comparing the original image to the result:

 

 

Using a diamond shape for the filter produces results that seem to be a blend of the cross and circle shapes.

Circle Shape

We re-run the transform operation using the circle option for filter Shape.

 

 

For the Result destination we choose the same Tile filtered tile field as before.   Press Transform.

 

Comparing the original image to the result:

 

 

Using a circle shape for the filter tends to reproduce the bokeh effect, when objects are seen out-of-focus.

 

Filter : blur direction

Similar to blur, but emphasizing the direction specified by the given Angle.  Take the source field, interpolate pixel values based on radius, averaging pixel values over a square array of pixels emphasizing the direction specified by the given Angle in the specified Unit of angular measure, and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

The Center value is the weight to give the center pixel: a weight of 1 means not to emphasize it.  A weight of 5 means to give the center pixel's value five times the value in averaging compared to other pixels in the array.

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

We will use an example image that shows the footprints of buildings.

 

 

With the focus on the buildings grayscale image, in the Transform pane we choose the Tile field and then the Filter template.

 

 

In the Filter template, we choose channel 0 for the Channel and blur direction as the Filter.

 

We enter 5 as the Radius and 1 as the Center.   Caution: a Radius of 10 is OK for small images like those used in graphics arts, but unreasonably large for aerial photos and other geographic images.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

We enter 15.5 for the Angle, choosing Degree as the Unit.  

 

For the Result destination, we choose New Field and then enter Tile filtered as the name of the new tile field to add to the table.  For the new image name we enter buildings filtered.   We could use whatever names we want for the names of the new tile and image, but it is wise to use names that remind us of what they are supposed to be.

 

Press Transform.  

 

A new image called buildings filtered appears in the Project pane.   We drag and drop the new buildings filtered image into the buildings grayscale window as a layer.

 

Comparing the original image to the result:

 

 

The result blurs the image more in the direction of the specified Angle.

 

Filter : blur gaussian

Similar to blur, but using a convolution function using a Gaussian function.   Take the source field, interpolate pixel values based on radius and center, averaging pixel values over a circular radius with a convolution function computed using a Gaussian function, and place the result in the Result destination. The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array. 

 

The Center value is the weight to give the center pixel: a weight of 1 means not to emphasize it.  A weight of 5 means to give the center pixel's value five times the value in averaging compared to other pixels in the array.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Radius has a greater visual effect than Center. The blur gaussian operation corrects for circular radius while blur computes blur on a square, cross, diamond, or uncorrected circular matrix.  

 

 

With the focus on the ginevra grayscale image, in the Transform pane we choose the Tile field and then the Filter template.

 

 

In the Filter template, we choose channel 0 for the Channel and blur gaussian as the Filter.

 

We enter 10 as the Radius and 3 as the Center.   Caution: a Radius of 10 is OK for small images like those used in graphics arts, but unreasonably large for aerial photos and other geographic images.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

For the Result destination, we choose New Field and then enter Tile filtered as the name of the new tile field to add to the table.  For the new image name we enter ginevra filtered.   We could use whatever names we want for the names of the new tile and image, but it is wise to use names that remind us of what they are supposed to be.

 

Press Transform.  

 

A new image called ginevra filtered appears in the Project pane.   We drag and drop the new ginevra filtered image into the ginevra grayscale window as a layer.

 

Comparing the original image to the result:

 

 

A familiar effect in Photoshop editing, blur gaussian is also useful to reduce details in raster data such as terrain elevation data sets.   For example, a highly detailed, military-grade, terrain elevation data set might be reduced in resolution using blur gaussian to enable release as a declassified data set for civilian use.

 

 

With the focus on the Elevation Raster image, in the Transform pane we choose the Tile field and then the Filter template.

 

 

In the Filter template, we choose channel 0 for the Channel and blur gaussian as the Filter.

 

We enter 10 as the Radius and 1 as the Center.    For the Result destination, we choose New Field and then enter Tile filtered as the name of the new tile field to add to the table.  For the new image name we enter Elevation filtered.   

 

Press Transform.  

 

A new image called Elevation filtered appears in the Project pane.   We drag and drop the new Elevation filtered image into the Elevation Raster window as a layer.

 

Comparing the original image to the result:

 

 

 

Compared to the original, the result shows a blurred effect that hides details, like downsampling the image to lower resolution.

Comparing blur to blur gaussian

blur is the classic box blur, using a square shape filter, as implemented in many image editing programs, plus the added ability to weight the central pixel.  When used with a circle shape filter, blur more closely approximates the bokeh effect of lense blur in out-of-focus regions of photographic images, where some parts of the image are in-focus while others are out-of-focus.   A blur example using a circle shape filter is on the left below.  

 

 

blur gaussian, on the right above, combines a Gaussian function (often thought of as a bell curve) with pixel values to compute weighted pixel averaging.  blur gaussian tends to better preserve boundaries and edges and operates as a low-pass filter as well.  Applying a slight blur gaussian to an image before downsizing it will often produce a better appearance for the reduced-size image by eliminating Moire effects and other high-frequency feature artifacts.

 

Filter : count

Take the source field, and using the specified Radius and filter Shape, compute the total number of non-NULL pixels within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Filter : diversity

Take the source field, and using the specified Radius and filter Shape, compute the total number of different values found in pixels within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Filter : diversity index

Take the source field, and using the specified Radius and filter Shape, compute the diversity index of values found in pixels within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

A diversity index provides a measure of diversity, computed as 1 - sum(individualcount^2) / (totalcount^2).  A diversity index of 0 means that all values are equal.   

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Filter : edges

Find edges (transitions between pixel values) in any direction.  Take the source field, interpolate pixel values based on radius, find edges by examining pixel values over a square array of pixels, and then emphasize edges  (increasing pixel values) and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

The Center value is the weight to give the center pixel: a weight of 1 means not to emphasize it.  A weight of 5 means to give the center pixel's value five times the value in averaging compared to other pixels in the array.  The edges operation often works better using a Center of 1.

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

We will use an example image that shows the footprints of buildings.

 

 

With the focus on the buildings grayscale image, in the Transform pane we choose the Tile field and then the Filter template.

 

 

In the Filter template, we choose channel 0 for the Channel and edges as the Filter.

 

We enter 1 as the Radius and 1 as the Center.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

For the Result destination, we choose New Field and then enter Tile filtered as the name of the new tile field to add to the table.  For the new image name we enter buildings filtered.   We could use whatever names we want for the names of the new tile and image, but it is wise to use names that remind us of what they are supposed to be.

 

Press Transform.  

 

A new image called buildings filtered appears in the Project pane.   We drag and drop the new buildings filtered image into the buildings grayscale window as a layer.

 

Comparing the original image to the result:

 

 

A Radius of 2 pulls out relatively crisp edges.

 

Filter : edges direction

Find edges (transitions between pixel values) in the direction of the given Angle, specified in choice of Unit (Arc Minute, Arc Second, Degree, or Radian) of angular measure.  Take the source field, interpolate pixel values based on radius, find edges by examining pixel values over a square array of pixels, and then emphasize edges  (increasing pixel values) and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

The Center value is the weight to give the center pixel: a weight of 1 means not to emphasize it.  A weight of 5 means to give the center pixel's value five times the value in averaging compared to other pixels in the array.  The edges operation often works better using a Center of 1.

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

We will use an example image that shows the footprints of buildings.

 

 

With the focus on the buildings grayscale image, in the Transform pane we choose the Tile field and then the Filter template.

 

 

In the Filter template, we choose channel 0 for the Channel and edges direction as the Filter.

 

We enter 1 as the Radius and 1 as the Center.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

We enter 15.5 for the Angle, choosing Degree as the Unit.  

 

For the Result destination, we choose New Field and then enter Tile filtered as the name of the new tile field to add to the table.  For the new image name we enter buildings filtered.   We could use whatever names we want for the names of the new tile and image, but it is wise to use names that remind us of what they are supposed to be.

 

Press Transform.  

 

A new image called buildings filtered appears in the Project pane.   We drag and drop the new buildings filtered image into the buildings grayscale window as a layer.

 

Comparing the original image to the result:

 

 

The edges direction operation emphasizes edges where changes are found between pixel values when traversing the data in an approximately 15.5 degree angle.  The edges direction operation detects changes in the direction of travel, so the edges which appear are at 90 degrees to the direction of travel.  In this case, the direction of travel is 15.5 degrees, so edges appear on boundaries oriented at approximate 105.5 degrees.

 

Filter : major

Take the source field, and using the specified Radius and filter Shape, compute the most frequently occurring pixel value found within the given filter shape and place the result in the Result destination.  If all values are different, use the lowest value.   The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Filter : maximum

Take the source field, and using the specified Radius and filter Shape, compute the maximum pixel value found within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Filter : median

Similar to blur but using the median of values and not the average as blur does.  Take the source field, interpolate pixel values based on radius, computing the median of pixel values over a square array of pixels,  and place the result in the Result destination.  

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

 

With the focus on the ginevra grayscale image, in the Transform pane we choose the Tile field and then the Filter template.

 

 

In the Filter template, we choose channel 0 for the Channel and median as the Filter.

 

Clicking into the Shape parameter allows us to choose the shape of the filter as a circle, cross, triangle, or square, the default.

Square Shape

 

We enter 10 as the Radius.   Caution: a Radius of 10 is OK for small images like those used in graphics arts, but unreasonably large for aerial photos and other geographic images.  GPU parallelism switches to CPU parallelism at a Radius of 9 or greater, so it makes sense to use a Radius of 8 or less with bigger images.

 

For the Result destination, we choose New Field and then enter Tile filtered as the name of the new tile field to add to the table.  For the new image name we enter ginevra filtered.   We could use whatever names we want for the names of the new tile and image, but it is wise to use names that remind us of what they are supposed to be.

 

Press Transform.  

 

A new image called ginevra filtered appears in the Project pane.   We drag and drop the new ginevra filtered image into the ginevra grayscale window as a layer.

 

Comparing the original image to the result:

 

Cross Shape

We re-run the transform operation using the cross option for filter Shape.

 

 

For the Result destination we choose the new Tile filtered tile field we created when trying the square shape.   Press Transform.

 

Comparing the original image to the result:

 

 

At the cost of introducing some blurriness, using a cross shape filter with median is often used to remove artifacts from image processing similar to how a cross shape filter is used with blur.

Diamond Shape

We re-run the transform operation using the diamond option for filter Shape.

 

 

For the Result destination we choose the same Tile filtered tile field as before.   Press Transform.

 

Comparing the original image to the result:

 

 

Using a diamond shape for the filter produces results that seem to be a blend of the cross and circle shapes.

Circle Shape

We re-run the transform operation using the circle option for filter Shape.

 

 

For the Result destination we choose the same Tile filtered tile field as before.   Press Transform.

 

Comparing the original image to the result:

 

 

Using a circle shape for the filter tends to reproduce the bokeh effect when objects are seen out-of-focus, but with more simplified regions than with a circle shape filter in blur.

 

Median with smaller radius is often used to eliminate noise pixels in an image.

 

 

The image at left has some noise pixels, white and black pixels and thin lines scattered about.   The image at right shows the result of median using a Radius of 2 and the square shape filter.  

 

 

The image above shows use of median with a Radius of 2 and the cross shape filter.   Detail is slightly sharper, but a few of the noise artifacts have not been completely eliminated.

 

Filter : minimum

Take the source field, and using the specified Radius and filter Shape, compute the minimum pixel value found within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Filter : sharpen

Take the source field, enhance contrast and edge detection by comparing pixel values within a square array of pixels, and place the result in the Result destination.  

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.  

 

The Center value is the weight to give the center pixel: a weight of 1 means not to emphasize it.  A weight of 5 means to give the center pixel's value five times the value in averaging compared to other pixels in the array.

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

We will use a single-channel, grayscale image of St Peters square in Rome:

 

 

With the focus on the St Peters grayscale image, in the Transform pane we choose the Tile field and then the Filter template.

 

 

Preview: Apply Sharpen to Tile using a Radius of 1 and a Center of 1.

 

In the Filter template, we choose channel 0 for the Channel and sharpen as the Filter.

 

We enter 1 as the Radius.

 

For the Result destination, we choose New Field and then enter Tile filtered as the name of the new tile field to add to the table.  For the new image name we enter St Peters filtered.   We could use whatever names we want for the names of the new tile and image, but it is wise to use names that remind us of what they are supposed to be.

 

Press Transform.  

 

A new image called St Peters filtered appears in the Project pane.   We drag and drop the new St Peters filtered image into the St Peters grayscale window as a layer.

 

Comparing the original image to the result:

 

 

We apply the same operation, using a Radius of 1 and a Center value of 2 to terrain elevation data:

 

 

 

With terrain elevation data, sharpen may appear to add detail but it does not.  It simply emphasizes contrasts between pixels that are already in the data.  

 

Filter : std deviation

Take the source field, and using the specified Radius and filter Shape, compute the standard deviation using pixel values with non-zero weights within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Filter : std deviation pop

Take the source field, and using the specified Radius and filter Shape, compute the square root of the population variance using pixel values with non-zero weights within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

Filter : sum

Take the source field, and using the specified Radius and filter Shape, compute the sum of pixel values within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

Filter : variance

Take the source field, and using the specified Radius and filter Shape, compute the sample variance using pixel values with non-zero weights within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Filter : variance pop

Take the source field, and using the specified Radius and filter Shape, compute the population  variance using pixel values with non-zero weights within the given filter shape and place the result in the Result destination.  The operation works on the single channel chosen in the Channel parameter.

 

The Radius value sets the number of pixels from the center pixel to the edge of the matrix used to compute the filter:  A Radius of 1 results in a 3x3 pixel array.   The Shape parameter allows choosing a matrix filter shape that is a circle, a cross, a diamond, or a square.  

 

GPU parallelism switches to CPU parallelism at a Radius of 9 or greater.

 

Notes

Sample image - Many illustrations for transforms for raster images use an Elevation Raster sample image, a version of the formatted example of importing an SDTS format DEM from the Example: Import DDF SDTS DEM Raster File  topic.   The example project may be downloaded from the Downloads page on the Manifold web site.

 

Tech Tip:  Manifold runs CPU parallel and also GPU parallel, as discussed in the GPGPU topic.   Having a GPU can make a huge difference in speed for many transforms that work with raster images, for example, when computing Curvature or Slope or Aspect using a radius of 3 or more.  Manifold running without a GPU installed will automatically use CPU parallelism instead for spectacular parallel speed, but with a GPU installed Manifold can often run dramatically faster.    Installing at least one, inexpensive NVIDIA GPU card in our systems allows such operations to run with astonishing speed, at times reducing computations from minutes to seconds or from hours to seconds.  A wide range of GPU cards costing from under $100 to around $250 will make a spectacular difference.

 

Why a GPU parallelism limit to radius of 8 or less? - Transforms using a Radius parameter to set the size of the filter matrix applied typically are limited to a radius of 8 or less for GPGPU parallelism, switching to CPU parallelism at a radius of 9 or greater.   That limitation allows more flexible use of a greater range of GPU cards.  Some cards, perhaps older cards or lower cost cards, may have limited memory or earlier generation GPU chips, but they nonetheless can provide very many cores for GPGPU parallel computation.  Manifold makes it possible to use such cards effectively for GPGPU parallelism.   

 

A radius of 8 implies a 17x17, 289-cell matrix, an absurdly huge and almost always an excessively large choice for matrix size.  A radius of 9 or above may indicate a conceptual error or workflow error.   At the same time, use of a radius of 9 or above requires so much GPU-accessible memory that such tasks fit into fewer and fewer cards, even if performance-reducing methods are adopted.   Given a choice between assuring a wide range of GPU cards will always work well, or restricting GPU choice to allow practices that are probably wrong in any event, Manifold chooses to support a wider range of GPU cards, placing the current switch to CPU parallelism at a radius of 9.  That may change as CUDA editions evolve.

 

Everything Math - For a handy reference to anything in mathematics, see the Wolfram MathWorld site.   Thank you, Wolfram!

 

See Also

Transform Pane

 

Transform Reference

 

Transform - Tiles

 

How Matrix Filters Work

 

Example: Import DDF SDTS DEM Raster File

 

SQL Example: Process Images with 3x3 Filters -  Shows a step-by-step example of developing an SQL query that takes a query written by the Edit Query button and then modifies that query into a general purpose query that can apply any 3x3 filter.   This makes it easy to use matrix filters we find on the web for custom image processing.   We extend the query by using parameters and adding a function, and then show how it can be adapted to use a 5x5 filter.

 

SQL Example: Process Images using Dual 3x3 Filters  - A continuation of the above topic, extending the example query to utilize two filters for processing, as commonly done with Sobel and Prewitt two filter processing.

 

SQL Example: Process RGB Images using Matrix Filters - A continuation of the above two topics, extending the example query to process three channel, RGB images.