前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Fill my holes_imfilter函数matlab

Fill my holes_imfilter函数matlab

作者头像
全栈程序员站长
发布2022-09-30 11:01:57
1790
发布2022-09-30 11:01:57
举报
文章被收录于专栏:全栈程序员必看

大家好,又见面了,我是你们的朋友全栈君。

Syntax

BW2 = imfill(BW)

[BW2,locations] = imfill(BW)

BW2 = imfill(BW,locations)

BW2 = imfill(BW,’holes’)

I2 = imfill(I)

BW2 = imfill(BW,locations,conn)

Description

BW2 = imfill(BW) displays the binary image BW onthe screen and lets you define the region to fill by selecting pointsinteractively by using the mouse. To use this interactive syntax, BW mustbe a 2-D image. Press Backspace or Delete toremove the previously selected point. A shift-click, right-click,or double-click selects a final point and starts the fill operation.Pressing Return finishes the selection withoutadding a point.

[BW2,locations] = imfill(BW) returns thelocations of points selected interactively in locations. locations isa vector of linear indices into the input image. To use this interactivesyntax, BW must be a 2-D image.

BW2 = imfill(BW,locations) performs a flood-filloperation on background pixels of the binary image BW,starting from the points specified in locations.If locations is a P-by-1 vector, it contains thelinear indices of the starting locations. If locations isa P-by-ndims(BW) matrix, eachrow contains the array indices of one of the starting locations.

BW2 = imfill(BW,’holes’) fills holes inthe binary image BW. A hole is a set of backgroundpixels that cannot be reached by filling in the background from theedge of the image.

I2 = imfill(I) fills holes in the grayscaleimage I. In this syntax, a hole is defined as anarea of dark pixels surrounded by lighter pixels.

BW2 = imfill(BW,locations,conn) fills thearea defined by locations, where conn specifiesthe connectivity. conn can have any of the followingscalar values.

Value

Meaning

Two-dimensionalconnectivities

4

4-connected neighborhood

8

8-connected neighborhood

Three-dimensionalconnectivities

6

6-connected neighborhood

18

18-connected neighborhood

26

26-connected neighborhood

Connectivity can be defined in a more general way for any dimensionby using for conn a 3-by-3-by- … -by-3 matrixof 0’s and 1’s. The 1-valuedelements define neighborhood locations relative to the center elementof conn. Note that conn mustbe symmetric about its center element.

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/194266.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年9月13日 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档