问题描述
我无法将其翻译成Python/OpenCV.可以请帮助...
I couldnot translate this into Python/OpenCV. Can s.o. please help…
cvClose(mask, mask, se21);
cvOpen(mask, mask, se11);
推荐答案
希望您使用的是OpenCV-Python的新cv2接口.
Hope you are using new cv2 interface of OpenCV-Python.
如果我的假设正确,则为morphological opening and closing operations.
If my assumption is correct, this is morphological opening and closing operations.
您可以将 cv2.morphologyEx
函数用于并带有相应的标志,例如MORPH_OPEN, MORPH_CLOSE
等.
闭合是图像的扩张,然后是侵蚀,用于去除白色物体内部的小黑洞.
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 :
- http://homepages.inf.ed.ac.uk/rbf/HIPR2/open.htm
- http://homepages.inf.ed.ac.uk/rbf/HIPR2/close.htm
或者,您可以为此使用 cv2.erode and cv2.dilate
函数
Alternatively you can use cv2.erode and cv2.dilate
functions 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
这篇关于cvClose在Python/OpenCV中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!