Histogram On Line
This function block analyzes pixel values along a single defined line in a grayscale or binary image. It detects segments where pixel values exceed a threshold and visualizes the line and found segments on an output image.
π₯ Inputs
Input Image (Binary Image) A binary or grayscale image used for line analysis.
π€ Outputs
Output Image The source image annotated with the drawn line and markers for detected peak segments.
Peak Count Number of detected threshold segments along the line.
Peak Start Locations List of start coordinates for each detected segment.
Peak End Locations List of end coordinates for each detected segment.
Peak Mean Locations List of mean (center) coordinates for each detected segment.
πΉοΈ Controls
Relation Dropdown to choose line orientation (vertical or horizontal).
Line Location Slider / input to pick the pixel position of the line (in pixels). Accepts single value; validated against image size.
Pixel Threshold Slider / input for the pixel value threshold (0β255) used to determine active segments.
π¨ Features
Visual feedback with a red line and colored markers showing segment start, end, and mean positions.
Accepts vertical or horizontal lines and validates line location against image dimensions.
Ignores segments that touch image edges (configurable by internal behavior) to avoid edge artifacts.
Returns both visual and structured outputs for downstream processing.
π Usage Instructions
Provide a grayscale or binary image to the
Input Image (Binary Image)input.Choose the line orientation using
Relation.Set the
Line Location(pixel index) within image bounds.Set
Pixel Thresholdbetween 0 and 255 to control sensitivity.Run the block to get an annotated image and lists of detected segment coordinates.
π Evaluation
On execution, the block samples pixel values along the chosen line, finds contiguous segments where values meet or exceed the threshold, marks them on the output image, and returns the count and coordinate lists.
π‘ Tips and Tricks
Preprocess noisy inputs with
Blurto reduce spurious detections and withImage Thresholdto create a clean binary image before analyzing a line.Use
Image ROI SelectorImage ROIto crop the region of interest so line coordinates are simpler and more meaningful.Combine with
Draw Linewhen you want interactive line placement on the displayed image, then copy the pixel position intoLine Location.Use
HSV Filterto isolate color channels or features before converting to grayscale for more reliable peak detection.Inspect results visually by connecting the output image to
Show Imageso you can open a larger viewer and verify detected segments.If your flow may produce empty images, consider
Is Noneto guard downstream logic against missing results.
π οΈ Troubleshooting
If you get no peaks, try lowering
Pixel Thresholdor preprocess withImage Threshold/Blur.If line position causes errors, ensure
Line Locationis within image width (for vertical) or height (for horizontal). The block will report and clamp out-of-range values.If many tiny segments appear, increase the threshold or smooth the image first with
Blur.
Last updated