ellipse-detection icon indicating copy to clipboard operation
ellipse-detection copied to clipboard

Error when running tests

Open ivanursul opened this issue 5 years ago • 3 comments

Hi, I am getting following error:

Traceback (most recent call last):
  File "/Users/ivanursul/git/ellipse-detection/test/test_ellipse_candidate_making.py", line 44, in <module>
    main()
  File "/Users/ivanursul/git/ellipse-detection/test/test_ellipse_candidate_making.py", line 32, in main
    ellipse_cands = ellipse_cand_maker.make(segments)
  File "/Users/ivanursul/git/ellipse-detection/ellipse_detection/ellipse_candidate_maker.py", line 77, in make
    seg_pair_ij = ellipse_ce.estimate(seg_i, seg_j)
  File "/Users/ivanursul/git/ellipse-detection/ellipse_detection/ellipse_center_estimator.py", line 36, in estimate
    midpoints, ra, ma = EllipseCenterEstimator._compute_chord_midpoints(seg_a, seg_b)
  File "/Users/ivanursul/git/ellipse-detection/ellipse_detection/ellipse_center_estimator.py", line 111, in _compute_chord_midpoints
    ha = seg_a.middle_point
  File "/Users/ivanursul/git/ellipse-detection/ellipse_detection/segment.py", line 47, in middle_point
    return self._points[self._points.shape[0] / 2]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices

Do you know what can be the problem?

ivanursul avatar Sep 22 '18 08:09 ivanursul

In Python 3

    return self._points[self._points.shape[0] / 2]

creates an error because the division of two integers is a float.

You'll need to change the line to something like

    return self._points[self._points.shape[0] // 2]

which will need to be done in a few places in this library.

cjekel avatar Jan 13 '20 15:01 cjekel

I did this, but now I have different errors, ellipse estimator. Does this library work on your machine?

VCasecnikovs avatar Oct 03 '20 15:10 VCasecnikovs

@VCasecnikovs I don't remember. I can't seem to find a local copy on my machine, and I don't have a fork on github...

Maybe check the network graph, there were a couple up commits from others https://github.com/horiken4/ellipse-detection/network that could fix issues.

cjekel avatar Oct 03 '20 22:10 cjekel