Skip to content

Commit 33e4e2e

Browse files
committed
Added prominence_radius parameter
1 parent 0a98f70 commit 33e4e2e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pclines/accumulator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import numpy as np
1616
from skimage.feature import peak_local_max
1717
from skimage.morphology.grey import erosion, dilation
18+
from skimage.morphology import disk
1819

1920
from .rasterizer import polys
2021

@@ -238,11 +239,12 @@ def insert(self, x, weight=None):
238239
polys(p, weight, self.A)
239240

240241

241-
def find_peaks(self, t=0.8, prominence=2, min_dist=1):
242+
def find_peaks(self, t=0.8, prominence=2, prominence_radius=2, min_dist=1):
242243
"""
243244
Retrieve locations with prominent local maxima in the accumulator
244245
"""
245-
p = dilation(self.A+1)/erosion(self.A+1)
246+
selem = disk(prominence_radius)
247+
p = dilation(self.A+1, selem=selem)/erosion(self.A+1, selem=selem)
246248
peaks = peak_local_max(self.A, threshold_rel=t, min_distance=min_dist, exclude_border=False)
247249
r,c = peaks[:,0], peaks[:,1]
248250
value = self.A[r,c]

0 commit comments

Comments
 (0)