久久福利_99r_国产日韩在线视频_直接看av的网站_中文欧美日韩_久久一

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

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

瀏覽:43日期: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 編程
相關文章:
主站蜘蛛池模板: 黄色高清视频在线观看 | 九九热re | 日韩性猛交 | 久久久久亚洲美女啪啪 | 欧美伦理电影一区二区 | 99视频精品| 亚洲综合精品视频 | 久久国产精品99国产 | 欧美一级特黄aaaaaaa视频片 | 99热日本 | 91精彩视频在线观看 | 日日摸天天爽天天爽视频 | 蜜桃视频一区 | 国产精品不卡视频 | 一本一道久久精品综合 | 1000部精品久久久久久久久 | 亚洲一区二区精品 | 欧美国产日韩一区 | 性培育学校羞耻椅子调教h 欧美精品网站 | 国产色在线 | 日韩素人一区二区三区 | 韩国精品一区二区 | www.福利视频 | 国产综合一区二区 | 欧美激情精品久久久久久 | 国产伦精品一区二区三区四区视频 | 日韩欧美在线播放视频 | 精品一区二区三区免费 | 热久久这里只有精品 | 欧美视频免费在线观看 | 青娱乐99| 一区二区三区四区免费观看 | 久久一区二区三区四区 | 欧美综合在线观看 | 视频一区在线观看 | 影音先锋男人网 | 亚洲综合视频一区 | 国产精品人人做人人爽 | 人成亚洲 | 亚洲在线一区二区 | 在线久草|