Kitti data does not have scanline information
godspeed1989 opened this issue · 11 comments
Hi Vincent. It's a wonderful work!
I want to use your code to segment Kitti 3d object detection velodyne data. But this data just have XYZI information rather than XYZIR. I notice the scanlinerun
node uses the scan line information.
My question is how can I obtain scanline information?
Thanks
@godspeed1989 Hi, the ring can be calculated in this formula(latex code):
$$ring =\arcsin{\frac{z}{\sqrt{x^2+y^2+z^2}}}$ $
And if you have calibrate the velodyen points into camera coordinates, pay attention that the z
should be modify to y
.
I think this formula calculating a continous pitch angle.
How can I map this value into discrete sensor_model_
?
@godspeed1989 Hi, have you successfully used the code to segment the kitti dataset?
Not yet
Hi!
KITTI data are sorted. The points are recorded in an orderly manner, the points of one ring follow the points of another in the direction of laser rotation. Rings can be separated by tracing the change of the quadrant :
Python code example:
def get_quadrant(point):
res = 0
x = point[0]
y = point[1]
if x > 0 and y >= 0:
res = 1
elif x <= 0 and y > 0:
res = 2
elif x < 0 and y <= 0:
res = 3
elif x >= 0 and y < 0:
res = 4
return res
def add_ring_info(scan_points):
num_of_points = scan_points.shape[0]
scan_points = np.hstack([scan_points,
np.zeros((num_of_points, 1))])
velodyne_rings_count = 64
previous_quadrant = 0
ring = 0
for num in range(num_of_points-1, -1, -1):
quadrant = get_quadrant(scan_points[num])
if quadrant == 4 and previous_quadrant == 1 and ring < velodyne_rings_count-1:
ring += 1
scan_points[num, 4] = ring
previous_quadrant = quadrant
return scan_points
scan_points = XYZI_velodyne_data
scan_points = add_ring_info(scan_points)
def get_quadrant(point)
hi, thank you for your share, but there have some issue when I use this way to get the ring,
I find these function cost a lot time and output frequency is nearly 5HZ(when I don't use this ring and only output x,y,z,intensity, the frequency is nearly 10HZ)
can you tell me how to increase this frenqucy? thank you for your reply !
Hi! Try to convert KITTI data to .bag file. Then use this .bag file.
Hi! Try to convert KITTI data to .bag file. Then use this .bag file.
is it mean I can't use this function to add ring online?
Hi! Try to convert KITTI data to .bag file. Then use this .bag file.
is it mean I can't use this function to add ring online?
May be, c++ implementation help you.
OK , I'll try and test your advice, Thank you!