Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

为何 poly2obb 函数中要对 cv2.minAreaRect 返回的角度取负号? #63

Open
YimianDai opened this issue Oct 21, 2022 · 0 comments

Comments

@YimianDai
Copy link

请问一下,为何 JDet 的 poly2obb 函数会对 cv2.minAreaRect 返回的角度取负号(angle = -angleangle = -90 - angle)?

    for poly in polys_np:
        (x, y), (w, h), angle = cv2.minAreaRect(poly)
        if w >= h:
            angle = -angle
        else:
            w, h = h, w
            angle = -90 - angle

自己推理了一下,感觉没必要取负号。作为佐证,贴一段 MMRotate 的 poly2obb_np_le90 函数,相同功能,但没有取负号。

    rbbox = cv2.minAreaRect(bboxps)
    x, y, w, h, a = rbbox[0][0], rbbox[0][1], rbbox[1][0], rbbox[1][1], rbbox[2]
    if w < h:
        w, h = h, w
        a += np.pi / 2

请大佬不吝赐教~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant