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

  1. Connect an image-producing block (camera, file loader or other processing block) to the Image Any input.

  2. Select the desired filter using the Filter Type dropdown.

  3. 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 Blur block 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 Threshold block.

  • Use Edge Filter or Sobel Filter blocks 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 Image or save with Image Write.

  • When working with regions of interest, crop first using Image ROI, Image ROI Select or Image ROI Polygon and 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 Resize to downscale, filter, then optionally upscale.

Suggested block combinations:

  • Camera input workflow: Camera USB β†’ 2D Filter β†’ Show Image

  • Preprocessed edge detection: Blur β†’ 2D Filter β†’ Image Threshold

  • ROI-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 Type is selected.

  • If output is too noisy, add Blur before this block or try a different filter kernel with stronger smoothing characteristics.

  • If output size or format is incompatible with downstream blocks, add Image Resize or Merge Channels as needed.

Last updated