Working otsu's threshold