added mean-shift algorithm for robust lowest point detection