mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-13 17:45:20 +08:00
Add example for ransac and geometric transforms
This commit is contained in:
@@ -603,6 +603,23 @@ def ransac(data, model_class, min_samples, residual_threshold,
|
||||
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
|
||||
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49])
|
||||
|
||||
Robustly estimate geometric transformation:
|
||||
|
||||
>>> from skimage.transform import SimilarityTransform
|
||||
>>> src = 100 * np.random.random((50, 2))
|
||||
>>> model0 = SimilarityTransform(scale=0.5, rotation=1,
|
||||
... translation=(10, 20))
|
||||
>>> dst = model0(src)
|
||||
>>> dst[0] = (10000, 10000)
|
||||
>>> dst[1] = (-100, 100)
|
||||
>>> dst[2] = (50, 50)
|
||||
>>> model, inliers = ransac((src, dst), SimilarityTransform, 2, 10)
|
||||
>>> inliers
|
||||
array([ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
|
||||
37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49])
|
||||
|
||||
|
||||
"""
|
||||
|
||||
best_model = None
|
||||
|
||||
Reference in New Issue
Block a user