Problem Note 67713: Encoded single-channel images might be improperly decoded in the Calculate window by the ImageProcessing algorithm
In SAS® Event Stream Processing, when you pass encoded single-channel images to a Calculate window using the ImageProcessing algorithm, the algorithm might incorrectly decode the images as RGB images.
There is no obvious visual symptom for this issue because each single-channel image is turned into a three-channel image that is visually identical. However, if you inspect the output image, you can see that the image contains three channels (RGB). The correct number of channels should be one, which corresponds to 8-bit single-channel/gray-scale images and matches the number of channels in the input image. Furthermore, the image-processing function might take additional time to execute since the function must process three channels instead of one.
A fix for this issue is planned for a future release of SAS Event Stream Processing.
Post-Fix Issues
If you expect a Calculate window that uses the ImageProcessing algorithm to always produce RGB output images even when the input stream contains single-channel images, then this fix might break your image-processing pipeline. A break can occur because output images now contain the same number of channels as their corresponding input images, whereas they previously always contained three channels. If any subsequent code tries to access the second or third channel of an output image that was created from a single-channel input image, an error can occur because those channels no longer exist.
To work around the problem (assuming all images in the input stream are single-channel), convert your images from single-channel to RGB images by appending a new Calculate window that uses the VideoEncoding algorithm to your image-processing pipeline. In the new Calculate window, specify inputFormat="gray", outputColorFormat="rgb" and either leave the width and height parameters unset or set both to 0. Then, continue using the three-channel output images from this new window throughout your image-processing pipeline.
Here is an example schema for a Calculate window that uses the VideoEncoding algorithm to convert encoded gray-scale images to RGB images:
<window-calculate algorithm="VideoEncoding" name="w_calculate">
<schema copy-keys="false">
<fields>
<field key="true" name="id" type="int64" />
<field key="false" name="encodedImageIn" type="blob" />
<field key="false" name="imageOut" type="blob" />
</fields>
</schema>
<parameters>
<properties>
<property name="inputFormat">gray</property>
<property name="outputColorFormat">rgb</property>
<property name="outputFormat">wide</property>
</properties>
</parameters>
<input-map>
<properties>
<property name="videoBuffer">encodedImageIn</property>
</properties>
</input-map>
<output-map>
<properties>
<property name="imageOut">imageOut</property>
</properties>
</output-map>
</window-calculate>
Operating System and Release Information
| SAS System | SAS Event Stream Processing Engine | Microsoft® Windows® for x64 | 6.2 | 2020.1.5 | | |
| Linux for x64 | 6.2 | 2020.1.5 | | |
| SAS System | SAS Event Stream Processing for Edge Computing | Linux for AArch64 | 6.2 | 2020.1.5 | Viya | Viya |
| Linux for x64 | 6.2 | 2020.1.5 | Viya | Viya |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Problem Note |
| Priority: | medium |
| Date Modified: | 2021-04-05 14:30:55 |
| Date Created: | 2021-04-02 15:28:07 |