前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >matlab灰度化处理函数_matlab中imfinfo的用法

matlab灰度化处理函数_matlab中imfinfo的用法

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

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

Matlab infl()依次使用函数IM=imreconstruct(marker,mask)

有关算法的详细信息,请参见

Soille,P.,《形态图像分析:原理和应用》,Springer Verlag,1999年,第208-209页。第6.3.7节“填充孔”部分import numpy as np

from skimage.morphology import reconstruction

import matplotlib.pyplot as plt

from skimage.io import imread, imsave

# Use the matlab reference Soille, P., Morphological Image Analysis: Principles and Applications, Springer-Verlag, 1999, pp. 208-209.

# 6.3.7 Fillhole

# The holes of a binary image correspond to the set of its regional minima which

# are not connected to the image border. This definition holds for grey scale

# images. Hence, filling the holes of a grey scale image comes down to remove

# all minima which are not connected to the image border, or, equivalently,

# impose the set of minima which are connected to the image border. The

# marker image 1m used in the morphological reconstruction by erosion is set

# to the maximum image value except along its border where the values of the

# original image are kept:

img = imread(“tyre.jpg”)

seed = np.ones_like(img)*255

img[ : ,0] = 0

img[ : ,-1] = 0

img[ 0 ,:] = 0

img[ -1 ,:] = 0

seed[ : ,0] = 0

seed[ : ,-1] = 0

seed[ 0 ,:] = 0

seed[ -1 ,:] = 0

fill = reconstruction(seed, img, method=’erosion’)

f, (ax0, ax1) = plt.subplots(1, 2,

subplot_kw={‘xticks’: [], ‘yticks’: []},

figsize=(12, 8))

ax0.imshow(img)

ax1.imshow(fill)

plt.show()

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

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

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

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

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

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

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