用法:
skimage.filters.scharr(image, mask=None, *, axis=None, mode='reflect', cval=0.0)
使用 Scharr 变换查找边幅度。
- image:数组
输入图像。
- mask:布尔数组,可选
将输出图像剪辑到此蒙版。 (mask=0 的值将被设置为 0。)
- axis:int 或 int 序列可选
沿该轴计算边滤波器。如果未提供,则计算边幅度。这被定义为:
sch_mag = np.sqrt(sum([scharr(image, axis=i)**2 for i in range(image.ndim)]) / image.ndim)
如果轴是一个序列,也会计算幅度。
- mode:str 或 str 序列,可选
卷积的边界模式。有关模式的说明,请参见
scipy.ndimage.convolve
- cval:浮点数,可选
什么时候模式是
'constant'
,这是在图像数据边界之外的值中使用的常数。
- output:浮点数数组
夏尔边图。
参数:
返回:
注意:
Scharr 算子比其他边滤波器(如 Sobel 或 Prewitt 算子)具有更好的旋转不变性。
参考:
- 1
D. Kroon, 2009, Short Paper University Twente, Numerical Optimization of Kernel Based Image Derivatives.
- 2
https://en.wikipedia.org/wiki/Sobel_operator#Alternative_operators
例子:
>>> from skimage import data >>> from skimage import filters >>> camera = data.camera() >>> edges = filters.scharr(camera)
相关用法
- Python skimage.filters.sobel用法及代码示例
- Python skimage.filters.unsharp_mask用法及代码示例
- Python skimage.filters.rank.noise_filter用法及代码示例
- Python skimage.filters.gaussian用法及代码示例
- Python skimage.filters.threshold_otsu用法及代码示例
- Python skimage.filters.rank.sum用法及代码示例
- Python skimage.filters.window用法及代码示例
- Python skimage.filters.gabor用法及代码示例
- Python skimage.filters.rank.autolevel用法及代码示例
- Python skimage.filters.threshold_li用法及代码示例
- Python skimage.filters.rank.pop用法及代码示例
- Python skimage.filters.rank.mean用法及代码示例
- Python skimage.filters.rank.pop_bilateral用法及代码示例
- Python skimage.filters.rank.maximum用法及代码示例
- Python skimage.filters.roberts用法及代码示例
- Python skimage.filters.rank.equalize用法及代码示例
- Python skimage.filters.rank.enhance_contrast用法及代码示例
- Python skimage.filters.rank.gradient用法及代码示例
- Python skimage.filters.LPIFilter2D.__init__用法及代码示例
- Python skimage.filters.farid用法及代码示例
注:本文由纯净天空筛选整理自scikit-image.org大神的英文原创作品 skimage.filters.scharr。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。