Reduces processing time with black pixel condition and reducing number of segments to be stepped through