imagej / imagej-ops

ImageJ Ops: "Write once, run anywhere" image processing
https://imagej.net/libs/imagej-ops
BSD 2-Clause "Simplified" License
89 stars 42 forks source link

Fitting Ellipse #452

Closed tibuch closed 8 years ago

tibuch commented 8 years ago

I would like to verify major- and minor-axis features (geometric 2d) https://github.com/imagej/imagej-ops/issues/449.

My understanding of major- and minor-axis is, that we fit an ellipse to the given shape and take the major- and minor-axis of the ellipse.

Since I am trying to verify the numbers I am looking for implementations in Matlab/python.

The problem is, that I found a lot of different results. All are more or less similar (+/- 5).

What I found out about the current ops-implementation:

What I found about minor- and major-axis:

Questions:

  1. Keep our implementation and assume correctness?
  2. Replace our implementation?
dietzc commented 8 years ago

@haesleinhuepf @bnorthan @ctrueden @stelfrich do you guys have any opinion on this?

dietzc commented 8 years ago

If I understand correctly, we currently have the same implementation as IJ1 (just on Polygons not on pixels at the moment) and this one implements the mentioned papers? If our implementation is correct, I'd leave it as is until someone comes up with good reasons why the implementation is not good enough.

tibuch commented 8 years ago

I would replace the current polygon-based implementation with an implementation similar to the non-iterative ellipse fit and keep the current implementation only for pixel-based ellipse fitting.

tibuch commented 8 years ago

I found this implementation with provided paper: https://pdfs.semanticscholar.org/090d/25f94cb021bdd3400a2f547f989a6a5e07ec.pdf

This looks fast and robust.

tibuch commented 8 years ago

I was able to verify the results of minor-major-axis in the 2D geometric featureset.

  1. Keep our implementation and assume correctness?

Our implementation is correct.

The fitting ellipse used in minor-major-axis fits based on area and not like the proposed algorithm to a point set.

Fitting ellipse to point set is part of this discussion: http://forum.imagej.net/t/implementation-plan-for-imglib2-rois-2d/2531/1