HSV Filter
This block lets you isolate colors in an image by adjusting Hue, Saturation and Value ranges. Use it to create color masks, extract colored regions, or combine foreground and background for visualization.
π₯ Inputs
This block has the following input socket:
Image AnyInput socket that accepts the image to be processed.
π€ Outputs
This block provides these output sockets:
Result ImageFiltered image showing only the pixels within selected HSV ranges (foreground).HSV ImageThe converted HSV representation of the input image.Masked ImageA single-channel binary/grayscale mask showing which pixels passed the HSV test.Added ImageForeground blended with the background for easier visualization.Background ImageThe background portion (grayscale) where masked pixels are removed.
πΉοΈ Controls
Hue (Min-Max)Slider pair to set the hue lower and upper bounds.Saturation (Min-Max)Slider pair to set the saturation lower and upper bounds.Value (Min-Max)Slider pair to set the value/brightness lower and upper bounds.
Adjust these sliders until the Masked Image highlights your target color range while excluding unwanted areas.
π― Features
Visual, interactive color selection with three range sliders.
Live mask preview to quickly validate selected color ranges.
Outputs both mask and visualizations so you can use either for analysis or downstream processing.
Combines masked foreground with a grayscale background to help verify extracted regions.
π How to use
Connect an image-producing block to the
Image Anyinput.Move the
Hue (Min-Max),Saturation (Min-Max)andValue (Min-Max)sliders to isolate the color you want.Inspect the
Masked Imageto confirm the selection.Use
Result ImageorAdded Imagefor visual outputs, andMasked Imagefor further processing or measurements.
βοΈ What happens when it runs
When executed, the block converts the input image into HSV space, builds a binary mask using the slider ranges, produces a masked color image (foreground), a grayscale background, and a combined visualization for easy validation.
π‘ Tips and Tricks
Preprocess to reduce noise: feed the input through
Blurbefore this block to smooth noisy images and get cleaner masks.Better separation for large images: use
Image Resizeto reduce image size for faster interactive tuning, then process full-size when settings are finalized.Focus on area of interest: crop the input with
Image ROI Selectbefore applying HSV to avoid color confusion from surrounding regions.Refine the mask: combine this block's
Masked ImagewithApply Maskto filter another image or chain intoImage Thresholdfor further binary cleanup.Visual inspection: connect the output to
Show Imageto open the image viewer and inspect results in a larger window.Save results: use
Image LoggerorImage Writeto save masked images or visualizations once you have the desired settings.Use with detectors: after isolating a color region, pass the masked or result image to detection blocks like
Find ObjectorBlob Detectorto locate specific features that match the selected color.Background analysis: combine with
Background Subtractorwhen working on video streams to separate moving colored objects from static backgrounds.
π οΈ Troubleshooting
Little or no mask output: check that your sliders cover the correct hue range for the target color and that the input image is in the expected color space (photographed in normal lighting).
Mask too broad: narrow the
Saturation (Min-Max)andValue (Min-Max)ranges to exclude similar but undesired colors and highlights.Excess noise in mask: add
Bluror runImage Threshold/ morphological cleanup blocks after the mask to remove small speckles.Performance concerns: resize the image with
Image Resizefor interactive tuning; apply settings on full resolution only when ready.
If you need more targeted guidance on block combinations for a specific task, describe the scenario (camera type, target color, real-time vs. offline) and recommended combinations can be suggested.
Last updated