mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-18 12:40:14 +08:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user