cvClose在Python/OpenCV中? [英] cvClose in Python/OpenCV?

查看:116
本文介绍了cvClose在Python/OpenCV中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将其翻译成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 :

  1. http://homepages.inf.ed.ac.uk/rbf/HIPR2/open.htm
  2. http://homepages.inf.ed.ac.uk/rbf/HIPR2/close.htm
  1. http://homepages.inf.ed.ac.uk/rbf/HIPR2/open.htm
  2. 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.

您可以在此处找到示例: https://github.com/abidrahmank/OpenCV2-Python/blob/master/Official_Tutorial_Python_Codes/3_imgproc/morphology_1.py

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中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆