i've added possibility of finding closed contours

indexes of closed contours are contained in closedContours vector,
closed contour - contour with maximum one branch (like number 6 or 9)