From bd1a4c9794b3272c90419bdab7f9b374d0dce8e5 Mon Sep 17 00:00:00 2001 From: HaleySchuhl Date: Thu, 7 Mar 2024 09:39:07 -0600 Subject: [PATCH] deepsource issues --- plantcv/annotate/get_centroids.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plantcv/annotate/get_centroids.py b/plantcv/annotate/get_centroids.py index 70b1fd7..8fbf46b 100644 --- a/plantcv/annotate/get_centroids.py +++ b/plantcv/annotate/get_centroids.py @@ -1,7 +1,8 @@ -# Get centroids. region props method (WILL Merge into PCV.annotate, opening PR this week) +# Get centroids from mask objects from skimage.measure import label, regionprops + def get_centroids(bin_img): """Get the coordinates (row,column) of the centroid of each connected region in a binary image. @@ -18,12 +19,10 @@ def get_centroids(bin_img): labeled_img = label(bin_img) # measure regions obj_measures = regionprops(labeled_img) - coords = [] for obj in obj_measures: # Convert coord values to int coord = tuple(map(int, obj.centroid)) coords.append(coord) - return coords