Check if watershed succeeded before returning result.
Change API to make computeWatershed methods return the same type as the input images.