local_contrast_2D¶
- pyspeckle.pyspeckle.local_contrast_2D(x, kernel)[source]¶
Calculate local (2D) spatial contrast and determine first-order statistics.
The kernel is an N x N array that describes the region over which contrast should be calculated. For example, np.ones((5,5)) would represent a 5x5 square.
Note that the dimensions of the 2D_contrast_image will not be the same as for the speckle pattern as only valid pixels resulting from the convolution are returned.
- Parameters
x – 2D speckle pattern
kernel – 2D region over which contrast is to be calculated
- Returns
2D_contrast_image, total_contrast