We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In the function :
def _corners2rotatedbbox(corners): centre = np.mean(np.array(corners), 0) theta = calc_bearing(corners[0], corners[1]) rotation = np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]]) out_points = np.matmul(corners - centre, rotation) + centre x, y = list(out_points[0,:]) w, h = list(out_points[2, :] - out_points[0, :]) return [x, y, w, h, theta]
width and height are computed like this : w, h = list(out_points[2, :] - out_points[0, :])
It is ok to just take absolute value because width and height has to be positive. (see sketch1)
So, you can just change it to : w, h = list(out_points[2, :] - out_points[0, :]) w= math.fabs(w) h=math.fabs(h) return [x, y, w, h, theta]
Still, I think this: w, h = list(out_points[2, :] - out_points[0, :]) is not correct way to compute width and height (see my schetch2).
I think that is ok just when box is not roatated. In rotated case, it has to be : w= math.distance(point1,point2) h=math.distance(point2,point3)
Pls, tell me what do you think about this? BR
The text was updated successfully, but these errors were encountered:
Thanks, we will look into this and let you know.
Sorry, something went wrong.
No branches or pull requests
In the function :
def _corners2rotatedbbox(corners):
centre = np.mean(np.array(corners), 0)
theta = calc_bearing(corners[0], corners[1])
rotation = np.array([[np.cos(theta), -np.sin(theta)],
[np.sin(theta), np.cos(theta)]])
out_points = np.matmul(corners - centre, rotation) + centre
x, y = list(out_points[0,:])
w, h = list(out_points[2, :] - out_points[0, :])
return [x, y, w, h, theta]
width and height are computed like this : w, h = list(out_points[2, :] - out_points[0, :])
It is ok to just take absolute value because width and height has to be positive.
(see sketch1)
So, you can just change it to :
w, h = list(out_points[2, :] - out_points[0, :])
w= math.fabs(w)
h=math.fabs(h)
return [x, y, w, h, theta]
Still, I think this:
w, h = list(out_points[2, :] - out_points[0, :])
is not correct way to compute width and height (see my schetch2).
I think that is ok just when box is not roatated. In rotated case, it has to be :
w= math.distance(point1,point2)
h=math.distance(point2,point3)
Pls, tell me what do you think about this?
BR
The text was updated successfully, but these errors were encountered: