detecting a contour or curvature