# Count Edges

The Count Edges tool finds and counts the edges in the image. The tool finds edges in areas of high contrast. Use the Contrast, Transition, and Edge Width settings to fine-tune the edge detection process.

To add the Count Edges tool to your job:

1. Open the Inspect tool palette, expand the Counting tool group, and select the Count Edges tool.

2. In the dialog, define the search region by resizing and repositioning the Search box on the acquisition display screen.

3. Click OK.

Edges settings:

Advanced Setting | Description
--- | ---
Contrast | Define the contrast threshold for finding edges. The default value is 25. Use the Edge Profile chart in the advanced settings to fine-tune the contrast threshold.
Transition | Define the direction over which an edge transition takes place. The available values: Dark to Light: The function finds edges where the pixels change from dark to light. Light to Dark: The function finds edges where the pixels change from light to dark. Both (default): The function finds edges in both directions.
Edge Width | Define the pixel distance over which an edge transition takes place. Use this setting to filter out edges close to each other. The default value is 3.

Enable advanced tool settings if your job requires more complex configuration. For more information on the advanced tool settings, see Advanced Tool Settings.

To adjust range limits:

Use the Normal/Inverted toggle to change how the tool generates results.

- In Normal mode, the result passes if the edge count falls within the minimum and maximum values.

- In Inverted mode, the result passes if the edge count falls outside the minimum and maximum values.

Adjust the valid range with the slider or by providing the numerical values in the boxes below the slider.

Click Set Min/Max to use automatically calculated minimum and maximum values. By default, both values match the current edge count within the ROI.