An image processing method for structured light profiling includes
sampling an image of a structured light pattern to obtain an intensity
distribution, selecting a number of sets of sampled points from the
intensity distribution. Each of the respective sets includes a number of
sampled points. The image processing method further includes fitting each
of the sets of sampled points to a respective distribution function and
filtering the distribution functions to select a representative
distribution function for the intensity distribution.