Merged LineModel3D with LineModel in order to form a unified model.

- model.params holds the legacy params (2D representation),
 - model.new_params holds the true ND line representation.

The proposed LineModel behaves identically as the implementation in master in the 2D case. In the 3D case, it behaves similarly to the previously proposed LineModel3D, as long as new_params is used instead of params. This implementation thus takes advantage that the 2D case is a special case of the ND general model.
This commit is contained in:
Kevin Keraudren
2015-12-02 08:58:16 +00:00
parent 5bb206233d
commit 040a53456d
4 changed files with 122 additions and 137 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 LineModel3D, ransac
from skimage.measure import LineModel, 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, LineModel3D, min_samples=2,
model_robust, inliers = ransac(xyz, LineModel, min_samples=2,
residual_threshold=1, max_trials=1000)
outliers = inliers == False