Finding contour in using opencv in python
The mode and method parameter of findContours() are enum with integer values.  One can use either the keywords or the integer values assigned to it. This detail can be viewed as an intellisense in visual studio when opencv is included in a project.
Below are the associated values with each enum.
MODES

CV_RETR_EXTERNAL : 0
CV_RETR_LIST : 1
CV_RETR_CCOMP : 2
CV_RETR_TREE : 3 

METHODS

CV_CHAIN_APPROX_NONE : 1
CV_CHAIN_APPROX_SIMPLE : 2
CV_CHAIN_APPROX_TC89_L1 : 3
CV_CHAIN_APPROX_TC89_KCOS : 4
I think,I understood well the function "cv2.findContours(image, mode, method).
But I got this thing contours,hierarchy = cv2.findContours(thresh,2,1) in one of the documents of opencv. I am not getting what is the meaning of 2,1 here and why have they been used. Someone please explain it.