-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
update RANSAC, ratio of inliers #2415
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2415 +/- ##
=========================================
+ Coverage 86.04% 90.7% +4.66%
=========================================
Files 337 304 -33
Lines 27050 21536 -5514
Branches 0 1861 +1861
=========================================
- Hits 23274 19534 -3740
+ Misses 3776 1660 -2116
- Partials 0 342 +342
Continue to review full report at Codecov.
|
skimage/measure/fit.py
Outdated
| N points with ``(x, y)`` coordinates, respectively. | ||
| init_params : tuple of 3 values, optional | ||
| (x_center, y_center, r) is initial guess of parameters. | ||
| If they are not specified initial guess use a circle model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If None, use a circle with parameters based on mean values.
skimage/measure/fit.py
Outdated
| N points with ``(x, y)`` coordinates, respectively. | ||
| init_params : tuple of 5 values, optional | ||
| (x_center, y_center, a, b, theta) is initial guess of parameters. | ||
| If they are not specified initial guess use a circle model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If None, use a circle with parameters based on mean values.
skimage/measure/fit.py
Outdated
| A[1, :] = -(y - yc) / d | ||
| # same for all iterations, so not changed in each iteration | ||
| #A[2, :] = -1 | ||
| # A[2, :] = -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this commented line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no clue, it was there already before... I will remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Please rewrite the comment as
# A[2, :] = -1 is the same for all iterations, not re-affected.
skimage/measure/fit.py
Outdated
| xc0 = x.mean() | ||
| yc0 = y.mean() | ||
| r0 = dist(xc0, yc0).mean() | ||
| init_params = (xc0, yc0, r0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concatenate these 4 lines into a single one.
skimage/measure/fit.py
Outdated
| if not (0 < min_samples <= 1): | ||
| raise ValueError("`min_samples` as ration must be in range (0, 1)") | ||
| min_samples = int(min_samples * len(data)) | ||
| if min_samples <= 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is inconsistent with the docstring (zero included).
skimage/measure/fit.py
Outdated
| by `np.random`. | ||
| init_inliers : [list, tuple of] (N) array of bool or None, optional | ||
| Initial samples selection for model estimation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
estimation.
|
Can you squash your commits and then edit the commit message to be explicit, ie |
f6f4105 to
ed06419
Compare
|
squash commits is nice feature I have not used before... :) |
skimage/measure/fit.py
Outdated
| random_state = check_random_state(random_state) | ||
|
|
||
| if isinstance(min_samples, float): | ||
| if not (0 < min_samples <= 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 <= min_samples <= 1
|
looks correct to me, but I'm not using this feature. Anyone to review this PR? |
|
Does anyone have an idea why it fails with "The build has been terminated" even on my personal branch Borda / scikit-image it passes? |
|
@Borda I guess it just got overwhelmed :). |
674160e to
5c62f8e
Compare
|
I have some concerns regarding this contribution:
|
|
@ahojnnes regarding the 2) you are talking about description of |
|
@Borda I mean to extend the doc string for |
|
it seems it crashs on building doc for |
|
random failures due to travis. No worries. |
0fe32ff to
cec7b4e
Compare
stefanv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the diff, I am a bit confused how it implements the description from the PR?
However, these changes also seem fine to me, so no objection; just please update the commit message when merging the PR.
skimage/measure/tests/test_fit.py
Outdated
| @@ -1,4 +1,5 @@ | |||
| import numpy as np | |||
| from scipy import spatial | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is spatial added here?
cec7b4e to
76da430
Compare
|
@sciunto it seems that there are some errors which came with merge upstream/master
|
ee73666 to
d8e16c8
Compare
|
I think it's time to let this PR go 😄 . |
|
May I ask what happens with Travis CI, I am not able to build even the master... |
|
@Borda your |
|
ok, this seems to be solved... |
|
I see I was thinking about correcting these test with correcting the output and set |
|
From what I understood, it is not just a matter of whitespaces - see https://github.com/numpy/numpy/blob/master/doc/release/1.14.0-notes.rst#many-changes-to-array-printing-disableable-with-the-new-legacy-printing-mode . Floating point precision could be different, |
|
yes, I noticed it also while I tried to solve it in #2938, but the difficulty comes with the configurations because in some configurations seems to be used the old formatting... |
d8e16c8 to
217969b
Compare
# Conflicts: # .coveragerc # DEPENDS.txt # TASKS.txt # appveyor.yml # bento.info # doc/ext/sphinx_gallery/LICENSE # doc/ext/sphinx_gallery/README.txt # doc/ext/sphinx_gallery/__init__.py # doc/ext/sphinx_gallery/_static/broken_example.png # doc/ext/sphinx_gallery/_static/broken_stamp.svg # doc/ext/sphinx_gallery/_static/gallery.css # doc/ext/sphinx_gallery/_static/no_image.png # doc/ext/sphinx_gallery/backreferences.py # doc/ext/sphinx_gallery/docs_resolv.py # doc/ext/sphinx_gallery/downloads.py # doc/ext/sphinx_gallery/gen_gallery.py # doc/ext/sphinx_gallery/gen_rst.py # doc/ext/sphinx_gallery/notebook.py # doc/ext/sphinx_gallery/py_source_parser.py # optional_requirements.txt # skimage/io/_plugins/freeimage_plugin.ini # skimage/io/_plugins/freeimage_plugin.py # skimage/util/montage.py # tools/appveyor/install.ps1 # tools/appveyor/run_with_env.cmd
|
It seems that I lost the commits... :-/ |
Description
Adding option to use some init parameters for model fitting and RANDSAC initial inliers, eg, you have some a priory knowledge, you do not want to use some default parameters.
NOTE: this is copy of last version PR #2371 (because I had problems with rebase and made some mistakes)
Checklist