def getTargetBox(target): minRect = cv2.minAreaRect(target) box = cv2.cv.BoxPoints(minRect) #box = np.int0(box) # convert points to ints return box