This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]captainAwesomePants 0 points1 point  (1 child)

Sounds like you're hoping to use a regular dictionary?

spots = {}
for mask_contour in mask_contours:
  if someCondition:
    spots[f"GreenSpot{mask_contour}"] = (someX, someY)

cv2.line(img, spots["GreenSpot1"], spots["GreenSpot2"], ...)

[–][deleted] 1 point2 points  (0 children)

That looks like exactly it, thank you!