Count Pixels in Grayscale Scale

You are currently viewing the documentation for a pre-release version (2.2.0). To access documentation for other versions, click the "Switch Version" button located in the upper-right corner of the page.

■ If you're unsure about the version of the product you are using, please contact Mech-Mind Technical Support for assistance.

Description

This Step is used to count the number of pixels within the specified region of a grayscale image that fall within the defined grayscale threshold ranges.

Usage Scenario

This Step is applicable to scenarios where the number of pixels in a specified grayscale range in an image or a specified region needs to be counted.

For example, it can track pixel count changes in bright spots, dark spots, or specific grayscale regions, determine the proportion of a given grayscale class within the target region, or provide a quantitative basis for thresholding results.

Input and Output

Input

Input port Data type Description

Grayscale Image

Image

The grayscale image used for pixel counting.

Alignment Parameter Group

Pose2D

Used to adjust the feature region’s pose in sync with the target object’s pose changes.

Output

Output port Data type Description

Mask

Image

A single-channel binary image generated by thresholding. Pixels with gray values within the specified threshold ranges are set to 255 (white), while others are set to 0 (black).

Pixel Count

Number

The number of pixels with gray values within the specified threshold ranges.

Parameter Description

Parameter Description

ROI Settings

This parameter is used to set the image area for pixel counting. When the Step is executed, only the number of pixels whose grayscale values fall within the set threshold in the ROI will be counted.

Threshold range

This parameter defines one or more closed-interval grayscale ranges. When the input grayscale image is counted as pixels, the number of pixels falling within these ranges will be counted.

When multiple ranges are set, overlapping grayscale values do not result in duplicate pixel counts.

Is this page helpful?

You can give a feedback in any of the following ways:

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.