def get_topdown_quad(image, src):
# src and dst points
src = _order_points(src)
(max_width,max_height) = _max_width_height(src)
dst = _topdown_points(max_width, max_height)
# warp perspective
matrix = cv2.getPerspectiveTransform(src, dst)
warped = cv2.warpPerspective(image, matrix, _max_width_height(src))
return warped
评论列表
文章目录