python - How to fit a line through a 3D pointcloud? -
i have cable dropping moving vehicle onto ground. using camera system estimate location rope touches ground in realtime. movement of vehicle , inaccuracy in estimation of location result in point-cloud of touchdown locations. point cloud, i'd obain path of cable lying on ground. i'd achieve in real-time, , i'd fit updated according new data. frequency of new points being added approximately 20 hz, whereas movement speed of vehicle 1 m/s. therefor point cloud rather dense. path followed cable on ground smooth (since cable stiff) , in 3d (x,y,z: ground not flat!).
i've been looking 3d line/spline/curve fit/interpolation. have found promising methods (b-spline fits, lowess -> seems viable, available in 2d, not in 3d). can not find clear explanation on method suited case. fitting method suggest situation?
the current dataset i'm working on generated by:
import numpy np tmax = 10 # s f = 20 # hz v = 2 # m/s samples = tmax*f t = np.linspace(0,tmax, samples) div = 00.[![2][2]][2] x=1*np.sin(t)+t+np.random.uniform(-div,div,samples) y=1*np.cos(t)+t+np.random.uniform(-div,div,samples) z=1*np.sin(t)*np.cos(t)+t+np.random.uniform(-div,div,samples) i manage obtain reasonable results lowess in 2d, can seen in image below, not 3d.
another thing might add data time-stamped. can imagine might benificial in fitting line.


Comments
Post a Comment