2D Filter
This function block applies a selectable 2D convolution filter to an input image and returns a grayscale filtered result. It is useful for edge detection, embossing, sharpening and similar image enhancement tasks.
π₯ Inputs
Image Any Accepts any image (color or grayscale) to be filtered.
π€ Outputs
Image Gray Returns the filtered image in grayscale.
πΉοΈ Controls
Filter Type Choose the desired filter from a dropdown. Common choices include Emboss, Contour, Sharpen, Laplacian, and several Sobel/edge variants.
π¨ Features
Applies a variety of predefined convolution kernels for common 2D filtering tasks.
Automatically converts color input to grayscale before applying the filter.
Simple dropdown interface to quickly switch between different filter kernels.
π Usage Instructions
Connect an image-producing block (camera, file loader or other processing block) to the
Image Anyinput.Select the desired filter using the
Filter Typedropdown.The block outputs a single-channel grayscale image on
Image Gray, suitable for downstream analysis or visualization.
π Evaluation
On evaluation this block converts color images to grayscale if needed, applies the selected 2D convolution filter, and outputs the filtered grayscale image.
π‘ Tips and Tricks
For noisy images, place a
Blurblock before this block to reduce small artifacts and get cleaner edge responses.If you want a binary edge result after filtering, connect the output to an
Image Thresholdblock.Use
Edge FilterorSobel Filterblocks when you need specialized edge operators; this block is good for quick experimentation with several different kernels.To inspect results visually, connect the output to
Show Imageor save withImage Write.When working with regions of interest, crop first using
Image ROI,Image ROI SelectorImage ROI Polygonand then apply the filter only to the area of interest.If you need to align sizes before filtering (large images may be slow), use
Image Resizeto downscale, filter, then optionally upscale.
Suggested block combinations:
Camera input workflow:
Camera USBβ2D FilterβShow ImagePreprocessed edge detection:
Blurβ2D FilterβImage ThresholdROI-based filtering:
Image ROI Selectβ2D FilterβFind Contour
π οΈ Troubleshooting
If the output looks identical to the input, ensure the input was not already a single-channel image and that a different
Filter Typeis selected.If output is too noisy, add
Blurbefore this block or try a different filter kernel with stronger smoothing characteristics.If output size or format is incompatible with downstream blocks, add
Image ResizeorMerge Channelsas needed.
Last updated