I have a huge 3D pointcloud, [3x40e6]. It’s a pointcloud of a flat surface, so it’s more like 2.5D in that sense. I would like to bin the pointcloud into a fixed mesh range so that i can just put it into a 2D matrix and view it with imagesc(mymap).
I did solve this problem, but it takes too long. This is what i got so far. It works fine but takes 10 minutes. It interpolates all kind of jive and i don’t need that.
xlin=linspace(min(xx),max(xx),meshsz*dxxyy);
ylin=linspace(min(yy),max(yy),meshsz);
[X,Y]=meshgrid(xlin,ylin);
disp('+ Flattening (X,Y,Z) information into 2D (X,Y)(Z) mesh..')
%Fit to 2D grid (takes a long time)
Z=griddata(xx,yy,zz,X,Y);%,'cubic');
What i would really want to do is bin all the data from my [3xN] vector into my specific 2D range map. I guess i would have to bin all the values into that map (there are some excellent and fast binning algorithms) but i would also need the specific Z-coordinate scalars in there because that’s what i want to average in each bin.
Thanks!
Solved. Takes 200ms per million points.