Skip to content

Commit

Permalink
Check for label instead of background when trimming pixels
Browse files Browse the repository at this point in the history
  • Loading branch information
tddough98 committed Dec 23, 2020
1 parent fe8f5a7 commit 1bd3822
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions browser/caliban.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,8 @@ def action_active_contour(self, label):
full_frame = np.copy(self.frame[..., self.feature])
full_frame[y1:y2, x1:x2] = safe_overlay

# avoid automated label cleanup if the centroid (flood seed point) is of background
# TODO: perhaps this should be "if (seed point value) != label" instead
if full_frame[int(props['centroid'][0]), int(props['centroid'][1])] == 0:
# avoid automated label cleanup if the centroid (flood seed point) is not the right label
if full_frame[int(props['centroid'][0]), int(props['centroid'][1])] != label:
img_trimmed = full_frame
else:
# morphology and logic used by pixel-trimming action, with object centroid as seed
Expand Down

0 comments on commit 1bd3822

Please sign in to comment.