You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.
It seems that the pipeline uses the following direction_coverage function for the road analysis.
I found two issues:
first n_bins is 25 by default, but should be 35, so it's 36 bins in total. The calculated data is thus split differently than the comment indicates
second, the code uses np.arccos(dot_product) for the calculation of the angle. However, np.arccos produces values in the range [0, π] (i.e. [0, 180] degrees). In other words, this function calculates the smallest angle between THE_NORTH and the segment, independent of the side.
I suggest the following code to fix it (note, it uses numpy throughout and is thus faster than the previous method).
defget_thetas(xs, ys, skip=1):
"""Transform x,y coordinates of points and return each segment's offset from x-axis in the range [np.pi, np.pi]"""xdiffs=xs[1:] -xs[0:-1]
ydiffs=ys[1:] -ys[0:-1]
thetas=np.arctan2(ydiffs, xdiffs)
returnthetasdefdir_cov(the_test, n_bins=36):
np_arr=np.array(the_test)
thetas, kappas=get_thetas(np_arr[:,0], np_arr[:,1])
coverage_buckets=np.linspace(-np.pi, np.pi, num=n_bins)
covered_elements=set(np.digitize(thetas, coverage_buckets))
returnlen(covered_elements) /len(coverage_buckets)
According to my tests on the data, this behaviour should be correct.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It seems that the pipeline uses the following direction_coverage function for the road analysis.
I found two issues:
n_bins
is 25 by default, but should be 35, so it's 36 bins in total. The calculated data is thus split differently than the comment indicatesnp.arccos(dot_product)
for the calculation of the angle. However,np.arccos
produces values in the range [0, π] (i.e. [0, 180] degrees). In other words, this function calculates the smallest angle betweenTHE_NORTH
and the segment, independent of the side.I suggest the following code to fix it (note, it uses numpy throughout and is thus faster than the previous method).
According to my tests on the data, this behaviour should be correct.
The text was updated successfully, but these errors were encountered: