we now have the old LineModel with params (dist, theta), and the new LineModelND with params (origin, direction).

This commit is contained in:
Kevin Keraudren
2015-12-03 22:03:10 +00:00
parent 040a53456d
commit 6a2961fdee
4 changed files with 192 additions and 74 deletions
+2 -2
View File
@@ -10,7 +10,7 @@ the RANSAC algorithm.
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from skimage.measure import LineModel, ransac
from skimage.measure import LineModelND, ransac
np.random.seed(seed=1)
@@ -26,7 +26,7 @@ xyz[::2] += 20 * noise[::2]
xyz[::4] += 100 * noise[::4]
# robustly fit line only using inlier data with RANSAC algorithm
model_robust, inliers = ransac(xyz, LineModel, min_samples=2,
model_robust, inliers = ransac(xyz, LineModelND, min_samples=2,
residual_threshold=1, max_trials=1000)
outliers = inliers == False