Split-based automatic thresholding

Could you please refer to a software or an open source library that can execute a Split-based automatic thresholding of Sentinel-1A-derived flood inundation image in an arid area (i.e., to differentiate between flood and non-flood pixels).