You are here: Start » AVL.NET » AVL.DetectEdges_AsRegion_Mask(AvlNet.Image, AvlNet.Region, AvlNet.EdgeMaskFilter, float, float, float, int, AvlNet.Region, AvlNet.Image)
AVL.DetectEdges_AsRegion_Mask(AvlNet.Image, AvlNet.Region, AvlNet.EdgeMaskFilter, float, float, float, int, AvlNet.Region, AvlNet.Image)
Extracts a pixel-precise region of continuous edges. Faster, yet less accurate version.
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
public static void DetectEdges_AsRegion_Mask( AvlNet.Image inImage, AvlNet.Region inRoi, AvlNet.EdgeMaskFilter inEdgeMaskFilter, float inEdgeThreshold, float inEdgeHysteresis, float inMaxJoiningDistance, int inMinBlobArea, out AvlNet.Region outEdgeRegion, out AvlNet.Image diagGradientMagnitudeImage )
Parameters
- inImage
- Type: AvlNet.Image
Image from which edges will be extracted - inRoi
- Type: AvlNet.Region
Region of the image from which edges will be extracted, or null. - inEdgeMaskFilter
- Type: AvlNet.EdgeMaskFilter
Type of edge filter used for computing gradients - inEdgeThreshold
- Type: System.Single
Sufficient edge strength; edges of that strength will always be detected - inEdgeHysteresis
- Type: System.Single
Value by which the edge threshold is decreased for edge points neighboring with sufficiently strong edges - inMaxJoiningDistance
- Type: System.Single
Maximal distance between edges that can be joined - inMinBlobArea
- Type: System.Int32
Minimal area of an edge blob - outEdgeRegion
- Type: AvlNet.Region
Region of the found edges - diagGradientMagnitudeImage
- Type: AvlNet.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.
Remarks
For more information about local coordinate systems please refer to the following article.
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.
Hardware acceleration settings may be manipulated with Settings class.


