Minimum Ellipse
This function block computes and draws the smallest enclosing ellipse around a provided shape (contour). It returns a visual result and numeric shape parameters useful for measurement, alignment, or further processing.
π₯ Inputs (sockets)
Image Any The image on which the ellipse will be drawn (input socket). Provide a copyable image so visual output is preserved.
Contour The contour (shape) to be enclosed by the minimum ellipse (input socket).
π€ Outputs (sockets)
Image The image with the fitted ellipse drawn for visual inspection (output socket).
Center The center position of the fitted ellipse as a point (output socket).
Radius1 One ellipse radius (output socket).
Radius2 The other ellipse radius (output socket).
Angle The rotation angle of the ellipse in degrees (output socket).
πΉοΈ Controls
This block has no interactive controls. It runs as soon as valid inputs are provided.
π― Features
Produces a visual overlay showing the fitted ellipse on the input image for easy verification.
Returns geometric parameters (center, two radii, angle) useful for measurements, sorting, or downstream logic.
Works with any valid contour extracted from a prior processing step.
π How to use
Provide an image into
Image Any.Provide the contour you want analyzed into
Contour. Typical contour formats come from contour-finding blocks.Read the visual result from
Imageand numerical values fromCenter,Radius1,Radius2, andAnglefor downstream processing.
βοΈ What it does when run
The block fits an ellipse that minimally encloses the provided contour, draws the ellipse on a copy of the input image, and outputs the image plus numeric ellipse parameters.
π‘ Tips and Tricks
If you need contours from an image, use
Find ContourorFind Objectbefore this block to produce suitableContourinput.Use
Approximate Contourto simplify complex contours before fitting an ellipse β this often yields cleaner and more stable ellipse parameters.Use
Image Threshold,Image Adaptive Threshold, orBluras preprocessing to improve contour extraction on noisy images.Use
Fill Contourto generate solid shapes from edge-based contours when that helps with subsequent processing.Compare shapes using
Minimum CircleorMinimum Rotated Rectanglewhen you want simpler bounding geometry alternatives.Visualize results with
Show Imageor save them withImage Write/Image Loggerfor records and reports.Combine with
Measure Position Distanceif you need distances between ellipse centers or other reference points.
π οΈ Troubleshooting
If the ellipse looks incorrect, ensure the provided
Contouris valid (closed and with sufficient points). Try simplifying the contour withApproximate Contour.If no contour is produced upstream, confirm preprocessing steps such as thresholding or blur are applied so contour-finding blocks can detect shapes.
If returned radii or angle seem unstable between frames, apply smoothing or use memory blocks to stabilize measurements over time.
Last updated
Was this helpful?