🎯 Mask to Position Guide:
The ArchAi3D_Mask_To_Position_Guide node is designed to transform a mask tensor into a position guide by detecting and numbering distinct regions within the mask. This node is particularly useful for AI artists who need to visualize and manage different areas of an image or 3D model. By converting the mask into a PIL image, the node identifies regions, assigns numbers based on a specified order, and draws numbered rectangles around these regions. The final output is a tensor that can be used for further processing or visualization. This node simplifies the task of region identification and numbering, making it easier to manage complex images or models with multiple areas of interest.
🎯 Mask to Position Guide Input Parameters:
mask
The mask parameter is the input tensor representing the mask that you want to process. This mask is converted into a PIL image for region detection. The quality and detail of the mask directly impact the accuracy of region detection and numbering.
padding
The padding parameter determines the amount of space added around each detected region. It affects how closely the rectangles fit around the regions. The default value is 5, and you can adjust it to ensure that the rectangles do not overlap or are too tight around the regions.
numbering_order
The numbering_order parameter specifies the order in which the regions are numbered. Options include "left_to_right" and potentially others, allowing you to control the sequence of numbering based on your specific needs. This parameter is crucial for maintaining a logical order in the visualization.
rectangle_color
The rectangle_color parameter defines the color of the rectangles drawn around each region. You can choose from predefined colors or specify a custom hex color. This customization helps in distinguishing the regions clearly.
line_thickness
The line_thickness parameter sets the thickness of the lines used to draw the rectangles. Adjusting this value can enhance the visibility of the rectangles, especially in high-resolution images.
number_size
The number_size parameter controls the size of the numbers drawn within the rectangles. This is important for ensuring that the numbers are legible, especially when dealing with small or densely packed regions.
number_color
The number_color parameter specifies the color of the numbers. Similar to rectangle_color, you can choose from predefined options or use a custom hex color to ensure the numbers stand out against the background.
background_color
The background_color parameter sets the background color for the guide image. This can be a standard color or a custom hex value, allowing you to match the guide's background with your project's theme or requirements.
🎯 Mask to Position Guide Output Parameters:
guide_tensor
The guide_tensor is the final output tensor that contains the processed image with numbered rectangles. This tensor can be used for further analysis or as a visual guide in your projects.
region_count
The region_count output provides the total number of regions detected and numbered in the mask. This information is useful for understanding the complexity of the image and for verifying that all intended regions have been identified.
bbox_list
The bbox_list is a JSON-formatted list of bounding boxes for each detected region. This list includes the coordinates and dimensions of each rectangle, providing detailed information for further processing or integration with other systems.
🎯 Mask to Position Guide Usage Tips:
- Ensure that your input mask is clear and well-defined to improve the accuracy of region detection.
- Adjust the
paddingandline_thicknessparameters to optimize the visibility of rectangles, especially in images with closely packed regions. - Use custom hex colors for
rectangle_color,number_color, andbackground_colorto match your project's color scheme and enhance visual clarity.
🎯 Mask to Position Guide Common Errors and Solutions:
Invalid mask input
- Explanation: The input mask is not in the correct tensor format or is corrupted.
- Solution: Verify that the mask is a valid tensor and is properly formatted before inputting it into the node.
Region detection failure
- Explanation: The node fails to detect regions due to poor mask quality or incorrect parameter settings.
- Solution: Ensure the mask is clear and adjust parameters like
paddingandnumbering_orderto improve detection accuracy.
Color specification error
- Explanation: An invalid color value is provided for rectangle, number, or background colors.
- Solution: Double-check the color values, especially custom hex codes, to ensure they are correctly formatted.
