Skip to content

Commit

Permalink
cast contour tuple as a list in find_objects
Browse files Browse the repository at this point in the history
  • Loading branch information
JorgeGtz committed Nov 4, 2021
1 parent f0b4a24 commit 657578f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plantcv/plantcv/find_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ def find_objects(img, mask):
if len(np.shape(ori_img)) == 2:
ori_img = cv2.cvtColor(ori_img, cv2.COLOR_GRAY2BGR)
objects, hierarchy = cv2.findContours(mask1, cv2.RETR_TREE, cv2.CHAIN_APPROX_NONE)[-2:]
# Cast tuple objects as a list
objects = list(objects)
for i, cnt in enumerate(objects):
cv2.drawContours(ori_img, objects, i, (255, 102, 255), -1, lineType=8, hierarchy=hierarchy)

Expand Down

0 comments on commit 657578f

Please sign in to comment.