Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Computer Vision » 2D Edge Detection » DetectEdges_AsRegion_Mask

DetectEdges_AsRegion_Mask


Module: FoundationBasic

Extracts a pixel-precise region of continuous edges. Faster, yet less accurate version.

Applications

Consistent detection of pixels that belong to contours of variable or unpredictable shape, e.g. screw thread outline or a custom piece of textile.
Name Type Range Description
inImage Image Image from which edges will be extracted
inRoi Region* Region of the image from which edges will be extracted
inEdgeMaskFilter EdgeMaskFilter Type of edge filter used for computing gradients
inEdgeThreshold Real 0.0 - Sufficient edge strength; edges of that strength will always be detected
inEdgeHysteresis Real 0.0 - Value by which the edge threshold is decreased for edge points neighboring with sufficiently strong edges
inMaxJoiningDistance Real 0.0 - Maximal distance between edges that can be joined
inMinBlobArea Integer 0 - Minimal area of an edge blob
outEdgeRegion Region Region of the found edges
diagGradientMagnitudeImage Image Visualization of the gradient magnitude

Description

The operation extracts edges from the inRoi region in the inImage image and stores the result in the outEdgeRegion region. The extraction process is the same as in DetectEdges_AsPaths_Mask, the only difference being the data type of the result. This filter returns a region rather than array of subpixel-precise paths computed by DetectEdges_AsPaths_Mask.

The extraction process starts from gradient computing, what is done using chosen non-recursive filter with fixed size mask.

On the so computed gradient image threshold with hysteresis (as in ThresholdImage_Hysteresis) is performed with inEdgeThreshold and inEdgeHysteresis parameters. After this step only gradients which are strong enough are present. The resulting edge region can be much too thick, thus it has to be thinned. To achieve this, the non-maximum suppression is used. Every pixel with at least one of its neighbors having larger gradient is no longer considered to be an edge pixel (only neighbors in the direction of pixel's gradient matter).

Examples

DetectEdges_AsRegion_Mask performed on the sample image with inEdgeMaskFilter = Sobel, inEdgeThreshold = 20, inEdgeHysteresis = 5.

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Unsupported edge mask filter in DetectEdges_AsRegion_Mask.

Complexity Level

This filter is available on Advanced Complexity Level.

Filter Group

This filter is member of DetectEdges filter group.

See Also

  • DetectEdges_AsPaths_Mask – Extracts subpixel-precise paths that represent continuous edges. Faster, yet less accurate version.