Edge Filter

This function block detects edges in an image and outputs a grayscale edge map. It is useful for extracting object boundaries, preparing images for contour detection, or highlighting structural details.

πŸ“₯ Inputs

Image Any This input accepts any image (color or grayscale) to be processed.

πŸ“€ Outputs

Grayscale Image A grayscale image showing detected edges (edge map).

πŸ•ΉοΈ Controls

Filter Coefficient Slider that controls the sensitivity/strength of the edge detection. Adjusting this slider changes how aggressive the filter is at detecting edges.

βš™οΈ Running Mechanism

  • When the block runs, it processes the provided image and produces a grayscale map highlighting edges.

  • Color images will be handled appropriately so that the filter produces a single-channel edge result.

  • The block uses an automatic thresholding approach that adapts to the image content; the Filter Coefficient lets you bias this behavior to be more or less sensitive.

🎨 Features

  • Produces a clean edge map suitable for downstream processing.

  • Real-time interactive control via Filter Coefficient for fast tuning.

  • Works with both color and grayscale inputs.

  • Lightweight and well-suited as a preprocessing step for shape/contour analysis.

πŸ“ Usage Instructions

  1. Connect an image-producing block to Image Any.

  2. Adjust the Filter Coefficient slider while observing the output to get the desired edge detail.

  3. Use the resulting Grayscale Image for visualization or feed it to further analysis blocks.

πŸ’‘ Tips and Tricks

  • Pre-filter noisy images with Blur or Denoising before feeding into this block to reduce spurious edges.

  • Use Image Threshold or Image Adaptive Threshold after edge detection to create clean binary masks for contour extraction.

  • Combine with ROI blocks such as Image ROI Select or Image ROI to focus edge detection on a specific area.

  • Pass the output to contour and shape analysis blocks like Find Contour, Approximate Contour, Minimum Rectangle, or Shape Detector to extract geometric features.

  • For line-related analysis, feed the edge map to Line Detector or Histogram On Line to find and evaluate linear structures.

  • Preview results with Show Image and save important frames using Image Logger or Image Write.

  • If you need to clean up thin or broken edges, try Morphological Transformations (e.g., dilation/erosion) after this block.

(hint: useful blocks to combine β€” Blur, Denoising, Image Threshold, Image Adaptive Threshold, Image ROI Select, Find Contour, Approximate Contour, Minimum Rectangle, Line Detector, Histogram On Line, Morphological Transformations, Show Image, Image Logger, Image Write)

πŸ› οΈ Troubleshooting

  • No edges visible: increase the Filter Coefficient or pre-enhance contrast with blocks like Contrast Optimization or Auto Contrast.

  • Too many noisy edges: lower the Filter Coefficient and try Blur or Bilateral Filter beforehand.

  • Broken or disconnected edges: apply Morphological Transformations (dilate) to bridge gaps, or adjust preprocessing to improve continuity.

  • Very large images: use Image Resizer to reduce input size for faster processing while testing.

Last updated