Pedometer method based on adaptive multilevel thresholding