av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

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

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

瀏覽:53日期: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 編程
相關文章:
主站蜘蛛池模板: 成人精品在线观看 | 蜜臀久久99精品久久久久久宅男 | 久久激情视频 | 玖玖色资源 | 精品一区二区三区三区 | 中文字幕视频在线 | 免费黄色一级视频 | 精品一区二区三区三区 | 国产精品伦一区二区三级视频 | 白白色在线观看 | 四虎网站 | 四虎影院在线免费观看 | 国产一区精品在线 | 久久久久久久网 | 狠狠干欧美 | 欧美一区二区三区免费 | 精品亚洲一区二区三区 | 成人福利在线观看 | 国产精品99久久久久久久久 | 五月婷婷六月丁香 | 午夜视频网 | av超碰在线 | 久久久久久爱 | 欧美日韩精品一区二区三区 | 欧美日韩一区在线 | 俺去俺来也在线www色官网 | 国产精品1234 | 日韩精品大片 | 久久精品人人 | 精品视频一区二区三区四区 | 亚洲一区中文 | 精品久久久久久久久久久 | av免费看片 | 一级真人毛片 | 国产成人综合视频 | 99av| 亚洲视频在线播放 | 日韩不卡av| 长河落日连续剧48集免费观看 | www99热| 中文字幕亚洲天堂 |