From d45e3606e6aded54183c19af053363ce87160435 Mon Sep 17 00:00:00 2001 From: Amaar Quadri Date: Thu, 27 Jul 2023 11:25:26 -0400 Subject: [PATCH] Improve error message --- pyransac3d/sphere.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyransac3d/sphere.py b/pyransac3d/sphere.py index 3f18284..74e5fce 100644 --- a/pyransac3d/sphere.py +++ b/pyransac3d/sphere.py @@ -38,6 +38,9 @@ def fit(self, pts, thresh=0.2, maxIteration=1000): n_points = pts.shape[0] best_inliers = self.inliers + if n_points < 4: + raise ValueError("Point cloud must contain at least 4 points!") + for it in range(maxIteration): # Samples 4 random points