Auto Thresholding

plateau finding on the number of connected components