色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁技術文章
文章詳情頁

Python庫skimage繪制二值圖像代碼實例

瀏覽:24日期:2022-07-30 13:50:38

二值圖像的凸殼指的是包圍輸入二值圖像白色區域的最小的凸多邊形的像素集合。

skimage中的函數

from skimage.morphology import convex_hull_imagechull = convex_hull_image(image)

完整代碼:

'''===========Convex Hull===========The convex hull of a binary image is the set of pixels included in thesmallest convex polygon that surround all white pixels in the input.A good overview of the algorithm is given on `Steve Eddin’s blog<http://blogs.mathworks.com/steve/2011/10/04/binary-image-convex-hull-algorithm-notes/>`__.'''import matplotlib.pyplot as pltfrom skimage.morphology import convex_hull_imagefrom skimage import data, img_as_floatfrom skimage.util import invert# The original image is inverted as the object must be white.image = invert(data.horse())chull = convex_hull_image(image)fig, axes = plt.subplots(1, 2, figsize=(8, 4))ax = axes.ravel()ax[0].set_title(’Original picture’)ax[0].imshow(image, cmap=plt.cm.gray)ax[0].set_axis_off()ax[1].set_title(’Transformed picture’)ax[1].imshow(chull, cmap=plt.cm.gray)ax[1].set_axis_off()plt.tight_layout()plt.show()####################################################################### We prepare a second plot to show the difference.#chull_diff = img_as_float(chull.copy())chull_diff[image] = 2fig, ax = plt.subplots()ax.imshow(chull_diff, cmap=plt.cm.gray)ax.set_title(’Difference’)plt.show()

實驗輸出

Python庫skimage繪制二值圖像代碼實例

Python庫skimage繪制二值圖像代碼實例

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 亚洲自偷自偷图片在线高清 | 亚洲欧洲日韩在线 | 国产四区 | 国产成人狂喷潮在线观看2345 | yy6080久久亚洲精品 | 日本在线亚州精品视频在线 | 三级网址免费 | 宫女淫春3在线观 | 在线成人天天鲁夜啪视频 | 在线观看一级毛片免费 | 在线免费观看毛片网站 | 国产成人三级经典中文 | 精品国产品国语在线不卡丶 | 国产特黄特色的大片观看免费视频 | 国产成人在线影院 | 中国a级淫片免费播放 | 99久久精品免费看国产 | 在线第一页 | 美国一级毛片完整高清 | 国产一级做a爱免费观看 | 欧洲成人在线 | 日本欧美做爰全免费的视频 | 99激情| 日韩性色| 国产精品资源在线 | 高清性色生活片欧美在线 | 国产精品久久久久久久久 | 欧美一级毛片免费看 | 国产主播福利精品一区二区 | 国产精品一区二区四区 | 久久中文字幕亚洲精品最新 | 国产高清在线精品一区在线 | 香港免费毛片 | 亚洲欧美日韩另类精品一区二区三区 | 国产aⅴ一区二区三区 | 久久久久久久综合 | 精品欧美高清不卡在线 | 黄色毛片三级 | 亚洲欧美久久精品一区 | 成人在线综合网 | 中文字幕日韩一区二区不卡 |