Image Action Set

Create a Patch and Mutate Using the augmentImages Action

This example is not available for the CAS programming language.

Create a Patch and Mutate Using the augmentImages Action

This example is not available for the Lua programming language.

Create a Patch and Mutate Using the augmentImages 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 augmentImages action to create a patch from specified parameters (x = 0, y = 0, width = 250, and height = 250) and resize it to 100 times 100. Then, it mutates the resized patch similar to the Example 21.4.

s.image.augmentImages(
    casout={'name':'imgsOut'},
    croplist=[
        {
            'x':0,
            'y':0,
            'width':250,
            'height':250,
            'stepsize':250,
            'outputwidth':100,
            'outputheight':100,
            'mutations':{
                'verticalflip':True,
                'sharpen':True,
                'colorjittering':True,
                'rotateright':{
                    'type':'BASIC',
                    'angle':True
                },
                'invertpixels':True,
                'lighten':{
                    'type':'BASIC',
                    'gamma':True
                },
                'pyramidup':True,
                'pyramiddown':True,
                'rotateleft':{
                    'type':'BASIC',
                    'angle':True
                },
                'colorshifting':True,
                'horizontalflip':True,
                'darken':{
                    'type':'BASIC',
                    'gamma':True
                }
            }
        }
    ],
    table={'name':'imgs'}
)
Create a Patch and Mutate Using the augmentImages Action

This example is not available for the R programming language.

Last updated: September 15, 2022