Count Pixels in Grayscale Scale
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. |