Open EmmanuelMess opened 3 years ago
Fixed by adding:
if lab_stats[1:, 4].size == 0:
return np.ones(img_bin.shape, dtype=np.uint8)
to line 207 of background_marker.py.
Put zeros instead if you want everything to be black.
This issue is raised when the entire image has the same single label. My fix is to insert the following code to line 207 of background_marker.py:
if np.max(img_labeled) == np.min(img_labeled):
largest_mask = np.zeros(img_bin.shape) + lab_val
largest_mask[img_labeled == 0] = 0
return largest_mask.astype(np.uint8)
Yuca plant root.