Fix 3D box orientation post-processing

Use arctan2 instead of arctan.
This commit is contained in:
Dmytro Siryk 2020-02-27 00:17:38 +02:00 committed by GitHub
parent 8ef87b4335
commit 46a4ef279c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -15,8 +15,8 @@ def get_alpha(rot):
# bin2_cls[0], bin2_cls[1], bin2_sin, bin2_cos]
# return rot[:, 0]
idx = rot[:, 1] > rot[:, 5]
alpha1 = np.arctan(rot[:, 2] / rot[:, 3]) + (-0.5 * np.pi)
alpha2 = np.arctan(rot[:, 6] / rot[:, 7]) + ( 0.5 * np.pi)
alpha1 = np.arctan2(rot[:, 2], rot[:, 3]) + (-0.5 * np.pi)
alpha2 = np.arctan2(rot[:, 6], rot[:, 7]) + ( 0.5 * np.pi)
return alpha1 * idx + alpha2 * (1 - idx)