Find Shapes Using Geometric Models¶
The predefined geometric models ELineGauge .NET Python, ECircleGauge .NET Python, ERectangleGauge .NET Python, EWedgeGauge .NET Python or EPolygonGauge .NET Python can be fit over the edges of an object. The targeted edge must be defined, and points sampled along it at regularly spaced point measurement gauges. Model fitting in the least square sense can be applied.
Line: Measures position and orientation of straight edges.
Line gauge examples.¶
Circle: Measures position and curvature of a circle or arc.
Circle gauge examples.¶
Rectangle: Measures position, orientation and size of a rectangle.
Rectangle gauge examples.¶
Wedge: Measures position, orientation and size of a ring/ disk sector / curvilinear rectangle.
Wedge gauge examples.¶
Polygon: Fits a polygon to an object and measures the exact position of the polygon, the relative orientation of the edges or the path of the contour.
All gauge types share these common features:
Point sampling
Point gauges are placed along the edges and point measurement carried out at regularly spaced spots, which can be adjusted differently per side in rectangle and wedge gauges. All point measurement parameters and operating modes are available.
ELineGauge::GetSamplingStep.NET Python sets the spacing of point location gauges along the model.ELineGauge::GetNumSamples.NET Python returns the number of points sampled during the model fitting operation.
Sampling paths and sampled points¶
Model fitting
The model is adjusted to minimize error residue and provide the best edge parameter estimates. Rectangles and wedges have parallelism and concentricity constraints. Image shows sampled points and fitted line.
Line fitted to sample points.¶
Outlier rejection
After model fitting, some points will be too far away from the fitted model and may harm location accuracy. EasyGauge can tag them as outliers to be ignored using the
ELineGauge::GetFilteringThreshold.NET Python property.The outlier elimination process can be repeated several times using
ELineGauge::GetNumFilteringPasses.NET Python.
The number of valid sample points remaining after a model fitting operation is kept inELineGauge::GetNumValidSamples.NET Python.
The average distance of these points to the fitted model is returned byELineGauge::GetAverageDistance.NET Python.
Outlier rejection.¶
Skip range
The skip ranges define exclusion ranges for the paths. The sample point indexes in the skip ranges are not taken into account to fit the model.
The skip ranges apply to all gauge models:
ELineGauge.NET Python,ECircleGauge.NET Python,ERectangleGauge.NET Python,EWedgeGauge.NET Python andEPolygonGauge.NET Python.To define several skip ranges, use
ELineGauge::AddSkipRange.NET Python.To manage the skip ranges, use
ELineGauge::RemoveSkipRange.NET Python,ELineGauge::RemoveAllSkipRanges.NET Python andELineGauge::GetSkipRange.NET Python.You must call the method
ELineGauge::Measure.NET Python to take a skip range into account.Use the attribute
EDrawingMode_PointsInSkipRange.NET Python with the methodELineGauge::Draw.NET Python to display the skipped points.
Skip range.