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

  1. Provide an image into Image Any.

  2. Provide the contour you want analyzed into Contour. Typical contour formats come from contour-finding blocks.

  3. Read the visual result from Image and numerical values from Center, Radius1, Radius2, and Angle for 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 Contour or Find Object before this block to produce suitable Contour input.

  • Use Approximate Contour to simplify complex contours before fitting an ellipse β€” this often yields cleaner and more stable ellipse parameters.

  • Use Image Threshold, Image Adaptive Threshold, or Blur as preprocessing to improve contour extraction on noisy images.

  • Use Fill Contour to generate solid shapes from edge-based contours when that helps with subsequent processing.

  • Compare shapes using Minimum Circle or Minimum Rotated Rectangle when you want simpler bounding geometry alternatives.

  • Visualize results with Show Image or save them with Image Write / Image Logger for records and reports.

  • Combine with Measure Position Distance if you need distances between ellipse centers or other reference points.

πŸ› οΈ Troubleshooting

  • If the ellipse looks incorrect, ensure the provided Contour is valid (closed and with sufficient points). Try simplifying the contour with Approximate 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?