Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,11 +40,11 @@ def find_tip(points, convex_hull):
|
|
40 |
|
41 |
def find_tail(points, tip):
|
42 |
# Convert the tip and points to numpy arrays
|
43 |
-
tip = np.array(
|
44 |
points = np.array(points, dtype=np.int32)
|
45 |
|
46 |
# Find the index of the farthest point
|
47 |
-
distances = cv2.pointPolygonTest(points, tip, True)
|
48 |
|
49 |
if distances is not None:
|
50 |
farthest_index = np.argmax(distances)
|
|
|
40 |
|
41 |
def find_tail(points, tip):
|
42 |
# Convert the tip and points to numpy arrays
|
43 |
+
tip = np.array(tip, dtype=np.float32)
|
44 |
points = np.array(points, dtype=np.int32)
|
45 |
|
46 |
# Find the index of the farthest point
|
47 |
+
distances = cv2.pointPolygonTest(points, tuple(tip), True)
|
48 |
|
49 |
if distances is not None:
|
50 |
farthest_index = np.argmax(distances)
|