python cv2.findContours sample
import numpy as numpy
import cv2
def make_list(filepath: str):
# read
# find_contours
contours, hierarchy = cv2.findContours(img, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
# make list
listx =
listy =
for tmp in contours[0]:
x, y = tmp[0]
listx.append(x)
listy.append(y)
# return
return listx, listy
if __name__ == '__main__':