PyDIP - use of MeasurementTool.Measure #137
-
Hello all ! I really like using PyDIP, though the documentation is sometimes difficult to find. For example, after segmentation (of a 2D image), I want to approximate each segment by an ellipsoid (mainly with minor and major axes). The, I did: props = dip.MeasurementTool.Measure(lbl, features=['DimensionsEllipsoid']) But I cannot figure out what the results returned ? Is this feature the right one to use ? https://diplib.org/diplib-docs/features.html#binary_moments_DimensionsEllipsoid Thank you for your help |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It's the length of the small and large diameters of the best fit ellipsoid, in physical units if they were attached to the image (and the two dimensions have the same units), otherwise in pixels. If you also want the angle of ellipsoid, use
|
Beta Was this translation helpful? Give feedback.
It's the length of the small and large diameters of the best fit ellipsoid, in physical units if they were attached to the image (and the two dimensions have the same units), otherwise in pixels.
If you also want the angle of ellipsoid, use
'MajorAxes'
, which is the eigenvector matrix (4 values in 2D). So you get the two unit vectors corresponding to each of the two axes of the ellipsoid. Draw those vectors, each with a length corresponding to half of'DimensionsEllipsoid'
, to see the two main radii of the ellipsoid.'Center'
is the centroid of the object, and thus also of the ellipsoid.