You are here: Start » AVL.NET » AVL.MeasureObjectWidth(AvlNet.Image, AvlNet.ScanMap[], AvlNet.StripeScanParams, AvlNet.MeasureObjectMethod, AvlNet.Selection, AvlNet.LocalBlindness, AvlNet.MEstimator?, int, float?, AvlNet.Segment2D?, AvlNet.Segment2D?, AvlNet.Point2D[], AvlNet.Point2D[])

AVL.MeasureObjectWidth(AvlNet.Image, AvlNet.ScanMap[], AvlNet.StripeScanParams, AvlNet.MeasureObjectMethod, AvlNet.Selection, AvlNet.LocalBlindness, AvlNet.MEstimator?, int, float?, AvlNet.Segment2D?, AvlNet.Segment2D?, AvlNet.Point2D[], AvlNet.Point2D[])

Measures the width of an object using stripe detection.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void MeasureObjectWidth(
	AvlNet.Image inImage,
	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,
	out AvlNet.Point2D[] diagPoints1,
	out AvlNet.Point2D[] diagPoints2
)

Parameters

inImage
Type: AvlNet.Image
Input image
inMeasurementMap
Type: AvlNet.ScanMap
Input measurement map
inStripeScanParams
Type: AvlNet.StripeScanParams
Parameters controlling the object stripe extraction process
inMeasureMethod
Type: AvlNet.MeasureObjectMethod
Method used to measure the object
inStripeSelection
Type: AvlNet.Selection
Selection mode of edges of the object
inLocalBlindness
Type: AvlNet.LocalBlindness
Defines conditions in which weaker edges can be detected in the vicinity of stronger edges, or null.
inOutlierSuppression
Type: System.Nullable<AvlNet.MEstimator>
Selects a method for ignoring incorrectly detected points, or null.
inOutlierCount
Type: System.Int32
Determines how many outlying points are rejected before the width is measured
outObjectWidth
Type: System.Nullable<System.Single>
Width of the object
outSegment1
Type: System.Nullable<AvlNet.Segment2D>
First edge of the object
outSegment2
Type: System.Nullable<AvlNet.Segment2D>
Second edge of the object
diagPoints1
Type: AvlNet.Point2D
Detected edge points on the first side
diagPoints2
Type: AvlNet.Point2D
Detected edge points on the second side

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

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

See also