Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default ranges in hough_line now have integer stepsizes #1437

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hohlraum
Copy link

Addresses issue #1433.

Default theta runs in the range [-pi/2, pi/2) in 1deg steps.
Default distances runs in the range [-diag, +diag) in 1 px steps, where diag is the length of the image diagonal.

@JDWarner
Copy link
Contributor

It appears the previous behavior, which landed between integer values, was hard coded into two tests. Travis is failing because of these:

======================================================================
FAIL: skimage.transform.tests.test_hough_transform.test_hough_line
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/venv/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/scikit-image/scikit-image/skimage/transform/tests/test_hough_transform.py", line 30, in test_hough_line
    assert_almost_equal(dist, 80.723, 1)
  File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 468, in assert_almost_equal
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 1 decimals
 ACTUAL: 80.0
 DESIRED: 80.723
======================================================================
FAIL: skimage.transform.tests.test_hough_transform.test_hough_line_peaks
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/venv/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/home/travis/build/scikit-image/scikit-image/skimage/transform/tests/test_hough_transform.py", line 75, in test_hough_line_peaks
    assert_almost_equal(dist[0], 80.723, 1)
  File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 468, in assert_almost_equal
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 1 decimals
 ACTUAL: 81.0
 DESIRED: 80.723

I'm in favor of modifying the tests. Anyone else from @scikit-image/core want to chime in?

@blink1073
Copy link
Member

👍 for updating what amounts to a regression test.

@bennlich
Copy link
Contributor

bennlich commented Oct 8, 2015

It seems strange that the two tests don't produce the same number. Both are run on the same image: compare L21-L24 with L67-L69.

Base automatically changed from master to main February 18, 2021 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants