From 558e70889f57595c0174a7c901928447b6f8e9cd Mon Sep 17 00:00:00 2001 From: farqis Date: Mon, 7 Nov 2022 06:15:11 +0100 Subject: [PATCH 1/2] Remove dependency on scipy. --- imutils/perspective.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imutils/perspective.py b/imutils/perspective.py index 48e1890..a65afa2 100644 --- a/imutils/perspective.py +++ b/imutils/perspective.py @@ -26,7 +26,7 @@ def order_points(pts): # top-left and right-most points; by the Pythagorean # theorem, the point with the largest distance will be # our bottom-right point - D = dist.cdist(tl[np.newaxis], rightMost, "euclidean")[0] + D = np.linalg.norm(np.subtract(tl[np.newaxis], rightMost), axis=1) (br, tr) = rightMost[np.argsort(D)[::-1], :] # return the coordinates in top-left, top-right, From b7981b015f5380396803e0fc21f7d120f4b4c1b3 Mon Sep 17 00:00:00 2001 From: farqis Date: Mon, 7 Nov 2022 09:29:38 +0100 Subject: [PATCH 2/2] Remove imports and references to scipy --- README.md | 2 +- imutils/perspective.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d3f251..6ab0cb0 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ For more information, along with a detailed code review check out the following - [http://www.pyimagesearch.com/2015/08/10/checking-your-opencv-version-using-python/](http://www.pyimagesearch.com/2015/08/10/checking-your-opencv-version-using-python/) ## Installation -Provided you already have NumPy, SciPy, Matplotlib, and OpenCV already installed, the `imutils` package is completely `pip`-installable: +Provided you already have NumPy, Matplotlib, and OpenCV already installed, the `imutils` package is completely `pip`-installable:
$ pip install imutils
diff --git a/imutils/perspective.py b/imutils/perspective.py index a65afa2..4c419e7 100644 --- a/imutils/perspective.py +++ b/imutils/perspective.py @@ -2,7 +2,6 @@ # website: http://www.pyimagesearch.com # import the necessary packages -from scipy.spatial import distance as dist import numpy as np import cv2