用法:
skimage.morphology.max_tree(image, connectivity=1)
從圖像構建最大樹。
組件樹表示由應用於圖像的順序閾值操作產生的連接組件的層次結構。如果更高級別的組件包含在第一級中,則一個級別的連接組件是更高級別的組件的父級。 max-tree 是組件樹的有效表示。一個級別的連接組件由該級別的一個參考像素表示,該像素是該級別所有其他像素的父級,也是上一級參考像素的父級。 max-tree是許多形態算子的基礎,即連通算子。
- image:ndarray
要計算max-tree 的輸入圖像。此圖像可以是任何類型。
- connectivity:無符號 int 可選
鄰裏連通性。整數表示到達鄰居的最大正交步數。在 2D 中,4 鄰域為 1,8 鄰域為 2。默認值為 1。
- parent:ndarray,int64
與圖像形狀相同的數組。每個像素的值是其父級在 raveled 數組中的索引。
- tree_traverser:一維數組,int64
有序像素索引(指的是散列數組)。像素被排序,使得每個像素都位於其父級之前(除了沒有父級的根)。
參數:
返回:
參考:
- 1
Salembier, P., Oliveras, A., & Garrido, L. (1998). Antiextensive Connected Operators for Image and Sequence Processing. IEEE Transactions on Image Processing, 7(4), 555-570. DOI:10.1109/83.663500
- 2
Berger, C., Geraud, T., Levillain, R., Widynski, N., Baillard, A., Bertin, E. (2007). Effective Component Tree Computation with Application to Pattern Recognition in Astronomical Imaging. In International Conference on Image Processing (ICIP) (pp. 41-44). DOI:10.1109/ICIP.2007.4379949
- 3
Najman, L., & Couprie, M. (2006). Building the component tree in quasi-linear time. IEEE Transactions on Image Processing, 15(11), 3531-3539. DOI:10.1109/TIP.2006.877518
- 4
Carlinet, E., & Geraud, T. (2014). A Comparative Review of Component Tree Computation Algorithms. IEEE Transactions on Image Processing, 23(9), 3885-3895. DOI:10.1109/TIP.2014.2336551
例子:
我們創建一個小樣本圖像(來自 [4] 的圖 1)並構建 max-tree。
>>> image = np.array([[15, 13, 16], [12, 12, 10], [16, 12, 14]]) >>> P, S = max_tree(image, connectivity=2)
相關用法
- Python skimage.morphology.max_tree_local_maxima用法及代碼示例
- Python skimage.morphology.medial_axis用法及代碼示例
- Python skimage.morphology.h_minima用法及代碼示例
- Python skimage.morphology.dilation用法及代碼示例
- Python skimage.morphology.remove_small_holes用法及代碼示例
- Python skimage.morphology.flood_fill用法及代碼示例
- Python skimage.morphology.black_tophat用法及代碼示例
- Python skimage.morphology.h_maxima用法及代碼示例
- Python skimage.morphology.local_maxima用法及代碼示例
- Python skimage.morphology.area_closing用法及代碼示例
- Python skimage.morphology.label用法及代碼示例
- Python skimage.morphology.thin用法及代碼示例
- Python skimage.morphology.flood用法及代碼示例
- Python skimage.morphology.diameter_closing用法及代碼示例
- Python skimage.morphology.remove_small_objects用法及代碼示例
- Python skimage.morphology.reconstruction用法及代碼示例
- Python skimage.morphology.erosion用法及代碼示例
- Python skimage.morphology.diameter_opening用法及代碼示例
- Python skimage.morphology.local_minima用法及代碼示例
- Python skimage.morphology.skeletonize用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.morphology.max_tree。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。