scipy.ndimage.
generic_laplace#
- scipy.ndimage.generic_laplace(input, derivative2, output=None, mode='reflect', cval=0.0, extra_arguments=(), extra_keywords=None, *, axes=None)[source]#
使用提供的二階導數函數的 N 維拉普拉斯濾波器。
- 參數:
- inputarray_like (類陣列)
輸入陣列。
- derivative2callable (可呼叫物件)
具有以下簽名 (signature) 的可呼叫物件
derivative2(input, axis, output, mode, cval, *extra_arguments, **extra_keywords)
請參閱下方的 extra_arguments、extra_keywords。
- outputarray (陣列) 或 dtype, optional (可選)
要在其中放置輸出的陣列,或傳回陣列的 dtype。預設情況下,將建立與輸入 dtype 相同的陣列。
- modestr (字串) 或 sequence (序列), optional (可選)
mode 參數決定當濾波器與邊界重疊時,輸入陣列如何擴展。透過傳遞模式序列 (其長度等於輸入陣列的維度數),可以沿每個軸指定不同的模式。預設值為 ‘reflect’。有效值及其行為如下
- ‘reflect’ (反射) (d c b a | a b c d | d c b a)
輸入通過繞最後一個像素的邊緣反射來擴展。此模式有時也稱為半樣本對稱。
- ‘constant’ (常數) (k k k k | a b c d | k k k k)
輸入通過用相同的常數值 (由 cval 參數定義) 填充邊緣之外的所有值來擴展。
- ‘nearest’ (最近) (a a a a | a b c d | d d d d)
輸入通過複製最後一個像素來擴展。
- ‘mirror’ (鏡像) (d c b | a b c d | c b a)
輸入通過繞最後一個像素的中心反射來擴展。此模式有時也稱為全樣本對稱。
- ‘wrap’ (環繞) (a b c d | a b c d | a b c d)
輸入通過環繞到相對邊緣來擴展。
為了與內插函數保持一致,也可以使用以下模式名稱
- ‘grid-constant’ (網格常數)
這是 ‘constant’ 的同義詞。
- ‘grid-mirror’ (網格鏡像)
這是 ‘reflect’ 的同義詞。
- ‘grid-wrap’ (網格環繞)
這是 ‘wrap’ 的同義詞。
- cvalscalar (純量), optional (可選)
如果 mode 為 ‘constant’,則填充輸入邊緣之外的值。預設值為 0.0。
- extra_keywordsdict (字典), optional (可選)
要傳遞給已傳遞函數的額外關鍵字引數字典。
- extra_argumentssequence (序列), optional (可選)
要傳遞給已傳遞函數的額外位置引數序列。
- axestuple (元組) of int (整數) 或 None
要對其應用濾波器的軸。如果提供了 mode 元組,則其長度必須與軸數相符。
- 傳回值:
- generic_laplacendarray (N 維陣列)
已濾波的陣列。具有與 input 相同的形狀。