add otsu auto threshold

Add an option to determine automatically  a threshold (with Otsu algorithm)