extract and draw contours