Image Action Set

Creating a Custom Filter and Applying It Using the processImages Action

This example is not available for the CAS programming language.

Creating a Custom Filter and Applying It Using the processImages Action

This example is not available for the Lua programming language.

Creating a Custom Filter and Applying It Using the processImages Action

This section contains Python code. For more information about coding in Python, see Getting Started with SAS Viya for Python and SAS Viya: System Programming Guide.

The following Python code uses the CUSTOM_FILTER function in the processImages action to create a custom filter and apply it to all images in the imgs input table. The resulting images are then written into the imgsOut output table. This code assumes that the imgs table is loaded in advance.

s.image.processImages(
    casout={'name':'imgsOut'},
    imagefunctions=[
        {'options':{
            'functiontype':'CUSTOM_FILTER',
            'kernelwidth':2,
            'kernelheight':3,
            'kernelvalues':['1.0','1.0','-2.0','-2.0','1.0','1.0']
        }}
    ],
    table={'name':'imgs'}
)

Figure 51 shows the original image, and Figure 52 shows the resulting image after convolving the following kernel with the original image:

Figure 51: Original Image

Original Image


Figure 52: Processed Image

Processed Image


Creating a Custom Filter and Applying It Using the processImages Action

This example is not available for the R programming language.

Last updated: November 04, 2020