🍒Mask_White_Area_Ratio📊蒙版白色区域占比:
The Mask_White_Area_Ratio node is designed to analyze a given mask and calculate the proportion of white areas within it. This node is particularly useful for determining whether the white area in a mask exceeds a specified threshold, which can be crucial for tasks that require precise control over mask coverage, such as image processing or AI art generation. By converting the mask into a numerical format, the node evaluates the ratio of white pixels to the total number of pixels, providing a percentage that represents the white area coverage. This functionality allows you to make informed decisions based on the extent of the white area, enabling more refined control over your creative processes.
🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Input Parameters:
mask
The mask parameter is the input mask that you want to analyze. It is expected to be in a format that the node can process, typically a tensor or array representing the mask image. The mask serves as the basis for calculating the white area ratio, and its quality and resolution can impact the accuracy of the results.
area_threshold
The area_threshold parameter is a floating-point value that sets the percentage threshold for the white area ratio. It determines whether the calculated white area ratio is considered significant. The default value is 50.0, with a minimum of 0.0 and a maximum of 100.0. Adjusting this threshold allows you to define what constitutes an acceptable level of white area coverage for your specific application.
custom_white_level
The custom_white_level parameter is a hidden floating-point value that specifies the threshold for determining what is considered "white" in the mask. The default value is 0.5, with a range from 0.0 to 1.0. This parameter allows you to customize the sensitivity of the white area detection, which can be useful if your mask has varying shades of white or if you need to adjust for different lighting conditions.
🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Output Parameters:
white_area_ratio
The white_area_ratio output is a floating-point value that represents the proportion of white pixels in the mask relative to the total number of pixels. This ratio is expressed as a percentage, providing a clear indication of how much of the mask is covered by white areas. This output is crucial for understanding the extent of white coverage in your mask and can be used to make decisions based on this metric.
boolean
The boolean output is a boolean value that indicates whether the white area ratio exceeds the specified area_threshold. If the ratio is greater than the threshold, the output will be True; otherwise, it will be False. This output provides a straightforward way to determine if the white area coverage meets your predefined criteria, enabling automated decision-making in your workflows.
🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Usage Tips:
- Adjust the
area_thresholdparameter to fine-tune the sensitivity of the node to different levels of white area coverage, depending on the specific requirements of your project. - Use the
custom_white_levelparameter to account for variations in mask brightness or contrast, ensuring that the node accurately identifies white areas under different conditions.
🍒Mask_White_Area_Ratio📊蒙版白色区域占比 Common Errors and Solutions:
"Invalid mask format"
- Explanation: This error occurs when the input mask is not in a compatible format for processing.
- Solution: Ensure that the mask is provided as a tensor or array that the node can interpret. Check the input data type and structure.
"Threshold value out of range"
- Explanation: This error indicates that the
area_thresholdorcustom_white_levelvalues are outside their allowable ranges. - Solution: Verify that the
area_thresholdis between 0.0 and 100.0, and thecustom_white_levelis between 0.0 and 1.0. Adjust the values accordingly.
