Histogram On Curve
This function block analyzes pixel values along a detected curved line across a grayscale or binary image. It detects line points, fits a smooth curve, evaluates pixel values along that curve against a threshold, and returns visualizations and numeric results to help you inspect line quality and detect gaps or peaks.
π₯ Inputs
Input Image (Binary Image) Grayscale or binary image to analyze. Preferred when foreground/background contrast is strong.
Line Location (pixel) Number of sample lines to use when detecting the curve (the block samples multiple straight lines and derives curve points).
Line detection threshold Pixel intensity threshold used during line pixel detection (valid range 0β255).
Pixel Value Threshold Pixel intensity threshold used when evaluating pixel values along the detected curve (valid range 0β255).
π€ Outputs
Output Image Annotated source image showing the sampled lines/curve and detected points.
Plot Image Plot visualization showing pixel profiles and gradient information used during detection.
Curve Image Visualization of the detected curve and pixel values along it.
Line Angle Estimated angle of the fitted curve (useful for geometry checks).
Is Line Valid? Boolean flag indicating whether the detected curve passes internal validity checks (useful to gate further processing).
πΉοΈ Controls
Relation Dropdown to select line sampling relation (vertical vs horizontal orientation). This changes how the block samples image lines during curve detection.
β¨ Features
Detects curve points by sampling several straight lines across the image and fitting a smooth polynomial through these points.
Produces both image annotations and plotted diagnostics to help verify detection quality.
Validity check that flags unreliable detections so downstream blocks can handle failures.
Adjustable thresholds and line sampling count via inputs for fine control over sensitivity.
π Usage Instructions
Provide a clear grayscale or binary image to
Input Image (Binary Image).Set
Line Location (pixel)to the number of sampling lines (higher numbers increase robustness but are slower).Tune
Line detection thresholdto reliably identify line pixels on sampled lines.Tune
Pixel Value Thresholdto mark significant pixel regions along the fitted curve.Inspect
Output Image,Plot Image, andCurve Imageto validate detection. UseIs Line Valid?to decide whether to continue processing.
π Evaluation
When evaluated, the block:
Samples multiple straight lines across the image (orientation chosen via
Relation),Detects line pixels and computes curve points,
Fits a smooth curve and computes angle and pixel statistics,
Returns annotated images, plots, and validation flags for downstream use.
π‘ Tips and Tricks
Preprocess noisy images with
Blurto reduce spurious peaks before curve detection.Use
Image Thresholdto create a binary image if the curve contrast is low β this often improves line detection reliability.Crop the area of interest with
Image ROI Selectso the block focuses on the relevant region and avoids unrelated edges.Send visual outputs to
Show Imageto inspectOutput Image/Plot Image/Curve Imageinteractively while tuning parameters.If you want to save analysis results for later review, use
Image LoggerorImage Writewith the images returned from this block.
(hint: combine preprocessing blocks such as Blur and Image Threshold upstream, then feed into this block; visualize results with Show Image and optionally archive them with Image Logger or Image Write.)
π οΈ Troubleshooting
If you get an error about invalid line detection, try increasing the number of sampled lines (
Line Location (pixel)) or preprocess withBlurandImage Threshold.If no peaks appear in plots, reduce thresholds or improve contrast of the
Input Image (Binary Image).If the detected curve is shifted or noisy, crop the image with
Image ROI Selectto remove distracting regions and try again.
Last updated
Was this helpful?