CMM-Manager Edge Detection Polarity

Edge Detection Polarity

What is Edge Detection Polarity?

As CMM-Manager looks for an edge in an image, sampling each pixel within the scanning area, it compares the grayscale value of the pixel just sampled with that of the previous pixel. If the two grayscale values differ by more than a threshold amount (see Teach Edge), CMM-Manager interprets that as an edge.

What Polarity Settings are available?

Edge Detection Polarity determines the order in which a threshold grayscale transition must occur before it can be interpreted as an edge. There are five settings:
  1. Black-to-White
  2. White-to-Black
  3. First Edge
  4. Absolute Max
  5. User Pick
NOTE: The terms "Black" and "White" as used here are not meant to be taken literally: "Black" refers to a dark color or shade, and "White" refers to a light one.

Where do I find these settings?

From the Ribbon Tab Vision>Tool Options as shown below or in the Edge Threshold dialog as discussed here

Polarity Setting

Icon

Description

Black-to-White


A threshold transition from a dark color to a light color is interpreted as an edge.

White-to-Black


A threshold transition from a light color to a dark color is interpreted as an edge.

First Edge


A threshold transition in either direction is interpreted as an edge.

Absolute Max


The maximum contrast change in either direction is interpreted as an edge.

User Pick


The n-th transition (selected by the user) is interpreted as an edge.

Edge

A Practical Example

Detection Polarity, combined with an Image Tool's scan direction, affects how points along an edge are detected. Consider this example using the Circle Tool:

Note that the Circle Tool's scan direction indicators are pointing outward, meaning that Scan Out has been selected as the scan direction. This means that CMM-Manager will start at the inner circle and scan outward, toward the outer circle, looking for a threshold transition in grayscale values that indicates an edge. Given this tool and scan direction, CMM-Manager will encounter the light pixels in the center first, before it encounters the dark ones close to the outer circle. What effect would Edge Detection Polarity have on this example?


Polarity Setting

Edges found?

Discussion

Black-to-White

No

With this polarity setting, CMM-Manager identifies an edge when it sees a transition from black (dark) pixels to white (light) ones. However, scanning outward for the circle shown above, CMM-Manager will pass from white to black as it passes over the circle's edge. This transition is opposite to the Black-to-White polarity setting, so no edges will be detected.

White-to-Black

Yes

This polarity setting identifies an edge as a threshold transition from white (light) to black (dark) pixels. As CMM-Manager scans outward for the circle shown above, it passes from white to black as it passes over the circle's edge. This transition is the same as the White-to-Black polarity setting, so all edges will be detected. 

First Edge

Yes

Since the First Edge polarity setting identifies an edge by a threshold transition in grayscale value from either direction (light-to-dark or dark-to-light), all edges will be detected.

Absolute Max

Yes

Since the Absolute Max polarity setting identifies the maximum contrast change in either direction (light-to-dark or dark-to-light), all edges will be detected.

User Pick

Yes

Since the user picks the edge, as long as a transition exists above the threshold value, all edges will be detected.