fastgac.peak_and_cluster.find_peaks_from_accumulator

fastgac.peak_and_cluster.find_peaks_from_accumulator(gaussian_normals_sorted, accumulator_normalized_sorted, find_peaks_kwargs={'distance': 4, 'height': 0.05, 'prominence': 0.07, 'threshold': None, 'width': None}, cluster_kwargs={'criterion': 'distance', 't': 0.15}, average_filter={'min_total_weight': 0.2})

Used 1D peak detection on the Gaussian Accumulator sorted by Space Filling Curve index (hilbert curve or S2ID).

By nature of this being a 1D signal of a 2D Manifold in 3D, multiple peaks close in 2D space will be detected.

Group these detected peaks using Agglomerative Hierarchal Clustering (AHC),

After things are grouped, take weighted average of the group and filter any that don’t meet a criteria.

Parameters
  • gaussian_normals_sorted (np.ndarray) – NX3 Array of the unit normals

  • accumulator_normalized_sorted (np.ndarray) – NX1 array of the normalized counts for each unit normal

  • find_peaks_kwargs (dict, optional) – 1D Signal Detector kwargs, see scipy.signal.find_peaks. Defaults to dict(height=0.05, threshold=None, distance=4, width=None, prominence=0.07).

  • cluster_kwargs (dict, optional) – AHC cluster kwargs. See scipy.spatial.fcluster Defaults to dict(t=0.15, criterion=’distance’).

  • average_filter (dict, optional) – Each group must have this much normalized value at min. Defaults to dict(min_total_weight=0.2).

Returns

integer index of peaks in gaussian_normals_sorted, interger groups by AHC, detected peak normals, the weights of the peaks

Return type

(np.ndarray, np.ndarray, np.ndarray, np.ndarray)