Detect Guide Line:
The 1hew_DetectGuideLine node is designed to detect and highlight guide lines within an image, which can be particularly useful for artists and designers looking to identify structural elements or vanishing points in their compositions. This node leverages edge detection and line detection techniques to identify prominent lines in an image, which are then filtered and enhanced based on user-defined parameters. By doing so, it provides a visual guide that can assist in understanding the perspective and alignment within the image, making it a valuable tool for enhancing artistic compositions or analyzing the geometric structure of a scene.
Detect Guide Line Input Parameters:
image
This parameter represents the input image on which the guide line detection will be performed. It is the primary source of data for the node to process and analyze.
canny_low
The canny_low parameter sets the lower threshold for the Canny edge detection algorithm. It determines the minimum intensity gradient required for a pixel to be considered an edge. The value ranges from 0.0 to 1.0, with a default of 0.2. Lower values may result in more edges being detected, while higher values may reduce noise by ignoring weaker edges.
canny_high
The canny_high parameter sets the upper threshold for the Canny edge detection algorithm. It defines the maximum intensity gradient for edge detection. The value ranges from 0.0 to 1.0, with a default of 0.8. This parameter should be set higher than canny_low to ensure proper edge detection, with higher values focusing on stronger edges.
seg_min_len
This parameter specifies the minimum length of a line segment to be considered during the line detection process. It ranges from 1 to 300, with a default value of 40. Increasing this value will filter out shorter, potentially less significant lines, while decreasing it will allow more lines to be detected.
seg_max_gap
The seg_max_gap parameter defines the maximum gap between line segments that can be connected to form a single line. It ranges from 1 to 100, with a default of 8. Larger values allow for more discontinuous lines to be connected, while smaller values require lines to be more continuous.
guide_filter
This parameter controls the filtering of detected lines based on their alignment with a vanishing point. It ranges from 0.1 to 1.0, with a default of 0.6. Higher values result in stricter filtering, retaining only lines that closely align with the vanishing point, while lower values allow more lines to be included.
guide_width
The guide_width parameter sets the width of the guide lines drawn on the output image. It ranges from 1 to 100, with a default of 2. This affects the visual thickness of the lines, allowing for customization based on the desired emphasis.
cluster_eps
This parameter determines the maximum distance between points in a cluster for them to be considered as part of the same cluster. It ranges from 1 to 100, with a default of 30. This is used in clustering intersections to identify potential vanishing points, with larger values allowing for more dispersed clusters.
Detect Guide Line Output Parameters:
image
The image output is the processed version of the input image, with detected guide lines overlaid. This output provides a visual representation of the detected structural elements within the image.
line_image
The line_image output contains only the detected guide lines on a blank background. This can be useful for isolating the lines for further analysis or artistic manipulation.
line_mask
The line_mask output is a binary mask highlighting the areas of the image where guide lines have been detected. This can be used for masking operations or to further process the detected lines.
Detect Guide Line Usage Tips:
- Adjust the
canny_lowandcanny_highparameters to fine-tune edge detection based on the contrast and detail level of your image. Lower values may help in detecting more subtle lines. - Use the
seg_min_lenandseg_max_gapparameters to control the sensitivity of line detection, especially in images with varying line lengths and gaps. - Experiment with the
guide_filterto balance between detecting all possible lines and focusing on those that align with a vanishing point, depending on your artistic needs.
Detect Guide Line Common Errors and Solutions:
No lines detected
- Explanation: This error occurs when the node fails to detect any lines in the input image, possibly due to inappropriate parameter settings or low contrast in the image.
- Solution: Adjust the
canny_lowandcanny_highthresholds to better capture edges, and ensure the image has sufficient contrast. Also, consider lowering theseg_min_lento detect shorter lines.
Lines not aligned with vanishing point
- Explanation: Detected lines may not align with the expected vanishing point due to incorrect
guide_filtersettings or image perspective. - Solution: Increase the
guide_filtervalue to enforce stricter alignment with the vanishing point, and verify the image perspective is suitable for line detection.
