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

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

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

瀏覽:121日期: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 編程
相關文章:
主站蜘蛛池模板: 国产亚洲精品久久久久久 | 亚洲精品av在线 | 日韩视频在线观看一区二区 | 午夜免费成人 | 中文字幕日本视频 | 欧美一级片在线免费观看 | 在线中文字幕播放 | 国产高清视频 | 91超碰人人 | www.色偷偷| 国产21区 | 在线播放91灌醉迷j高跟美女 | 你懂的网址在线观看 | 高清久久| 日本久久高清视频 | 一区二区三区四区在线视频 | 色超碰 | 黄色小说乱 | 在线播放毛片 | 日韩中文字幕一区 | 美国黄色小视频 | 精品91视频 | 国产在线a视频 | 国产情侣一区二区三区 | 久久五月婷 | 日日爱av| 日日操天天 | 91麻豆视频在线观看 | 男人天堂a| 国产精品成人一区二区三区 | 久久久精品国产 | 超碰免费公开在线 | 欧美黄色a级 | 国产做a视频 | 日韩一级免费毛片 | 亚洲xxx视频 | 337p亚洲精品色噜噜狠狠 | 在线的av| 超碰在线超碰 | 精品一区二区在线播放 | 日韩中文字幕在线免费观看 |