Skip to content

Commit

Permalink
Combine grain crops rather than overwriting them
Browse files Browse the repository at this point in the history
  • Loading branch information
llwiggins committed Jan 9, 2025
1 parent 980b1c2 commit ff3c815
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions topostats/grains.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,8 +1334,15 @@ def assemble_grain_mask_tensor_from_crops(
grain_mask_tensor[
min_row + padding : max_row - padding,
min_col + padding : max_col - padding,
:,
] = cropped_grain
:
] = np.maximum(
grain_mask_tensor[
min_row + padding : max_row - padding,
min_col + padding : max_col - padding,
:
],
cropped_grain
)

# Update the background class
grain_mask_tensor = Grains.update_background_class(grain_mask_tensor)
Expand Down

0 comments on commit ff3c815

Please sign in to comment.