Skip to content

Commit 50f56db

Browse files
committed
refactoring solution
1 parent bbcc281 commit 50f56db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

episodes/08-connected-components.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,9 @@ the area by indexing the `object_areas` with the label values in `labeled_image`
777777

778778
```python
779779
object_areas = np.array([objf["area"] for objf in ski.measure.regionprops(labeled_image)])
780-
object_areas = np.insert(0,1,object_areas)
780+
# prepend zero to object_areas array for background
781+
object_areas = np.insert(0, obj=1, values=object_areas)
782+
# create image where the pixels in each object are equal to that objects area
781783
colored_area_image = object_areas[labeled_image]
782784

783785
fig, ax = plt.subplots()

0 commit comments

Comments
 (0)