Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses issue #5.
Slicing
image.shape
with[0:1]
only selects the first dimension. So all four elements of thecorners
array were always scaled by the first dimension of the image, resulting in a potentially incorrect value formaxRadius
depending on thecenter
, which also leads to different image sizes for the polar image. Slicing with[0:2]
uses both image dimensions and creates accuratecorners
values and fixes these issues.I created a test,
TestPolarConversion.test_final_radius()
, that fails with the old slicing and succeeds with the new. With this particular image, thecenter
used intest_default
([401, 365]
) leads to the same value independent of slicing, so I used an arbitrarycenter
of[350, 365]
instead.I noticed all of the tests were failing because the "horizontalLines.png" and "checkerboard.png" images are not included in the repository, so I commented those out.
Also, the indentation of the main function call in "test_polarTransform.py" was indented under the
TestPointConversion
class, so I don't think all of the tests were running. I changed that as well.Let me know if you see any issues here!