contour detection flagmaster