Skip to content

Commit

Permalink
make labelnames an input for create_pts_mask helper
Browse files Browse the repository at this point in the history
  • Loading branch information
HaleySchuhl committed Aug 13, 2024
1 parent c1cf979 commit fad6b6e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plantcv/annotate/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ class label, by default "default"
for (x, y) in self.coords[self.label]:
self.ax.plot(x, y, marker='x', c=self.color)

def _create_pts_mask(self, bin_img):

def _create_pts_mask(self, bin_img, labelnames):
"""Fitler a binary mask based on annotations.
Parameters
Expand All @@ -176,7 +177,6 @@ def _create_pts_mask(self, bin_img):
pts_mask : numpy.ndarray
binary mask of annotations
"""
labelnames = list(self.count)
pts_mask = np.zeros(np.shape(bin_img), np.uint8)
# Create points mask from all annotations
for names in labelnames:
Expand Down Expand Up @@ -216,7 +216,9 @@ def correct_mask(self, bin_img):
added_obj_labels = []
analysis_labels = []

pts_mask = self._create_pts_mask(bin_img)
labelnames = list(self.count)

pts_mask = self._create_pts_mask(bin_img, labelnames)

final_mask = np.zeros(np.shape(bin_img), np.uint32)
debug_img = np.zeros(np.shape(bin_img), np.uint8)
Expand Down

0 comments on commit fad6b6e

Please sign in to comment.