Comment on page
Image Adaptive Threshold
Image Adaptive Thresholdnode in AugeLab Studio applies adaptive thresholding to an input image based on local neighborhood properties. This node allows you to choose the thresholding algorithm, adjust the threshold value, and specify the kernel size.
Image Adaptive Thresholdnode applies adaptive thresholding to an input image, which means that the threshold value is calculated for each pixel based on the local neighborhood of that pixel. This approach is useful for images with varying lighting conditions or uneven backgrounds.
- Node Title: Image Adaptive Threshold
- Node ID: OP_NODE_ADAP_THRESHOLD
Image Adaptive Thresholdnode has the following input socket:
- Image: The input image to be thresholded. Connect an image to this socket.
Image Adaptive Thresholdnode has the following output socket:
- ImageGray: The thresholded image converted to grayscale.
Image Adaptive Thresholdnode has the following configuration options:
- Threshold Type: Choose the adaptive thresholding algorithm from the available options:
ADAPTIVE_THRESH_MEAN_C: Adaptive thresholding based on the mean value of the neighborhood.
ADAPTIVE_THRESH_GAUSSIAN_C: Adaptive thresholding based on the weighted sum of the neighborhood values using a Gaussian window.
- Threshold: Adjust the threshold value. Pixels with values below this threshold will be set to 0, and pixels with values above or equal to this threshold will be set to the maximum value (255 for grayscale images).
- Kernel Size: Adjust the size of the neighborhood kernel. This value determines the size of the pixel neighborhood used for threshold calculation. The kernel size should be an odd number.
- 1.Drag and drop the
Image Adaptive Thresholdnode from the node library onto the canvas in AugeLab Studio.
- 2.Connect the input image to the Image input socket of the
Image Adaptive Thresholdnode.
- 3.Configure the node properties according to your needs. Choose the thresholding algorithm, adjust the threshold value, and specify the kernel size.
- 4.Run the pipeline.
Image Adaptive Thresholdnode will apply adaptive thresholding to the input image based on the specified parameters and provide the thresholded grayscale image at the ImageGray output socket.
- 6.Retrieve the thresholded image from the ImageGray output socket for further processing or visualization.
Image Adaptive Thresholdnode uses the
cv2.adaptiveThresholdfunction from OpenCV to perform adaptive thresholding.
- The threshold value is calculated individually for each pixel based on the local neighborhood defined by the kernel size.
- Pixels with values below the threshold are set to 0, and pixels with values above or equal to the threshold are set to the maximum value (255 for grayscale images).
- The choice of thresholding algorithm (mean or Gaussian) affects the calculation of the threshold value.
- The kernel size determines the size of the neighborhood used for threshold calculation. It should be an odd number to ensure symmetry.
Image Adaptive Thresholdnode converts the input image to grayscale if it is in a color format before applying the adaptive thresholding algorithm.
That concludes the documentation for the
Image Adaptive Thresholdnode in AugeLab Studio. This node allows you to apply adaptive thresholding to an input image, enhancing the visibility of objects and features based on local pixel characteristics.