Prism

The Prism module splits color image frames into separate channel streams, combines single-channel streams back into one color frame, or converts color frames to grayscale.

Usage

Prism has three operating modes:

Split

Accepts one incoming frame stream and produces one single-channel output stream for each enabled color channel.

This is useful if you want to process red, green, blue or alpha data independently. Enabled channels can be selected in the module settings. By default, Red, Green and Blue are enabled, while Alpha is disabled.

Combine

Accepts one input stream per enabled channel and merges them into a single output frame stream.

All input streams should be synchronized and have the same image size. The output frame is emitted once data from every enabled and connected channel has been received. If no alpha channel is enabled and connected, the generated frame will contain only red, green and blue data.

Grayscale

Accepts one color frame stream and converts it to a single-channel grayscale stream.

If the input is already single-channel, it is forwarded unchanged. BGR and BGRA input frames are converted using OpenCV’s grayscale conversion.

Ports

The available ports depend on the selected mode and active channels.

Split Mode

NameDirectionData TypeDescription
🠺Frames InInFrameMulti-channel input frames
Red🠺OutFrameSingle-channel red plane output
Green🠺OutFrameSingle-channel green plane output
Blue🠺OutFrameSingle-channel blue plane output
Alpha🠺OutFrameSingle-channel alpha plane output, if enabled

Combine Mode

NameDirectionData TypeDescription
🠺RedInFrameSingle-channel red input, if enabled
🠺GreenInFrameSingle-channel green input, if enabled
🠺BlueInFrameSingle-channel blue input, if enabled
🠺AlphaInFrameSingle-channel alpha input, if enabled
Combined🠺OutFrameMerged color output frame

Grayscale Mode

NameDirectionData TypeDescription
🠺FramesInFrameColor or grayscale input frames
Grayscale🠺OutFrameSingle-channel grayscale output

Stream Metadata

Prism forwards basic frame-stream metadata to its outputs.

For input streams of type Frame, the following metadata is handled explicitly:

KeyTypeRequired?Description
framerateDoubleRecommendedFrame rate in frames per second.
size2DSizeYesFrame dimensions in pixels.

In Split and Grayscale mode, output metadata is copied from the single input stream.

In Combine mode, the Combined output stream takes its framerate and size metadata from the first connected input channel.