Color Space
This function block converts an image from one color space to another. It is useful for preparing images for analysis, visualization, or further processing by other blocks.
π₯ Inputs
Image Any This socket accepts the input image to be converted. It can handle color or grayscale images from cameras or image files.
π€ Outputs
Image Any This socket provides the converted image in the selected color space.
πΉοΈ Controls
Conversion Type A dropdown where you choose the desired color conversion. Common choices include conversions to/from:
BGR and RGB
BGR and RGBA / BGRA
BGR and GRAY
BGR and HSV
BGR and Lab Choose the conversion that matches the expected format of downstream blocks or visualization tools.
π¨ Features
Fast color space conversions for real-time workflows.
Supports common conversions used by analysis and detection blocks (grayscale, HSV, RGB, RGBA, Lab, etc.).
Keeps image size unchanged β only channel interpretation and channel count may change.
π Usage Instructions
Provide an image to the
Image Anyinput (for example fromCamera USB,Load Image, orStream Reader).Select the desired option in
Conversion Type.Use the converted image from the output socket for downstream blocks (for example visualization or detectors).
π Evaluation
When executed, this block reads the input image, applies the chosen color conversion, and outputs the converted image immediately for the next steps in your workflow.
π‘ Tips and Tricks
If you need a single channel (intensity) image for detectors, choose
BGR2GRAYand then feed the result toEdge Filter,Sobel Filter,Image Threshold, orFind Contour.For color-based masking, convert to
BGR2HSVfirst and then useHSV FilterorRGB Maskfor more robust separation.When preparing images for model-based blocks (for example
Object Detection (D-FINE)orMask Detection), ensure the channel order matches the model expectation (useBGR2RGBif the model expects RGB).Use
Split Imageafter conversion to access individual channels, or useMerge Channelsto combine edited channels back into a single image.If images are too large for some AI blocks, use
Image Resizerbefore or after conversion to balance speed and quality.For noisy inputs, run
BlurorDenoisingbefore converting to improve downstream results.
(hint: useful companion blocks β Show Image, Image Resizer, Blur, Denoising, HSV Filter, Image Threshold, Split Image, Merge Channels, Find Contour, Object Detection (D-FINE))
π οΈ Troubleshooting
Color looks incorrect after conversion
Check whether the downstream block expects RGB or BGR ordering. Try switching between
BGR2RGBandBGR2GRAY/other options as needed.
Unexpected number of channels (e.g., 3 vs 4)
Convert to or from an RGBA/BGRA option if transparency is required, or use
Merge Channels/Split Imageto manage channels explicitly.
Downstream detectors failing after conversion
Ensure the converted image format (grayscale vs color, channel order) matches the requirements of the detector. Adjust conversion and optionally add
Image ResizerorNormalize Imageto match expected input sizes and ranges.
Last updated