def erode(cv_image, n_times=1): dst = cv.cvCloneImage(cv_image) cv.cvErode(cv_img, dst, None, n_times) return dst
def morpho_open(cv_image, n_times=1): dst = cv.cvCloneImage(cv_image) dst2 = cv.cvCloneImage(cv_image) cv.cvErode(cv_image, dst, None, n_times) cv.cvDilate(dst, dst2, None, n_times) return dst2