This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, :] |