Skip to content

Commit

Permalink
Use label to count labels (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottstanie authored Jul 31, 2024
1 parent c7c4a80 commit 8ff92eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dolphin/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ def intersect_conncomp(arr: np.ma.MaskedArray, axis: int) -> np.ndarray:

# Make a mask of the largest conncomp:
# Find the label with the most pixels using bincount
label_counts = np.bincount(conncomp_intersection.ravel())
label_counts = np.bincount(label.ravel())
# (ignore the 0 label)
largest_idx = np.argmax(label_counts[1:]) + 1
# Create a mask of pixels with this label
Expand Down

0 comments on commit 8ff92eb

Please sign in to comment.