午夜剧场伦理_日本一道高清_国产又黄又硬_91黄色网战_女同久久另类69精品国产_妹妹的朋友在线

您的位置:首頁技術(shù)文章
文章詳情頁

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

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

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

skimage中的函數(shù)

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繪制二值圖像代碼實例

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

標簽: Python 編程
相關(guān)文章:
主站蜘蛛池模板: 视频一区国产 | 在线观看黄色小视频 | 精品国产97 | 美女久久久久 | 亚洲 欧美 中文字幕 | 欧美色视频在线观看 | 婷婷91| 亚洲网站在线播放 | 久久九九国产精品 | 国产成人在线网址 | 国产免费黄色片 | 亚洲国产成人在线视频 | 亚色成人| 日韩区在线观看 | 能看毛片的网站 | 亚洲日本高清 | 夜夜天天干 | 亚洲天堂色图 | 超碰666| av国语| 午夜精品视频在线观看 | 日韩欧美www | 美女视频一区二区 | 自拍视频一区二区 | 国产精品久久久视频 | 黄色福利在线观看 | 日韩久久一区 | 欧洲久久久久 | 一个人看的www在线视频 | 久久久久久久久久久久国产精品 | 视频一区二区在线 | 午夜视频免费观看 | 日本精品在线播放 | 亚洲日本精品 | av免费观| 国产精品尤物 | 国产一区二区三区视频 | 亚洲淫片 | 97caoporn| 久久久久免费视频 | 精品亚洲在线 |