I couldnot translate this into Python/OpenCV. Can s.o. please help…
cvClose(mask, mask, se21);
cvOpen(mask, mask, se11);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hope you are using new cv2 interface of OpenCV-Python.
If my assumption is correct, this is
morphological opening and closing operations.You can use
cv2.morphologyExfunction for this, with corresponding flags, likeMORPH_OPEN, MORPH_CLOSEetc.Closing is dilation of image followed by erosion and is used to remove small black holes inside white bodies.
Opening is erosion of image followed by dilation and is used to remove small white blobs or points in an image.
More about Opening and Closing :
Alternatively you can use
cv2.erode and cv2.dilatefunctions for this.You can find an example here : https://github.com/abidrahmank/OpenCV2-Python/blob/master/Official_Tutorial_Python_Codes/3_imgproc/morphology_1.py