Comment on page
Non-zero of Image
The
Node_Count_NonZero
in AugeLab Studio calculates the total number of non-zero pixels in an image. This node is useful for analyzing the presence or density of pixels with non-zero values in an image.The
Node_Count_NonZero
node calculates the total number of non-zero pixels in an image.- Node Title: Non-zero of Image
- Node ID: OP_NODE_COUNT_NONZERO
- Tooltip: Get total number of non-zero pixels in an image
The
Node_Count_NonZero
node has one input socket:- 1.Input Image: Connect the image for which you want to count the number of non-zero pixels. The image should be of type
ImageAny
.
The
Node_Count_NonZero
node has one output socket:- 1.Count: Provides the total number of non-zero pixels in the input image. The count is of type
Number
.
The
Node_Count_NonZero
node does not have any additional configuration parameters.- 1.Drag and drop the
Node_Count_NonZero
node from the node library onto the canvas in AugeLab Studio. - 2.Connect the input image for which you want to count the number of non-zero pixels to the "Input Image" input socket.
- 3.Run your project or trigger the execution of the node.
- 4.The node will calculate the total number of non-zero pixels in the input image and provide the count as the output.
Let's walk through an example to illustrate how the
Node_Count_NonZero
node works.- 1.Drag and drop the
Node_Count_NonZero
node onto the canvas. - 2.Connect the input image for which you want to count the number of non-zero pixels to the "Input Image" input socket.
- 3.Run your project or trigger the execution of the node.
- 4.The node will calculate the total number of non-zero pixels in the input image and provide the count as the output.
- The
Node_Count_NonZero
node operates on grayscale or single-channel images. If the input image has multiple channels, it will be converted to grayscale using the BGR to grayscale conversion before counting the non-zero pixels. - The output count represents the total number of non-zero pixels in the image.
- The node uses the
cv2.countNonZero()
function from the OpenCV library to perform the pixel counting.
That concludes the documentation for the
Node_Count_NonZero
node in AugeLab Studio. This node provides a simple and efficient way to calculate the total number of non-zero pixels in an image, enabling various image analysis and processing tasks.