A model of contour extraction including multiple scales, flexible inhibition and attention