Added some options to prevent duplicate extraction of contours