Skip to content

Instantly share code, notes, and snippets.

View AlphaNext's full-sized avatar
🧧
Focusing

AlphaNext

🧧
Focusing
  • Beijing
View GitHub Profile
@flashlib
flashlib / order_coordinates.py
Last active July 23, 2023 17:19
Ordering coordinates clockwise with Python and OpenCV
from imutils import perspective
import numpy as np
def order_points_new(pts):
# sort the points based on their x-coordinates
xSorted = pts[np.argsort(pts[:, 0]), :]
# grab the left-most and right-most points from the sorted
# x-roodinate points
leftMost = xSorted[:2, :]