Opencv之getStructuringElement

本文详细介绍了OpenCV中的getStructuringElement函数,包括其功能、参数和使用方法。函数主要用于创建形态学操作所需的结构元素,如膨胀和腐蚀。参数包括结构元素的形状、大小和锚点位置。返回的结构元素可应用于erode、dilate和morphologyEx等函数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

//函数原型

CV_EXPORTS_W Mat getStructuringElement(int shape, Size ksize, Point anchor = Point(-1,-1));

1、函数功能
      returns a structuring element of the specified size and shape for morphological operations.
      返回用于形态学操作的指定大小和形状的结构元素。
2、函数参数
(1)shape:Element shape that could be one of #MorphShapes
    结构元素形状可以是MorphShapes中的一个。

//! shape of the structuring element
enum MorphShapes {
    MORPH_RECT    = 0, //结构元素是矩形的
    MORPH_CROSS   = 1, //结构元素是十字形的       
    MORPH_ELLIPSE = 2 //结构元素是椭圆形的
};

(2)ksize:Size of the structuring element.
         结构元素的大小。
(3)anchor:Anchor position within the element. The default value \f$(-1, -1)\f$ means that the anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor position. In other cases the anchor 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值