Fast plane fitting to many points

后端 未结 4 727
遥遥无期
遥遥无期 2020-12-17 02:49

I\'m looking to fit a plane to a set of ~ 6-10k 3D points. I\'m looking to do this as fast as possible, and accuracy is not the highest concern (frankly the plane can be off

4条回答
  •  一向
    一向 (楼主)
    2020-12-17 03:00

    It looks like griddata might be what you want. The link has an example in it.

    If this doesn't work, maybe check out gridfit on the MATLAB File Exchange. It's made to match a more general case than griddata.

    You probably don't want to be rolling your own surface fitting, as there's several well-documented tools out there.

    Take the example from griddata:

    x = % some values 
    y = % some values
    z = % function values to fit to
    
    ti = % this range should probably be greater than or equal to your x,y test values
    [xq,yq] = meshgrid(ti,ti);
    zq = griddata(x,y,z,xq,yq,'linear'); % NOTE: linear will fit to a plane!
    Plot the gridded data along with the scattered data.
    
    mesh(xq,yq,zq), hold
    plot3(x,y,z,'o'), hold off
    

提交回复
热议问题