Automatic thresholding from the gradients of region boundaries. (20th September 2016)