(self,image,mode,method)
Version independent find contours routine. Works with OpenCV 2 or 3 or 4.
        Returns modified image (with contours applied), contours list, hierarchy
Version independent find contours routine. Works with OpenCV 2 or 3 or 4.
        Returns modified image (with contours applied), contours list, hierarchy
Version independent find contours routine . Works with OpenCV 2 or 3 or 4 . Returns modified image ( with contours applied ) contours list hierarchy
def findContours(self,image,mode,method):
        '''
        Version independent find contours routine. Works with OpenCV 2 or 3 or 4.
        Returns modified image (with contours applied), contours list, hierarchy
        '''
        ver = int(cv2.__version__.split(".")[0])
        im = image.copy()
        if ver == 2 or ver == 4: #NW fix for OpenCV V4 21st Dec 2018
            contours, hierarchy = cv2.findContours(im,mode,method)
            return im, contours, hierarchy
        else:
            im_cont, contours, hierarchy = cv2.findContours(im,mode,method)
            return im_cont, contours, hierarchy
def findContours ( self , image , mode , method ) : ver = int ( cv2 . __version__ . split ( "." ) [ 0 ] ) im = image . copy ( ) if ver == 2 or ver == 4 : #NW fix for OpenCV V4 21st Dec 2018 contours , hierarchy = cv2 . findContours ( im , mode , method ) return im , contours , hierarchy else : im_cont , contours , hierarchy = cv2 . findContours ( im , mode , method ) return im_cont , contours , hierarchy