Image Action Set
Converting Color Spaces Using the processImages Action
This example is not available for the CAS programming language.
Converting Color Spaces Using the processImages Action
This example is not available for the Lua programming language.
Converting Color Spaces 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 CONVERT_COLOR function in the processImages action to convert default color space (BGR) of all images in the imgs input table to HSV color space and writes the resulting images 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':'CONVERT_COLOR',
'type':'BGR2HSV'
}}
],
table={'name':'imgs'}
)
Figure 43 shows the original image, and Figure 44 shows the processed image.
Figure 43: Original Image

Figure 44: Processed Image

Converting Color Spaces Using the processImages Action
This example is not available for the R programming language.