Find Transition Points Using Peak Analysis¶
Finds the position of all transition points along a line segment probe that crosses one or several objects edges, and allows selecting the most relevant ones. Crosswise and lengthwise filtering can be activated for noise reduction.
Point location. Contrast-based selection¶
Point Location principle¶
Point location principle (left) and S-shaped curve and its derivative (right)¶
On a linear profile extracted from an image, an edge appears as a transition from dark to light (or vice versa). When plotting pixel values along the gauge, this transition appears as an S-shaped curve. The first derivative of this curve exhibits a peak around the transition point. The better the contrast, the sharper the transition and the higher the peak.
EasyGauge extracts the pixel values along a profile (red curve) then uses peak analysis to determine the transition location. All the pixel values in the peak area are used to compute the transition location.
Sub-pixel accuracy is only possible if the transition is surrounded by almost uniform regions of at least 2 pixels wide.
BWB transitions have an increasing profile curve and the peak takes positive values. Otherwise, the curve decreases and the peak extends negatively.
You cannot normally detect peaks using the default threshold value (20) as BWB or WBW transitions base the peak analysis on the gray level profile along the EPointGauge (or sample path) and not its first derivative.
EPointGauge .NET Python contains all point measurement parameters, with default values that detect reasonably contrasted edges.
EPointGauge Parameters¶
EPointGauge::GetCenter.NET Python: Nominal point position (will normally be different before and after measurement).EPointGauge::GetTolerance.NET Python: Tolerance value and gauge orientations.EPointGauge::GetTransitionType.NET Python,EPointGauge::GetTransitionChoice.NET Python,EPointGauge::GetTransitionIndex.NET Python: Peak selection strategies.EPointGauge::GetThreshold.NET Python: Noise immunity.EPointGauge::GetMinAmplitude.NET Python,EPointGauge::GetMinArea.NET Python: Peak strength.EPointGauge::GetThickness.NET Python,EPointGauge::GetSmoothing.NET Python: Local filter widths.EPointGauge::GetRectangularSamplingArea.NET Python Sets sampling area (rectangular by default) to transverse filtering mode.EPointGauge::Measure.NET Python: Measures the object.In single transition mode,
EPointGauge::GetValid.NET Python returns True when an appropriate point was found. To obtain measurement results, setEShape::GetActualShape.NET Python to True so thatEPointGauge::GetCenter.NET Python returns the located point. (False default value returns nominal point position ).In multiple transition mode,
EPointGauge::GetNumMeasuredPoints.NET Python returns the number of points found,
EPointGauge::GetMeasuredPoint.NET Python returns anEPoint.NET Python object which contains the located point information.
An integer index between 0 and GetNumMeasuredPoints-1 must be passed.EPointGauge::GetMeasuredPoints.NET Python returns a vector ofEPoint.NET Python objects which contains the located point information.
Hint
It is faster than several calls to EPointGauge::GetMeasuredPoint .NET Python for about 10 points or more.
EGauge is a fast process and using the right variant of this method can make a difference in some applications.
EPointGauge::GetMeasuredPeak.NET Python returns anEPeak.NET Python object which contains the peakEPeak::Area.NET Python andEPeak::Amplitude.NET Python and the delimiting coordinates along the probe segment (EPeak::Start.NET Python,EPeak::Length.NET Python andEPeak::Center.NET Python values).EPointGauge::GetMeasuredPeaks.NET Python returns a vector ofEPeak.NET Python objects which contains the peakEPeak::Area.NET Python andEPeak::Amplitude.NET Python and the delimiting coordinates along the probe segment (EPeak::Start.NET Python,EPeak::Length.NET Python andEPeak::Center.NET Python values).
Hint
It is faster than several calls to EPointGauge::GetMeasuredPeak .NET Python for about 10 peaks or more.
EGauge is a fast process and using the right variant of this method can make a difference in some applications.
Select Peaks to Improve Edge Precision¶
The threshold level is very important:
Too high can cause significant peaks to be missed, and insufficient pixel values to achieve good precision.
Too low can cause false peaks because of noise.
To resolve this dilemma, the EasyGauge peak selection mechanism can reject low contrast or false edges: transition strength is measured by peak amplitude and area. Every edge measurement determines peak amplitude and area. If either value falls below the EPointGauge::GetMinAmplitude .NET Python or EPointGauge::GetMinArea .NET Python, the peak is disregarded and no point is assumed at that location.
Threshold level selection (left) and Peak amplitude and area (right)¶
Multiple Versus Single Transition¶
EasyGauge can measure several edge points in a single go and retrieve all results afterwards while in multiple transition mode.
Multiple transition (left) versus single transition (right)¶
You can select the single most relevant transition based on 4 criteria: the highest peak, the peak with the largest area, the peak closest to the gauge center, or the N-th peak encountered starting from one tip of the gauge.
Choice: (1) best area, (2) best amplitude, (3) closest, (4) 3rd from the start¶
Note
When several peaks have the same value (same area, same amplitude…), the last peak is selected.
Positive or Negative Peak Selection¶
Peak selection can also be refined by choosing the transition polarity: White to Black or Black to White (i.e. positive or negative peak), or indifferent.
Black to white, white to black or indifferent polarities¶
Prefiltering¶
Prefiltering the image locally can reduce noise effects.
Transverse (lengthwise) filtering averages several parallel lines when sampling the image.
Longitudinal (crosswise) uniform filtering can also be applied to the resulting profile curve.
Thick point gauge for filtering¶
Transverse Filtering¶
Transverse filtering places parallel line segments in either a parallelogram or a rectangle (default). This behavior can be toggled.
Parallelogram mode is faster than rectangular if the angle is close to 0° or 90°, or thickness is less than 5. If thickness=1, no difference exists between the two modes.
EPointGauge::GetThickness .NET Python determines the number of parallel lines.
EPointGauge::GetRectangularSamplingArea .NET Python is the smallest region containing all the parallel line segments.
Rectangular sampling area (left) and Parallelogram sampling area (right)¶
Point Probe Position¶
The expected nominal position of a point gauge is specified by its center, orientation angle with respect to the X-axis, and length tolerance that the point position can vary.
The results are the coordinates of the located points (the actual location) and the strength of the transition (amplitude and area).
Low values indicate a weak edge, possibly corresponding to an unreliable or inaccurate measurement.
Tuning Point Measurement Parameters for Unclear Edges¶
The EasyGauge default parameters and working modes are good for clear edges. More complex situations may need parameter tuning.