You are here: Start » AVL.NET » Function Reference » Computer Vision » Image Analysis » AVL.MeasureObjectWidth

AVL.MeasureObjectWidth

Measures the width of an object using stripe detection.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void MeasureObjectWidth
(
	AvlNet.Image inImage,
	IList<AvlNet.ScanMap> inMeasurementMap,
	AvlNet.StripeScanParams inStripeScanParams,
	AvlNet.MeasureObjectMethod inMeasureMethod,
	AvlNet.Selection inStripeSelection,
	AvlNet.LocalBlindness? inLocalBlindness,
	AvlNet.MEstimator? inOutlierSuppression,
	int inOutlierCount,
	out float? outObjectWidth,
	out AvlNet.Segment2D? outSegment1,
	out AvlNet.Segment2D? outSegment2
)

Parameters

Name Type Range Default Description
inImageAvlNet.ImageInput image.
inMeasurementMapSystem.Collections.Generic.IList<AvlNet.ScanMap>Input measurement map.
inStripeScanParamsAvlNet.StripeScanParamsParameters controlling the object stripe extraction process.
inMeasureMethodAvlNet.MeasureObjectMethodMethod used to measure the object.
inStripeSelectionAvlNet.Selectionavl::Selection::BestSelection mode of edges of the object. Default value: avl::Selection::Best.
inLocalBlindnessAvlNet.LocalBlindness?Defines conditions in which weaker edges can be detected in the vicinity of stronger edges. Default value: atl::NIL.
inOutlierSuppressionAvlNet.MEstimator?Selects a method for ignoring incorrectly detected points. Default value: atl::NIL.
inOutlierCountintDetermines how many outlying points are rejected before the width is measured.
outObjectWidthfloat?Width of the object.
outSegment1AvlNet.Segment2D?First edge of the object.
outSegment2AvlNet.Segment2D?Second edge of the object.

Description

The filter measures the width of an object present in an image. Internally, it performs a series of scans with ScanSingleStripe filter using inMeasurementMap and inStripeScanParams. The so obtained points are then used for computing two parallel segments by means of a slightly modified segment fitting routine. The process is supported by inOutlierSuppression parameter. Finally, having the aforementioned stripe widths and fitted segments' direction, the object width can be computed using a selected inMeasureMethod method. The inOutlierCount stripe widths most differing from the median width are not used in this step. The inMeasurementMap should be created with CreateMeasurementMap function. For the filter to work properly, the scan segments do not have to be necessarily perpendicular to the object edges.

Examples

MeasureObjectWidth performed on the sample image. Green segments are diagScanSegments, the other two are the found object edges.

Errors

List of possible exceptions:

Error type Description
DomainError Invalid MeasurementMap in MeasureObjectWidth function. Use CreateMeasurementMap function to create it properly.

Function Overrides

See also