-
Notifications
You must be signed in to change notification settings - Fork 21
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
Clean up the ruler module and bring it out of a prototype state #38
Comments
One unit test would be to write a function that generates "rounded rectangle" images, similar to the example in the paper, with an arbitrary resolution and rotation angle, and check that it gives (roughly) the same answer regardless of resolution (sufficiently high), rotation angle, or whether the image is inverted (for open–close). We could also have a few "hard-coded" tests for simple structures, similar to what Wenchao used when debugging. |
Shall we add type hints only for user-facing functions or for all functions? In addition, the most important user-facing function, i.e.,
These tests are in the notebook, but the structures are not "hard-coded", but generated by a few lines of code.
Some tests with different resolutions are as follows. The Python function for generating these rounded squares is as follows, which simply stitches several geometric objects and then binarizes the entire pattern.
|
It looks like |
In my latest version that has not been pulled into the master branch, |
Thanks to @mfschubert for sending me his test on When applied to the discs, the comparison between When applied to the squares, the comparison between We can see that in most cases, Apart from the details of morphological operations, |
From an API design point of view, it's probably more reasonable to always return both numbers. The user can ignore one if they don't need it. An API whose number of return values varies is more complex to design around. |
It would also make the code more concise. However, in most cases, users may only want one number. Always calculating both numbers may not be necessary and may sound less efficient. Shall we sacrifice the efficiency? |
That's fair. Another option would be to always return a length-2 tuple but have the un-computed quantities be |
Style guide: https://google.github.io/styleguide/pyguide.html |
In the latest version of If the morphological functions in |
This is not correct. Apart from the implementation of morphological functions and the criterion of non-interfacial solid pixels, final results are also influenced by details of binary search and shapes of kernels with various sizes. In |
The
ruler
module should be cleaned up and reorganized in order to improve its usability.The text was updated successfully, but these errors were encountered: