Skip to content

Commit 41d330a

Browse files
committed
use rabpro regionprops
1 parent fc8c0a2 commit 41d330a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hydropop/hp_utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def simplify_classes(Ilabeled, minpatchsize, nodata=0, unique_neighbor=True, max
398398

399399
# Get all the blobs of the unique value
400400
props = ['coords','area']
401-
rp, _ = iu.regionprops(Iu, props, connectivity=2)
401+
rp, _ = ru._regionprops(Iu, props, connectivity=2)
402402

403403
# Only investigate blobs that are below the threshold
404404
smallblobs = [i for i, x in enumerate(rp['area']) if x <= minpatchsize]
@@ -453,7 +453,7 @@ def simplify_hpus(Ihpu, Iclasses, target_hpu_size, min_hpu_size, nodata):
453453
"""
454454

455455
# Find all the too-small HPUs
456-
rp, Ilabeled = iu.regionprops(Ihpu, props=['area', 'label', 'coords'])
456+
rp, Ilabeled = ru._regionprops(Ihpu, props=['area', 'label', 'coords'])
457457

458458
do_idcs = np.where(rp['area']<(target_hpu_size/2))[0]
459459

@@ -1067,7 +1067,7 @@ def create_hpus_from_classes(Iclasses, target_n_pix):
10671067
10681068
"""
10691069

1070-
rp, Ilabeled = iu.regionprops(Iclasses, props=['coords', 'area'])
1070+
rp, Ilabeled = ru._regionprops(Iclasses, props=['coords', 'area'])
10711071
Iregions = np.ones(Iclasses.shape, dtype=int) * -1
10721072
reg_label = 1
10731073
for area, coords in zip(rp['area'], rp['coords']):

0 commit comments

Comments
 (0)