Skip to content

Commit

Permalink
threshold applied properly
Browse files Browse the repository at this point in the history
  • Loading branch information
GondekNP committed Jun 5, 2024
1 parent fd90cdf commit 5a73bf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/derive_boundary.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def apply(self, metric_layer):
class OtsuThreshold(ThresholdingStrategy):
def apply(self, metric_values):
threshold = threshold_otsu(metric_values)
burn_mask = metric_values.where(metric_values >= threshold, 1, 0)
burn_mask = (metric_values >= threshold).astype(int)
return burn_mask


Expand All @@ -26,7 +26,7 @@ def __init__(self, threshold=0.5):
self.threshold = threshold

def apply(self, metric_values):
burn_mask = metric_values.where(metric_values >= self.threshold, 1, 0)
burn_mask = (metric_values >= self.threshold).astype(int)
return burn_mask


Expand Down

0 comments on commit 5a73bf4

Please sign in to comment.