Python OpenCV Box2D
问题 I am trying to call OpenCV function MinAreaRect2 from within python. I use OpenCV 2.4.2 with python 2.7 and numpy 1.6. I went this far : import cv def nda2ipl(arr, dtype=None): return cv.fromarray(np.ascontiguousarray(arr, dtype=dtype)) def min_area_rect2(points): storage = cv.CreateMemStorage() cv_points = nda2ipl(points.reshape((-1, 1, 2))) out = cv.MinAreaRect2(cv_points, storage) return out I can call this function with a ndarray of shape (N x 2). I get this kind of results : ((476.5, 604