Image Action Set

Simple Flattening

This example is not available for the CAS programming language.

Simple Flattening

This example is not available for the Lua programming language.

Simple Flattening

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 flattenImages action to convert a CAS image format to a one-column-per-pixel format. It also resizes the input images to 2 times 2 before flattening. Table 2 shows the results.

s.image.flattenImages(
    casout={'name':'flattenedImagesTable'},
    table={'name':'imagesTable'},
    w = 2,
    h = 2
)

Table 2: Simply Flattened Images

_path_ c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12
user/sas1.jpg 255 169 115 255 180 132 152 126 107 32 43 36
user/sas2.jpg 55 99 76 47 74 60 15 58 84 93 163 163
user/sas3.jpg 208 190 167 251 234 192 69 164 144 70 185 154
user/sas4.jpg 172 181 181 3 33 20 64 149 135 70 150 137


Simple Flattening

This example is not available for the R programming language.

Last updated: November 04, 2020