Added a parameter to specify a detection distance related to the stddev of the surface