Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform adaptive thresholding on images to convert grayscale images into binary images, enhancing contrast and highlighting important features for image processing tasks.
AdaptiveThresholding is a powerful node designed to perform adaptive thresholding on images, which is a technique used to convert grayscale images into binary images. This method is particularly useful when dealing with images that have varying lighting conditions, as it dynamically determines the threshold for different regions of the image. By doing so, it enhances the contrast and highlights important features, making it easier to process and analyze the image further. AdaptiveThresholding is beneficial for tasks such as edge detection, object recognition, and image segmentation, providing a robust solution for handling complex visual data.
This parameter represents the source image that you want to apply adaptive thresholding to. The image should be in a format that can be processed by the node, typically a grayscale image.
This integer parameter sets the maximum value to be assigned to the pixels that pass the thresholding test. It ranges from 0 to 255, with a default value of 255. Adjusting this value can affect the brightness of the resulting binary image.
This parameter determines the adaptive thresholding algorithm to be used. The available options are "ADAPTIVE_THRESH_MEAN_C" and "ADAPTIVE_THRESH_GAUSSIAN_C", with the default being "ADAPTIVE_THRESH_GAUSSIAN_C". "ADAPTIVE_THRESH_MEAN_C" calculates the mean of the neighborhood area, while "ADAPTIVE_THRESH_GAUSSIAN_C" uses a weighted sum of the neighborhood values.
This parameter specifies the type of thresholding to be applied. It uses predefined threshold types such as binary or inverse binary. The default value is the first option in the list of threshold types.
This integer parameter defines the size of the neighborhood area used to calculate the threshold for each pixel. It must be an odd number greater than 1, with a default value of 4. Increasing the block size can help in smoothing out noise but may reduce the detail in the thresholded image.
This integer parameter is a constant subtracted from the mean or weighted mean calculated. It helps in fine-tuning the thresholding process. The default value is 2, and it can be adjusted to any integer value, including negative values, to achieve the desired thresholding effect.
The output is a binary image where the pixels are either set to the maximum value or zero based on the adaptive thresholding criteria. This binary image can be used for further image processing tasks such as contour detection, segmentation, or feature extraction.
block_size
parameter to control the level of detail in the thresholded image. A larger block size can help reduce noise but may also smooth out important features.c
parameter to fine-tune the thresholding. If the resulting image is too bright or too dark, try adjusting this value to achieve a better balance.block_size
parameter must be an odd number greater than 1 to properly define the neighborhood area for threshold calculation.block_size
value is set to an odd number greater than 1, such as 3, 5, or 7.adaptive_method
parameter must be one of the predefined options: "ADAPTIVE_THRESH_MEAN_C" or "ADAPTIVE_THRESH_GAUSSIAN_C".adaptive_method
value is correctly set to either "ADAPTIVE_THRESH_MEAN_C" or "ADAPTIVE_THRESH_GAUSSIAN_C".threshold_type
parameter must be set to a valid threshold type from the predefined list.threshold_type
value is correctly chosen from the available options and matches the expected format.© Copyright 2024 RunComfy. All Rights Reserved.