magali.detect_anomalies#
- magali.detect_anomalies(data, size_range, size_multiplier=2, num_scales=10, detection_threshold=0.5, overlap_ratio=0.5, border_exclusion=0)[source]#
Detect anomalies using blob detection.
- Parameters:
data (xr.DataArray) – Input data array with coordinates “x” and “y”.
size_range (tuple) – Minimum and maximum size of detected anomalies in µm.
size_multiplier (int, optional) – Scaling factor for the detected blob sizes (default is 2).
num_scales (int, optional) – Number of sigma values for the blob detection (default is 10). A sigma value represents the scale or size of the blobs that the algorithm will detect. Smaller sigma values correspond to smaller blobs, while larger sigma values correspond to larger blobs.
detection_threshold (float, optional) – Detection threshold for the blob detection (default is 0.5). This parameter determines the sensitivity of the detection. A higher value means fewer blobs will be detected, and a lower value means more blobs will be detected.
overlap_ratio (float, optional) – Overlap fraction for merging blobs (default is 0.5).
border_exclusion (int, optional) – Border exclusion size in data units (default is 0). This parameter excludes blobs close to the border of the data array.
- Returns:
bounding_boxes (list of lists) – Bounding boxes of detected anomalies in data coordinates. Each bounding box corresponds to a detected blob, defined by the coordinates and size of the blob.