added intensity distribution profile for determining whether or not to perform connected component detection