Skip to content

Commit bbcc281

Browse files
committed
naming function inputs
1 parent b2a5044 commit bbcc281

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

episodes/08-connected-components.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ set the entries that belong to small objects to `0`.
690690
object_areas = np.array([objf["area"] for objf in object_features])
691691
object_labels = np.array([objf["label"] for objf in object_features])
692692
small_objects = object_labels[object_areas < min_area]
693-
labeled_image[np.isin(labeled_image,small_objects)] = 0
693+
labeled_image[np.isin(labeled_image, small_objects)] = 0
694694
```
695695

696696
An even more elegant way to remove small objects from the image is
@@ -703,7 +703,7 @@ i.e, their pixel values are set to `False`.
703703
We can then apply `ski.measure.label` to the masked image:
704704

705705
```python
706-
object_mask = ski.morphology.remove_small_objects(binary_mask,min_area)
706+
object_mask = ski.morphology.remove_small_objects(binary_mask, min_size=min_area)
707707
labeled_image, n = ski.measure.label(object_mask,
708708
connectivity=connectivity, return_num=True)
709709
```
@@ -717,7 +717,7 @@ def enhanced_connected_components(filename, sigma=1.0, t=0.5, connectivity=2, mi
717717
gray_image = ski.color.rgb2gray(image)
718718
blurred_image = ski.filters.gaussian(gray_image, sigma=sigma)
719719
binary_mask = blurred_image < t
720-
object_mask = ski.morphology.remove_small_objects(binary_mask,min_area)
720+
object_mask = ski.morphology.remove_small_objects(binary_mask, min_size=min_area)
721721
labeled_image, count = ski.measure.label(object_mask,
722722
connectivity=connectivity, return_num=True)
723723
return labeled_image, count

0 commit comments

Comments
 (0)