# pylops.utils.signalprocessing.slope_estimate¶

pylops.utils.signalprocessing.slope_estimate(d, dz, dx, smooth=20)[source]

Local slope estimation

Local slopes are estimated using the Structure Tensor algorithm [1]. Note that slopes are returned as $$arctan(\theta)$$ where $$\theta$$ is an angle defined in a RHS coordinate system with z axis pointing upward.

Parameters: d : np.ndarray Input dataset of size $$n_z \times n_x$$ dz : float Sampling in z-axis dx : float Sampling in x-axis smooth : float, optional Lenght of smoothing filter to be applied to the estimated gradients slopes : np.ndarray Estimated local slopes linearity : np.ndarray Estimated linearity

Notes

For each pixel of the input dataset $$\mathbf{d}$$ the local gradients $$d \mathbf{d} / dz$$ and $$g_z = d\mathbf{d} \ dx$$ are computed and used to define the following three quantities: $$g_{zz} = (d\mathbf{d} / dz) ^ 2$$, $$g_{xx} = (d\mathbf{d} / dx) ^ 2$$, and $$g_{zx} = d\mathbf{d} / dz * d\mathbf{d} / dx$$. Such quantities are spatially smoothed and at each pixel their smoothed versions are arranged in a $$2 \times 2$$ matrix called the smoothed gradient-square tensor:

$\begin{split}\mathbf{G} = \begin{bmatrix} g_{zz} & g_{zx} \\ g_{zx} & g_{xx} \end{bmatrix}\end{split}$

Local slopes can be expressed as $$p = arctan(\frac{\lambda_{max} - g_{xx}}{g_{zx}})$$.

 [1] Van Vliet, L. J., Verbeek, P. W., “Estimators for orientation and anisotropy in digitized images”, Journal ASCI Imaging Workshop. 1995.