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

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.

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.

../../../../_images/17823.webp

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.

1. Set the gauge point location and tolerance.
The center position and orientation are easy to decide based on a sample image or on coordinate considerations. The tolerance depends on the edge position variations. A larger tolerance increases the likelihood of hitting an edge, but it may be a false edge or extraneous feature.

2. Decide whether noise reduction is required. Lay the gauge over the desired location and observe the profile curve and its derivative (play with the filtering parameters while looking at the plotted curve). The curve regularity gives an indication of the spread of the gray-level values.
When these coefficients are set, the gray-level profile will not change anymore.

3. Set the threshold value to be low enough for useful parts of the peaks to cover enough pixels (to achieve better sub-pixel accuracy), but not lower than the ambient image noise.

4. Remove weak or false edges using the list of peak amplitudes and areas. Plotting these values along with good and extraneous peaks can help find appropriate peak rejection limits.

5. Choose whether all transition points are needed or just the most relevant. If all are required, they can be queried one after another. Otherwise, a point selection strategy should be chosen based on strength, order or transition polarity (black to white and/or conversely).