Hull Convex
This function block calculates a convex enclosing contour around a provided contour and returns visual and numeric results useful for shape analysis.
π₯ Inputs
Image The source image used for visualization and measurements.
Contour The input contour (shape) to enclose with a convex hull.
π€ Outputs
Image The source image annotated with the original contour and its convex hull.
Contour The calculated convex hull contour returned as a shape.
Center The centroid position of the convex hull (x, y).
Area The area of the convex hull.
πΉοΈ Controls
This function block has no interactive controls. It runs automatically when inputs are provided.
π― What it does
Computes an enclosing convex hull for the provided contour.
Draws both the original contour and the convex hull onto the image for clear visual comparison.
Calculates the hull area and its centroid coordinates for downstream measurements or logic.
Returns both annotated visual output and structured shape/measurement outputs for further processing.
π Usage Instructions
Provide the original image into the
Imageinput so the block can produce an annotated visual result.Provide a detected contour into the
Contourinput to compute its convex hull.Use the returned
Imageto preview hull vs original contour, useContour/Center/Areafor measurements, filtering, or reporting.
π Evaluation
When run, the block examines the provided contour, produces a convex hull shape, annotates the image with both shapes, computes the hull centroid and area, and outputs these four results: annotated image, hull contour, center point, and area.
π‘ Tips and Tricks
If you don't yet have a contour, use the
Find Contourblock orFind Objectblock to get contours from an image before feeding them into this block.To simplify complex contours before hull calculation, consider
Approximate Contourto reduce point count and improve performance.Use
Minimum Rectangle,Minimum Circle, orMinimum Ellipseafter this block when you need alternative enclosing shapes or additional geometric descriptors.Preprocess the image with
Image Threshold,Image Adaptive Threshold, orBlurto get cleaner contours for more reliable hull computation.Crop or focus analysis using
Image ROI,Image ROI Select, orImage ROI Polygonso the contour extraction and hull calculation target the area of interest.Visualize results in a larger window using
Show Imageand save important frames withImage LoggerorImage Writefor documentation or offline review.
π οΈ Troubleshooting
If the output
Contouris empty or theAreais zero: ensure the inputContouris valid and contains enough points. Use contour-producing blocks (Find Contour,Find Object) and verify their outputs.If annotations look misplaced after image scaling: ensure the same image dimensions are used throughout the pipeline (use
Image ResizeorImage Resizerconsistently).If unwanted background shapes produce large hulls: try preprocessing (thresholding, blurring) and use ROI blocks to focus on the object of interest.
Last updated
Was this helpful?