日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python---之scipy.ndimage.measurements.label

發布時間:2023/12/16 python 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python---之scipy.ndimage.measurements.label 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

scipy.ndimage.measurements.label(input, structure=None, output=None)

input:輸入一個數組,數組中非0值被認為是目標區域,0值是背景區域

structure:可以用 scipy.ndimage.generate_binary_structure函數來規定連通域圖像的維度和連通域所需要的鄰域

output:If output is a data type, it specifies the type of the resulting labeled feature array If output is an array-like object, then output will be updated with the labeled features from this function. This function can operate in-place, by passing output=input. Note that the output must be able to store the largest label, or this function will raise an Exception.

?

輸出:

label:一個被已經分好連通域的label圖像:

num_feartures:統計一共有多少種連通分量的數量,例如數字5代表一共有5種,ID分別是1,2,3,4,5

當我使用前面的structure函數時,structure定義了連通分量的空間距離到底是幾鄰域的,下面的定義了8鄰域,所以在8鄰域內部的都被歸為1類連通分量,所以連通分量就由上面的4減少為2了:

如下:

總結

以上是生活随笔為你收集整理的python---之scipy.ndimage.measurements.label的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。